Availability sets, zones and scale sets

AZ-104 Azure AdministratorComputeAbout 20 minutesBy Cloud Hands On

Keep VMs running through hardware failure, maintenance and datacenter loss, and scale automatically with demand.

In this lesson you'll learn

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.

Six VMs spread across three fault domains (racks) and five update domains in one datacenter One datacenter Fault domain 0rack, power, switch VM1 UD 0VM4 UD 3 Fault domain 1rack, power, switch VM2 UD 1VM5 UD 4 Fault domain 2rack, power, switch VM3 UD 2VM6 UD 0
A rack failure takes out one fault domain. Planned maintenance reboots one update domain (UD) at a time.
ItemFault domainUpdate domain
Protects againstUnplanned hardware failurePlanned maintenance reboots
Maximum3 (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.

DesignSurvivesVM SLA
Single VM, Premium SSDNothing beyond Azure's own repairs99.9%
Two or more VMs in an availability setRack failure and maintenance99.95%
Two or more VMs across zonesA whole datacenter failing99.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.
Autoscale: instance count rises when CPU stays above 70 percent and falls when it drops below 30 percent TimeCPU Scale out above 70% Scale in below 30% 2 VMs4 VMs2 VMs
Always pair a scale-out rule with a scale-in rule, and set minimum and maximum instance counts.
  • 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

Keep going