In previous part of Availability Set we saw details about update domain, fault domain and availability sets, and how Azure support 99.95% up time SLA for VMs.
So in short availability sets enable you to create application which can support redundancy. Also to achieve availability it requires at least two or more virtual machines in an availability set, so that during failure or planned/unplanned maintenance, at least one VM will be up and running.
Now let’s see step by step, how to create and use Availability Sets for Virtual Machines
There are multiple ways to create availability sets as follows
This article focuses on creating availability set using Azure portal.
Step 1: Create Availability Set
Search for Availability Set in market place textbox and click on create button. It will open Create Availability Set blade.
It will ask for name of the availability set, subscription, resource group, and location for data center.
You will notice that Azure by default suggests at least two fault domains, as VMs one fault domain shares same power source and network switch.
Hence having two fault domains guarantees that even if VM in one fault domain goes down due to power outage or network issues, VM in another fault domain will be up and running. Azure allows values between 1 and 3 for number of fault domains.
Also you will notice that azure provides default value for update domain as five, not sure why five as two update domains can be sufficient, but this value can be adjusted. High number of update domains makes sense when there are more virtual machines in availability set. Azure allows values between 1 and 20 for update domains. Only once update domain is rebooted at a time in sequential way.
Click on Create button to provision availability set.
Step 2: Check in All resources
Now navigate to all resources and you will notice that availability set is provisioned and available in the list of all resources.
Click on availability set, it will open properties blade where you can manage access control and virtual machines in the availability set.
Step 3: Create VM in Availability Set
Once availability set is ready with fault domains and update domains, let’s now create virtual machines in availability set.
This article is not focusing on creating virtual machines, if you want to know more about virtual machines you can visit article Azure Virtual Machine
While creating new VM make sure that you are creating VM in the same resource group and same data center location as of availability set, else you will end up not getting availability set for association.
In the settings section under high availability you get an option to select availability set. You also have option to create availability set from here too.
Select the availability set and click ok to create VM in an availability set.
Step 4: Create at least two VMs in Availability Set
As discussed earlier if you really want to get benefits of availability set and to get uptime SLA of 99.95%, we should have at least two VMs in an availability set.
I created secondVM in same availability set.
Step 5: Check VM to Fault Domain & Update domain association
Remember we had created two fault domains and two update domains. Now both VMs are created in same availability set, let’s check how VMs are placed in fault domain and update domain.
Open properties blade of firstVM and select Availability set settings. You will notice that this VM is currently in 0th fault domain and 0th update domain.
Now let’s see secondVM. Similarly open properties blade for secondVM and select availability set properties. You will notice that currently secondVM is in 1st fault domain and 1st update domain.
This proves that Azure automatically provisions VMs in different update domains and fault domains in availability sets to provide availability.
Health and Parenting Inspiring Stories Technology Microsoft Azure SharePoint O365