Virtual Machine Availability Sets in Azure

[Setting up a VM cluster within an Availability Set]

The Scope

When it comes to Azure, we can discuss Virtual Machine (VM) availability based on three levels within the scope of a single Azure region.

  1. Standalone VM — 99.9% availability (8.76 hours downtime per year)
  2. Availability Sets — 99.95% availability (4.38 hours downtime per year)
  3. Availability Zones — 99.99% availability (52.56 minutes downtime per year)

In this blog, I will be focusing only on “Availability Sets” and how it can help improve the availability of your cloud applications.

Availability Sets

Availability Sets make sure that Azure VMs are deployed across multiple isolated hardware nodes in a cluster within a single Availability Zone (AZ).

If a hardware or software failure occurs, only a subset of your VMs will be impacted and your overall solution stays operational. Availability Sets are essential for building redundancy for your cloud solution.

Each VM in an Availability Set is assigned a Fault Domain and an Update Domain by the Azure Platform.

Fault Domains

A Fault Domain is defined as a group of VMs that share a common power source and a network switch. If there is a failure in a Fault Domain, then all the resources (VMs) in the Fault Domain become unavailable.

If you have multiple tiers within your application, you can place your VMs in such a way that each Fault Domain gets a VM for each tier (see Figure 01).

You can have up to three (03) Fault Domains.

Update Domains

When a VM instance is added to an Availability Set, it is automatically assigned to an Update Domain as well. That means, each Update Domain can have multiple VMs.

Update Domains are used for the patching of VMs. Once an Update Domain carries out a patching process, all VMs within that Update Domain will get rebooted. At any given point, only one Update Domain is updated.

VM Distribution

You can have up to three (03) Fault Domains and twenty (20) Update Domains in a typical Availability Set cluster.

VMs are assigned sequentially within Fault Domains and Update Domains (see Figure 02).

Creating a VM Cluster With an Availability Set

Step 1: Creating an Availability Set

Search for Availability Sets and click the “New” button to create a new Availability Set. You can enter the number of Fault Domains and Update Domains while creating it, along with other parameters (Subscription, Resource Group, Name, Region). Pls keep Managed Disk as “Yes.

Step 2: Creating a few Virtual Machines and attaching them to the created Availability Set

Now, it is time to create some VMs and assign them to the same Availability Set that you created under step 01.

Make sure to select “Availability Set” under “Availability Options” and select the Availability Set that you created. Furthermore, make sure to choose the same Azure Region for all VMs being created.

VMs created: vm-1, vm-2, vm-3 (three VMs)

Step 3: Monitoring the Availability Set

Go to “Home” -> Select “Availability Sets” -> Select the Availability Set that you created under step 01.

You will see the Fault and Update Domain distribution as follows (see Figure 05).

Congratulations! you have now created a VM cluster within a single Availability Zone, which has 99.95% availability.



Crishantha Nanayakkara

Vice President - Technology