DevOps Peach

Azure Basics · Virtual Machines – Sizes, Disks, Connecting, Availability and Scale Sets · Lesson 4 of 5

Availability — Availability Sets, Fault/Update Domains and Zones

An availability set spreads VMs across fault domains (hardware) and update domains (maintenance) within one datacenter; availability zones place VMs in separate datacenters of a region to survive losing a whole datacenter.

Practice interactively →

Three situations affect VMs: unplanned hardware maintenance (Azure predicts a failure and live-migrates), unexpected downtime (the VM fails and is healed/restarted on another host), and planned maintenance (periodic platform updates).

Availability sets

flowchart TB
  subgraph AS["avset-web (1 datacenter)"]
    subgraph FD0["Fault domain 0"]
      W1["web1 (UD0)"]
      W3["web3 (UD2)"]
    end
    subgraph FD1["Fault domain 1"]
      W2["web2 (UD1)"]
    end
  end
  subgraph R["Region: 3 availability zones"]
    Z1["Zone 1: web-z1"]
    Z2["Zone 2: web-z2"]
    Z3["Zone 3: web-z3"]
  end

Availability zones

Separate physical locations in a region with independent power, cooling and networking. VMs in ≥2 zones (with a zone-redundant Standard LB) survive losing a whole datacenter; the multi-zone VM SLA is 99.99%.

Availability set Availability zone
Protects against Rack/host failures, maintenance Losing an entire datacenter
Scope One datacenter Several datacenters in the region
SLA (≥2 VMs) 99.95% 99.99%

Traps: mixing up fault domains (hardware) and update domains (maintenance); an existing VM cannot be added to an availability set (it must be recreated).

Command Meaning
az vm availability-set create -g rg-devops-lab -n avset-web --platform-fault-domain-count 2 --platform-update-domain-count 5 Create a set
az vm create ... --zone 1 VM in zone 1

Choosing a level of protection

Design Survives Typical SLA
Single VM with Premium SSD disks Host repair by live migration 99.9%
Availability set (2+ VMs) Rack or host failure, planned maintenance 99.95%
VMs across availability zones Loss of a datacenter 99.99%
Second region with replication Loss of a whole region Depends on your failover design

An SLA only counts platform availability; the application must also handle a VM disappearing, for example by keeping state in a database rather than on the VM.

Scale sets as an alternative

A Flexible scale set can spread VMs across fault domains or zones automatically, combining the placement of an availability set with easy scaling. Microsoft recommends Flexible scale sets over availability sets for new designs.

Handling maintenance

Scheduled Events is a metadata endpoint inside the VM (http://169.254.169.254/metadata/scheduledevents) that warns an application a few minutes before a reboot or freeze, so it can drain connections. Maintenance configurations let you choose a window for some platform updates, and guest OS patching can be scheduled with Azure Update Manager.

Disaster recovery and backup

High availability keeps the service running; backup lets you go back in time after deletion, corruption, or ransomware. You need both.

Latency-sensitive groups

A proximity placement group keeps VMs physically close for the lowest network latency, which trades away some availability spread. Use it only when the application truly needs it.

Practice interactively →