0
0
Azurecloud~10 mins

Availability sets for redundancy in Azure - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Availability sets for redundancy
Create Availability Set
Assign VMs to Availability Set
VMs distributed across Fault Domains
VMs distributed across Update Domains
If hardware or update failure
Only subset of VMs affected
Other VMs remain running
Service stays available
Create an availability set, place VMs inside it to spread them across fault and update domains, so failures affect only part of the VMs, keeping service running.
Execution Sample
Azure
az vm availability-set create --name myAvSet --resource-group myRG --location eastus
az vm create --name vm1 --resource-group myRG --availability-set myAvSet --image UbuntuLTS
az vm create --name vm2 --resource-group myRG --availability-set myAvSet --image UbuntuLTS
Creates an availability set and two VMs inside it, ensuring they are spread across fault and update domains for redundancy.
Process Table
StepActionResultVM DistributionService Status
1Create availability set 'myAvSet'Availability set created with 3 fault domains and 5 update domainsNo VMs yetNo service yet
2Create VM 'vm1' in 'myAvSet'VM 'vm1' createdvm1 in Fault Domain 0, Update Domain 0Service partially available
3Create VM 'vm2' in 'myAvSet'VM 'vm2' createdvm2 in Fault Domain 1, Update Domain 1Service fully available
4Simulate hardware failure in Fault Domain 0VM 'vm1' affectedvm2 unaffected in Fault Domain 1Service still available via vm2
5Simulate update in Update Domain 0VM 'vm1' rebootedvm2 running normallyService still available via vm2
6All updates and failures handledBoth VMs running after recoveryvm1 and vm2 runningService fully available
💡 Execution stops after all VMs are created and redundancy scenarios show service availability maintained.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5Final
Availability SetNoneCreated with 3 fault domains, 5 update domainsSameSameSameSame
VM vm1 StatusNot createdRunning in FD0 UD0Running in FD0 UD0Failed (hardware)Rebooting (update)Running
VM vm2 StatusNot createdNot createdRunning in FD1 UD1RunningRunningRunning
Service AvailabilityNonePartial (1 VM)Full (2 VMs)Full (vm2 only)Full (vm2 only)Full (both VMs)
Key Moments - 3 Insights
Why does the service stay available even if one VM fails?
Because VMs are placed in different fault domains, failure in one domain affects only some VMs, others keep running (see execution_table step 4).
What is the difference between fault domains and update domains?
Fault domains separate hardware to avoid simultaneous failures; update domains separate VMs for rolling updates. Both ensure not all VMs go down at once (see concept_flow).
Can VMs outside an availability set get the same redundancy?
No, only VMs in the same availability set are distributed across fault and update domains for redundancy (see execution_table steps 2 and 3).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does VM 'vm2' get created?
AStep 1
BStep 3
CStep 2
DStep 4
💡 Hint
Check the 'Action' and 'Result' columns in execution_table rows for VM creation.
According to variable_tracker, what is the status of VM 'vm1' after step 5?
ARebooting (update)
BFailed (hardware)
CRunning
DNot created
💡 Hint
Look at the 'VM vm1 Status' row under 'After Step 5' column in variable_tracker.
If we add a third VM to the availability set, how would the service availability change after a fault domain failure?
AAll VMs would fail simultaneously
BService would be unavailable
CService would still be available via VMs in other fault domains
DService availability depends on update domains only
💡 Hint
Recall from concept_flow and execution_table how fault domains isolate failures.
Concept Snapshot
Availability sets group VMs to spread them across fault and update domains.
Fault domains isolate hardware failures.
Update domains isolate planned maintenance.
This setup keeps service running if some VMs fail or reboot.
Use 'az vm availability-set create' and assign VMs to it.
Full Transcript
An availability set is created first. Then VMs are assigned to it. The availability set divides VMs into fault domains and update domains. Fault domains separate hardware racks to avoid simultaneous hardware failure. Update domains separate VMs for rolling updates. When a hardware failure or update happens, only VMs in one domain are affected. Other VMs keep running, so the service stays available. This redundancy improves reliability. The example shows creating an availability set and two VMs inside it. When one VM fails or reboots, the other VM continues serving. This keeps the service up during failures or maintenance.