salt.modules.azurearm_compute

Azure (ARM) Compute Execution Module

New in version 2019.2.0.

maintainer

<devops@decisionlab.io>

maturity

new

depends
platform

linux

configuration

This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function in order to work properly.

Required provider parameters:

if using username and password:
  • subscription_id

  • username

  • password

if using a service principal:
  • subscription_id

  • tenant

  • client_id

  • secret

Optional provider parameters:

cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud.
Possible values:
  • AZURE_PUBLIC_CLOUD (default)

  • AZURE_CHINA_CLOUD

  • AZURE_US_GOV_CLOUD

  • AZURE_GERMAN_CLOUD

salt.modules.azurearm_compute.availability_set_create_or_update(name, resource_group, **kwargs)

New in version 2019.2.0.

Create or update an availability set.

Parameters
  • name -- The availability set to create.

  • resource_group -- The resource group name assigned to the availability set.

CLI Example:

salt-call azurearm_compute.availability_set_create_or_update testset testgroup
salt.modules.azurearm_compute.availability_set_delete(name, resource_group, **kwargs)

New in version 2019.2.0.

Delete an availability set.

Parameters
  • name -- The availability set to delete.

  • resource_group -- The resource group name assigned to the availability set.

CLI Example:

salt-call azurearm_compute.availability_set_delete testset testgroup
salt.modules.azurearm_compute.availability_set_get(name, resource_group, **kwargs)

New in version 2019.2.0.

Get a dictionary representing an availability set's properties.

Parameters
  • name -- The availability set to get.

  • resource_group -- The resource group name assigned to the availability set.

CLI Example:

salt-call azurearm_compute.availability_set_get testset testgroup
salt.modules.azurearm_compute.availability_sets_list(resource_group, **kwargs)

New in version 2019.2.0.

List all availability sets within a resource group.

Parameters

resource_group -- The resource group name to list availability sets within.

CLI Example:

salt-call azurearm_compute.availability_sets_list testgroup
salt.modules.azurearm_compute.availability_sets_list_available_sizes(name, resource_group, **kwargs)

New in version 2019.2.0.

List all available virtual machine sizes that can be used to to create a new virtual machine in an existing availability set.

Parameters
  • name -- The availability set name to list available virtual machine sizes within.

  • resource_group -- The resource group name to list available availability set sizes within.

CLI Example:

salt-call azurearm_compute.availability_sets_list_available_sizes testset testgroup
salt.modules.azurearm_compute.virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs)

New in version 2019.2.0.

Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.

Parameters
  • name -- The name of the virtual machine.

  • destination_name -- The destination container name.

  • resource_group -- The resource group name assigned to the virtual machine.

  • prefix -- (Default: 'capture-') The captured virtual hard disk's name prefix.

  • overwrite -- (Default: False) Overwrite the destination disk in case of conflict.

CLI Example:

salt-call azurearm_compute.virtual_machine_capture testvm testcontainer testgroup
salt.modules.azurearm_compute.virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs)

New in version 2019.2.0.

Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation.

Parameters
  • name -- The name of the virtual machine to convert.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_convert_to_managed_disks testvm testgroup
salt.modules.azurearm_compute.virtual_machine_deallocate(name, resource_group, **kwargs)

New in version 2019.2.0.

Power off a virtual machine and deallocate compute resources.

Parameters
  • name -- The name of the virtual machine to deallocate.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_deallocate testvm testgroup
salt.modules.azurearm_compute.virtual_machine_generalize(name, resource_group, **kwargs)

New in version 2019.2.0.

Set the state of a virtual machine to 'generalized'.

Parameters
  • name -- The name of the virtual machine.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_generalize testvm testgroup
salt.modules.azurearm_compute.virtual_machine_get(name, resource_group, **kwargs)

New in version 2019.2.0.

Retrieves information about the model view or the instance view of a virtual machine.

Parameters
  • name -- The name of the virtual machine.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_get testvm testgroup
salt.modules.azurearm_compute.virtual_machine_power_off(name, resource_group, **kwargs)

New in version 2019.2.0.

Power off (stop) a virtual machine.

Parameters
  • name -- The name of the virtual machine to stop.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_power_off testvm testgroup
salt.modules.azurearm_compute.virtual_machine_redeploy(name, resource_group, **kwargs)

New in version 2019.2.0.

Redeploy a virtual machine.

Parameters
  • name -- The name of the virtual machine to redeploy.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_redeploy testvm testgroup
salt.modules.azurearm_compute.virtual_machine_restart(name, resource_group, **kwargs)

New in version 2019.2.0.

Restart a virtual machine.

Parameters
  • name -- The name of the virtual machine to restart.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_restart testvm testgroup
salt.modules.azurearm_compute.virtual_machine_start(name, resource_group, **kwargs)

New in version 2019.2.0.

Power on (start) a virtual machine.

Parameters
  • name -- The name of the virtual machine to start.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machine_start testvm testgroup
salt.modules.azurearm_compute.virtual_machines_list(resource_group, **kwargs)

New in version 2019.2.0.

List all virtual machines within a resource group.

Parameters

resource_group -- The resource group name to list virtual machines within.

CLI Example:

salt-call azurearm_compute.virtual_machines_list testgroup
salt.modules.azurearm_compute.virtual_machines_list_all(**kwargs)

New in version 2019.2.0.

List all virtual machines within a subscription.

CLI Example:

salt-call azurearm_compute.virtual_machines_list_all
salt.modules.azurearm_compute.virtual_machines_list_available_sizes(name, resource_group, **kwargs)

New in version 2019.2.0.

Lists all available virtual machine sizes to which the specified virtual machine can be resized.

Parameters
  • name -- The name of the virtual machine.

  • resource_group -- The resource group name assigned to the virtual machine.

CLI Example:

salt-call azurearm_compute.virtual_machines_list_available_sizes testvm testgroup