Lesson 3 of 4 VM Availability and Scale Sets

Running VM Groups with Virtual Machine Scale Sets

This lesson explains scale set orchestration modes, configuration and upgrade policies.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish between Flexible and Uniform orchestration.
  • Describe the main scale set settings, including health monitoring and automatic repairs.
  • Distinguish between the Manual, Automatic and Rolling upgrade policies.

Orchestration modes

A scale set has an orchestration mode chosen at creation. Flexible orchestration, the default and recommended mode, manages standard Azure VMs: instances can have different sizes, Spot and regular VMs can be mixed, instances are spread across fault domains and zones, and individual VMs can be added or managed with normal VM APIs. Uniform orchestration creates identical instances from a single scale set model and is used by some large stateless workloads and older deployments. Flexible scale sets give the reliability benefits of availability sets and zones together.

Sort into groups

Flexible or Uniform?

Exam skills 3.2.7

Decide which orchestration mode each statement describes.

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

Creating and configuring a scale set

Creating a scale set resembles creating a VM, with additional settings: the orchestration mode, availability zones to span, the image and size (or several sizes in Flexible mode), the initial instance count, scaling (manual, or autoscale covered in the next topic), and a load balancer or Application Gateway backend pool for the instances. Health monitoring uses a load balancer probe or the Application Health extension, and automatic repairs replace instances that report unhealthy.

The upgrade policy controls how changes to the scale set model, such as a new image or extension, reach existing instances. Manual leaves existing instances until an administrator upgrades them; Automatic upgrades all instances at once, in no particular order; Rolling upgrades in batches with a maximum percentage unhealthy and pauses between batches. Automatic OS image upgrades roll out new platform image versions safely, and Spot priority mix combines low-cost Spot VMs with regular VMs.

The following diagram maps each requirement for a stateless web tier to a scale set configuration setting.

A scale set design for a stateless web tier. A Flexible scale set spans zones 1, 2 and 3 behind a Standard load balancer with a health probe; autoscale keeps between 3 and 15 instances; and a Rolling upgrade policy with a maximum batch of 20% brings each monthly image to the instances without taking more than a fifth offline.
The scenario is illustrative.
Match the pairs

Scale set settings

Exam skills 3.2.7

Match each requirement with the scale set setting that meets it.

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

Scale set and individual VMs

The following table summarizes when to use a scale set rather than individually created VMs.

RequirementIndividual VMsScale set
Add instances automatically with loadNot availableAutoscale
Spread across zones and fault domainsPlan manuallyAutomatic
Apply one image or configuration change to allEach VM separatelyUpgrade policy
Replace unhealthy instancesManuallyAutomatic repairs
Worked example

Designing a web tier

A stateless web application needs between 3 and 15 instances, spread across all zones, behind a load balancer. New application images are published monthly and must reach instances without taking more than 20% of capacity offline at a time. Which scale set configuration meets the requirements?

Create a Flexible scale set spanning zones 1, 2 and 3, with the instances in a Standard load balancer backend pool and a health probe, autoscale with a minimum of 3 and maximum of 15, and a Rolling upgrade policy with a maximum batch of 20%. An Automatic upgrade policy could upgrade every instance at once, and Manual would require someone to upgrade instances each month.

Check yourself

Which upgrade policy updates instances in batches with pauses between them?

Show answer

Rolling.

Exam Tips

Remember for the exam

  • Flexible orchestration is the default and recommended mode.
  • Rolling upgrades change instances in batches; Automatic upgrades all at once.
  • Automatic repairs replace unhealthy instances using a health probe or the Application Health extension.
  • Scale sets can span availability zones.