Availability Sets in Azure Virtual Machines

Last updated:

Azure Availability Sets are a logical grouping of virtual machines within an Azure datacenter that provides redundancy and high availability. They help ensure that your applications remain available during planned maintenance or unplanned hardware failures.

Understanding Availability Sets

An Availability Set consists of two main components:

Diagram showing Update Domains and Fault Domains

Visual representation of Availability Sets with Update and Fault Domains.

Why Use Availability Sets?

Availability Sets are crucial for:

How Availability Sets Work

When you create an Availability Set and then deploy virtual machines into it, Azure automatically distributes these VMs across the different Update Domains and Fault Domains. This distribution ensures that:

Creating an Availability Set

You can create an Availability Set through the Azure portal, Azure CLI, or Azure PowerShell. When creating it, you typically specify:

Example using Azure CLI:

az vm availability-set create \ --resource-group myResourceGroup \ --name myAvailabilitySet \ --location eastus \ --platform-fault-domain-count 3 \ --platform-update-domain-count 5

Deploying VMs to an Availability Set

Once an Availability Set is created, you can deploy new virtual machines directly into it. You select the Availability Set when configuring the virtual machine in the Azure portal or by specifying its ID in scripts.

Important: Virtual machines cannot be added to an Availability Set after they have been created. You must specify the Availability Set during the VM creation process.

Managing Availability Sets

After deployment, you can monitor the status of your Availability Set and the VMs within it through the Azure portal. This includes information about which Fault Domain and Update Domain each VM is assigned to.

Limitations and Considerations

Next Steps

To learn more about ensuring application availability in Azure, consider exploring: