Microsoft Azure (AZ-104): Virtual Machine Scale Set and Availability Set
Both scale set and availability set provides a Service Level Agreement (SLA) of 99.95 percent availability.
What is Azure Virtual Machine Scale Sets?
This feature lets you create and manage a group of load balanced VMs where the number of VM instances can automatically increase or decrease in response to demand or a defined schedule.
You can scale the number of VMs in the scale set manually, or define rules to autoscale based on resource usage like CPU, memory demand, or network traffic. An Azure load balancer then distributes traffic to the VM instances in the scale set.
When you define a virtual machine scale set with an Azure template,
the Microsoft.Compute/virtualMachineScaleSets resource provider can include a section on extensions.
For example, to ensure that web server are installed when scale set virtual machines are provisioned, we can upload configuration script and modify the extensionProfile details of the ARM template.
How to deploy Azure Virtual Machine Scale Sets?
- Search for “Load Balancer” → Configure public IP address for load balancer’s front end.
- Search for “Scale Set” → Select “Virtual Machine Scale Sets” → Choose to deploy “Windows Server Image” or “Linux Image” → Leave the default for “Instance and Disks” pages.
- On the “Networking” page, under “Load Balancing”, select “Yes” to put scale set instances behind a load balancer.
- In “Load balancing” options, select the “Azure load balancer” that you have created earlier.
What is Availability Set?
An availability set is a logical grouping of VMs to provide for redundancy and availability. There is no cost for the Availability Set itself, you only pay for each VM instance that you create.
When adding VMs to an Availability Set, Azure automatically assigns each VM an Update Domain and a Fault Domain. Each availability set can be configured with up to three fault domains and twenty update domains.
What is Update Domains?
Update domains indicate groups of virtual machines and underlying physical hardware that can be rebooted at the same time.
Let’s say we have an app that runs on two Azure virtual machines. We plan to implement Azure Availability Set for App1. App1 must be available during planned maintenance. How many update domains should we implement?
Two update domains will be needed. Adding VMs in the same update domain will not meet the requirements since it shares same underlying physical hardware that can be rebooted at the same time.
What is Fault Domains?
By default, Availability Sets have three Fault Domains, each sharing a common power source and network switch, and VMs are automatically separated across the Fault Domains.
- Do remember that, Availability Sets can’t protect virtual machines from a data center level failure. To mitigate data center level failure, we need to deploy the VMs across different availability zones.
- To ensure that we have a guaranteed SLA of 99.5% uptime, we should use a combination of Managed Disks and Availability Sets. Managed Disks isolate each disk by placing the disks in different storage fault domains.
- Ideally, we should create availability sets based on the number of tiers we have for our applications.