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

az vm availability-set convert Convert an Azure Availability Set to contain VMs with managed disks.
az vm availability-set create Create an Azure Availability Set.
az vm availability-set delete Delete an availability set.
az vm availability-set list List availability sets.
az vm availability-set list-sizes List VM sizes for an availability set.
az vm availability-set show Get information for an availability set.
az vm availability-set update Update an Azure Availability Set.

az vm availability-set convert

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

az vm availability-set convert --name
--resource-group

Examples

Convert an availabiity set to use managed disks by name.

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)

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>`.

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]
[--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. You can configure the default location using `az configure --defaults location=<location>`.
--no-wait
Do not wait for the long running operation to finish.
--platform-fault-domain-count
Fault Domain count.
default value: 2
--platform-update-domain-count
Update Domain count. If unspecified, server picks the most optimal number like 5. For the latest defaults see https://docs.microsoft.com/en-us/rest/api/compute/availabilitysets/availabilitysets-create.
--tags
Space separated tags in 'key[=value]' format. Use "" to clear existing tags.
--unmanaged
Contained VMs should use unmanaged disks.
--validate
Generate and validate the ARM template without creating any resources.

az vm availability-set delete

Delete an availability set.

az vm availability-set delete --name
--resource-group

Examples

Delete an availability set.

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

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>`.

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

Required Parameters

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

az vm availability-set list-sizes

List VM sizes for an availability set.

az vm availability-set list-sizes --name
--resource-group

Examples

List VM sizes for an availability set.

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

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>`.

az vm availability-set show

Get information for an availability set.

az vm availability-set show --name
--resource-group

Examples

Get information about an availability set.

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

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>`.

az vm availability-set update

Update an Azure Availability Set.

az vm availability-set update --name
--resource-group
[--add]
[--remove]
[--set]

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

Required Parameters

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

Optional Parameters

--add
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty .
--remove
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
--set
Update an object by specifying a property path and value to set. Example: --set property1.property2=.