az vm availability-set

Group resources into availability sets.

To provide redundancy to an application, it is recommended to group two or more virtual machines in an availability set. This configuration ensures that during either a planned or unplanned maintenance event, at least one virtual machine will be available.

Commands

Name Description Type Status
az vm availability-set convert

Convert an Azure Availability Set to contain VMs with managed disks.

Core GA
az vm availability-set create

Create an Azure Availability Set.

Core GA
az vm availability-set delete

Delete an availability set.

Core GA
az vm availability-set list

List availability sets.

Core GA
az vm availability-set list-sizes

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

Core GA
az vm availability-set show

Get information about an availability set.

Core GA
az vm availability-set update

Update an Azure Availability Set.

Core GA

az vm availability-set convert

Convert an Azure Availability Set to contain VMs with managed disks.

az vm availability-set convert [--ids]
                               [--name]
                               [--resource-group]
                               [--subscription]

Examples

Convert an availabiity set to use managed disks by name.

az vm availability-set convert -g MyResourceGroup -n MyAvSet

Convert an availability set to use managed disks by ID.

az vm availability-set convert --ids $(az vm availability-set list -g MyResourceGroup --query "[].id" -o tsv)

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the availability set.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az vm availability-set create

Create an Azure Availability Set.

az vm availability-set create --name
                              --resource-group
                              [--location]
                              [--no-wait]
                              [--platform-fault-domain-count]
                              [--platform-update-domain-count]
                              [--ppg]
                              [--tags]
                              [--unmanaged]
                              [--validate]

Examples

Create an availability set.

az vm availability-set create -n MyAvSet -g MyResourceGroup --platform-fault-domain-count 2 --platform-update-domain-count 2

Required Parameters

--name -n

Name of the availability set.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--platform-fault-domain-count

Fault Domain count.

default value: 2
--platform-update-domain-count

Update Domain count. If unspecified, the server will pick the most optimal number like 5.

--ppg

The name or ID of the proximity placement group the availability set should be associated with.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--unmanaged

Contained VMs should use unmanaged disks.

default value: False
--validate

Generate and validate the ARM template without creating any resources.

default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az vm availability-set delete

Delete an availability set.

az vm availability-set delete [--availability-set-name]
                              [--ids]
                              [--resource-group]
                              [--subscription]

Examples

Delete an availability set.

az vm availability-set delete -n MyAvSet -g MyResourceGroup

Optional Parameters

--availability-set-name --name -n

The name of the availability set.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az vm availability-set list

List availability sets.

az vm availability-set list [--resource-group]

Examples

List availability sets.

az vm availability-set list -g MyResourceGroup

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az vm availability-set list-sizes

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

az vm availability-set list-sizes [--availability-set-name]
                                  [--ids]
                                  [--resource-group]
                                  [--subscription]

Examples

List VM sizes for an availability set.

az vm availability-set list-sizes -n MyAvSet -g MyResourceGroup

Optional Parameters

--availability-set-name --name -n

The name of the availability set.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az vm availability-set show

Get information about an availability set.

az vm availability-set show [--availability-set-name]
                            [--ids]
                            [--resource-group]
                            [--subscription]

Examples

Get information about an availability set.

az vm availability-set show -n MyAvSet -g MyResourceGroup

Optional Parameters

--availability-set-name --name -n

The name of the availability set.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az vm availability-set update

Update an Azure Availability Set.

az vm availability-set update [--add]
                              [--force-string]
                              [--ids]
                              [--name]
                              [--ppg]
                              [--remove]
                              [--resource-group]
                              [--set]
                              [--subscription]

Examples

Update an availability set.

az vm availability-set update -n MyAvSet -g MyResourceGroup

Update an availability set tag.

az vm availability-set update -n MyAvSet -g MyResourceGroup --set tags.foo=value

Remove an availability set tag.

az vm availability-set update -n MyAvSet -g MyResourceGroup --remove tags.foo

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

default value: []
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the availability set.

--ppg

The name or ID of the proximity placement group the availability set should be associated with.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

default value: []
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.