Lesson 3 of 5 Azure Compute Services

Understanding Virtual Machine Scale Sets and Availability Sets

This lesson explains Virtual Machine Scale Sets, which scale identical VMs automatically, and availability sets, which protect VMs from maintenance and hardware failures within a datacentre.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe Virtual Machine Scale Sets and autoscale.
  • Explain update domains and fault domains in an availability set.
  • Distinguish scale sets, availability sets and availability zones.

Virtual Machine Scale Sets

Virtual Machine Scale Sets let you create and manage a group of identical, load-balanced VMs. Instead of creating and configuring VMs one by one, you define the configuration once, and the scale set creates as many instances as needed. The number of VM instances can increase or decrease automatically in response to demand, such as average CPU usage, or on a defined schedule, which is called autoscale.

Scale sets also manage health: unhealthy instances can be detected and replaced automatically. Instances can be spread across availability zones and fault domains, and traffic is distributed by a load balancer. Scale sets suit large-scale services such as web front ends, big compute and big data workloads, and container workloads. There is no extra charge for the scale set itself; you pay for the VMs and related resources it creates.

Availability sets

An availability set is a logical grouping of VMs that ensures they do not all fail or restart at the same time. Azure places the VMs in an availability set across two groupings:

  • Update domains group VMs that can be rebooted at the same time. During planned maintenance, Azure reboots only one update domain at a time and gives each 30 minutes to recover before moving to the next, so some VMs are always running. By default an availability set has five update domains, configurable up to 20.
  • Fault domains group VMs that share a common power source and network switch, similar to a rack. VMs are spread across up to three fault domains, so a power or network failure in one rack does not affect the others.

Availability sets cost nothing extra; you pay only for the VMs. They protect against hardware failures and planned maintenance within a single datacentre, but not against the failure of the whole datacentre. For that, VMs should be spread across availability zones, and Microsoft recommends zones, and scale sets with flexible orchestration, for new highly available deployments.

Fill in the value

Availability set numbers

Exam skills 2.2.2

Recall the numbers that describe an availability set.

Log in to try this activity Interactive activities are free with an account.

Comparing the options

Scale sets and availability sets solve different problems, although scale sets can also spread instances for resilience. The following comparison summarizes them.

Virtual Machine Scale Sets
Main purposeRun and automatically scale many identical VMs
ScalingAutomatic, based on metrics or schedules
Resilience scopeAcross fault domains or availability zones
Extra costNone beyond the VMs
Choose when Demand varies and instances are identical
Availability sets
Main purposeKeep a fixed group of VMs available during failures and maintenance
ScalingNone; VMs are created individually
Resilience scopeAcross fault and update domains within one datacentre
Extra costNone beyond the VMs
Choose when A few distinct VMs must survive rack failures and maintenance

The following diagram contrasts a scale set with an availability set.

Scale sets compared with availability sets. A virtual machine scale set runs many identical VMs and scales their number automatically on metrics or schedules, spreading them across fault domains or availability zones. An availability set keeps a fixed group of individually created VMs available by spreading them across fault domains, which have separate power and network, and update domains, which are rebooted one at a time during maintenance, within one datacentre.
Scale sets scale; availability sets spread a fixed group.
Sort into groups

Scale set or availability set?

Exam skills 2.2.2

Decide which option each statement describes.

Log in to try this activity Interactive activities are free with an account.
Worked example

Scale or availability

A news website runs on identical web server VMs. Traffic is low overnight and can increase tenfold when a major story breaks. The company wants capacity to follow demand automatically and unhealthy servers to be replaced without intervention. Which VM option meets these requirements?

Virtual Machine Scale Sets meet both requirements: autoscale adds and removes identical instances as traffic changes, and automatic instance repair replaces unhealthy VMs. An availability set would keep a fixed number of VMs available during maintenance and rack failures but would not add or remove VMs automatically.

Check yourself

What do fault domains protect a VM against?

Show answer

Failures of shared power and network hardware, such as a rack. Update domains protect against planned maintenance reboots.

Exam Tips

Remember for the exam

  • Scale sets manage many identical, load-balanced VMs and scale them automatically.
  • Availability sets spread VMs across update domains (maintenance) and fault domains (power and network).
  • Availability sets protect within one datacentre; availability zones protect against a datacentre failure.
  • Neither scale sets nor availability sets cost extra; you pay for the VMs.