Skip to content

Microsoft Azure Microsoft Azure: Compute - Virtual Machines

Summary

This module contains actions for viewing and managing Azure Virtual Machines.

Actions

azure.compute.virtual_machines.

get_all

Get all virtual machines.

Minimum Plugin Version: 1.0.0

Input
  • azure_client: an AzureClient dictionary

  • subscription_id: the subscription ID

  • resource_group_name: the resource group name (Optional)

Output

A list of VirtualMachine dictionaries.

Example
1
2
3
4
5
6
- azure.compute.virtual_machines.get_all:
    resource_group_name: ppa
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets
  save: all_virtual_machines

azure.compute.virtual_machines.

get_by_name

Get all virtual machines.

Minimum Plugin Version: 1.0.0

Input
  • azure_client: an AzureClient dictionary

  • subscription_id: the subscription ID

  • name: the virtual machine name

  • resource_group_name: the resource group name (Optional)

Output

A Single VirtualMachine dictionary.

Example
1
2
3
4
5
6
- azure.compute.virtual_machines.get_by_name:
    name: ppa-dev
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets
  save: ppa_dev_instance

azure.compute.virtual_machines.

get_untagged

Get untagged virtual machines.

Minimum Plugin Version: 1.0.0

Input
  • azure_client: an AzureClient dictionary

  • subscription_id: the subscription ID

  • resource_group_name: the resource group name (Optional)

Output

A list of VirtualMachine dictionaries.

Example
1
2
3
4
5
6
- azure.compute.virtual_machines.get_untagged:
    resource_group_name: ppa
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets
  save: untagged_virtual_machines

azure.compute.virtual_machines.

input_table

Display a list of instances in a table, & allow the task operator to make a selection.

The table will have the following columns:

  • Resource Name
  • Resource ID

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • instances: a list of VirtualMachine dictionaries to display in the table

  • minimum: The minimum number of acceptable selections (Optional)

  • maximum: The maximum number of acceptable selections (Optional)

Output

A list of VirtualMachine dictionaries.

Tip
  • If neither a minimum or maximum is provided, the task operator will be able to submit 0 selections.

  • If minimum or maximum are provided, the operation will repeat until a valid number of selections is made.

Example

Finding instances with get_all, saving them as groups, & waiting for a single selection:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
- azure.compute.virtual_machines.get_all:
    resource_group_name: ppa
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets
  save: instances

- azure.compute.virtual_machines.input_table:
    text: Choose a virtual machine
    minimum: 1
    maximum: 1
  load:
    instances: instances
  save: selected_instance

azure.compute.virtual_machines.

output_table

Display a list of instances in a table.

The table will have the following columns:

  • Resource Name
  • Resource ID

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • groups: a single or list of VirtualMachine dictionaries

Output

Nothing is outputted by this action.

Single Instance

Finding an instance with get_by_name, saving it as vm, & displaying it:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
- azure.compute.virtual_machines.get_by_name:
    resource_group_name: ppa
    name: ppa-dev
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets
  save: vm

- azure.compute.virtual_machines.output_table:
    text: ppa-dev
  load:
    instances: vm
Multiple Instances

Finding all instances with get_all, saving them as instances, & displaying them:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
- azure.compute.virtual_machines.get_all:
    resource_group_name: ppa
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets
  save: instances

- azure.compute.virtual_machines.output_table:
    text: All Instances
  load:
    instances: instances

azure.compute.virtual_machines.

start

Start an instance.

Minimum Plugin Version: 1.0.0

Input
  • azure_client: an AzureClient dictionary

  • subscription_id: the subscription ID

  • name: the virtual machine name

  • resource_group_name: the resource group name

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
- azure.compute.virtual_machines.start:
    name: ppa-dev
    resource_group_name: ppa
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets

azure.compute.virtual_machines.

stop

Stop an instance.

Minimum Plugin Version: 1.0.0

Input
  • azure_client: an AzureClient dictionary

  • subscription_id: the subscription ID

  • name: the virtual machine name

  • resource_group_name: the resource group name

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
- azure.compute.virtual_machines.stop:
    name: ppa-dev
    resource_group_name: ppa
  load:
    subscription_id: subscription_id
    azure_client: azure_secrets