Availability sets, zones and scale sets
Keep VMs running through hardware failure, maintenance and datacenter loss, and scale automatically with demand.
In this lesson you'll learn
- Fault domains and update domains in an availability set
- Availability zones and the SLAs for each design
- Virtual machine scale sets, orchestration modes and autoscale
- Scale-in policies and instance protection
1. Availability sets
New to high availability? Start here
One VM is a single point of failure. Run two or more copies of your app on separate hardware, put a load balancer in front, and users keep working when one fails. Azure gives you ways to make sure the copies really are on separate hardware.
| Item | Fault domain | Update domain |
|---|---|---|
| Protects against | Unplanned hardware failure | Planned maintenance reboots |
| Maximum | 3 (2 in some regions) | 20 (default 5) |
Exam focus
A VM can only join an availability set when it is created. An existing VM cannot be added. You must recreate it.
2. Availability zones
Zones are separate datacenters in the same region, each with its own power, cooling and networking. Spreading VMs across zones survives the loss of a whole datacenter.
| Design | Survives | VM SLA |
|---|---|---|
| Single VM, Premium SSD | Nothing beyond Azure's own repairs | 99.9% |
| Two or more VMs in an availability set | Rack failure and maintenance | 99.95% |
| Two or more VMs across zones | A whole datacenter failing | 99.99% |
A proximity placement group does the opposite: it keeps VMs physically close for the lowest latency. It must be in the same region as the VMs.
3. Virtual machine scale sets
A scale set manages a group of identical, load-balanced VMs and can add or remove instances automatically.
- Flexible orchestration (recommended): mix sizes, use normal VM APIs, spread across zones and fault domains.
- Uniform orchestration: identical instances from one model, managed as a group.
- Install software on every instance with the Custom Script or DSC extension in the model's extensionProfile.
- Scale-in policy decides which VMs go first: Default (balance across zones, then highest ID), NewestVM or OldestVM.
- Instance protection stops chosen instances from being removed or reimaged.
- Upgrade policy (Manual, Automatic or Rolling) controls how model changes reach existing instances.
Example
SS Kaiser's web tier runs 2 VMs most of the year. During the January sale, autoscale adds up to 10 as CPU climbs, spread across three zones. After the sale, the scale-in rule removes them again, so SS Kaiser only pays for the busy days.
Exam traps to remember
- Planned maintenance means update domains. Hardware failure means fault domains.
- Datacenter failure means availability zones, not sets.
- Basic load balancers needed VMs in one availability set or scale set. Standard needs one VNet.
- Autoscale needs both a scale-out and a scale-in rule.
Test yourself: 3 check questions and exam-style practice questions on this topic are in the AZ-104 Azure Administrator app.
Practise in the app