VMSS Instance Protection and Orchestration Modes
What you'll learn: How to prevent specific VMSS instances from being removed during scale-in and how Azure orchestrates your virtual machines.
When running a Virtual Machine Scale Set, sometimes you need to protect certain instances from being deleted during automatic scale-in operations—perhaps they're processing critical long-running tasks. Additionally, Azure gives you flexibility in how it manages your instances through orchestration modes.
Instance Protection
Instance protection is like putting a "Do Not Disturb" sign on specific VMs. When enabled for an instance, Azure's scale-in policies will skip over that protected VM, even if the scale set needs to reduce capacity. You manually protect instances when they're handling important work that shouldn't be interrupted.
Think of it like this: In a restaurant during slow hours, the manager might send servers home early—but the server handling a VIP table gets protection from being sent home until that customer finishes.
Orchestration Modes
Azure VMSS offers two orchestration modes that determine how Azure manages your instances:
Uniform mode: All VMs use identical configurations (same image, same size). Azure fully manages them as a single unit. This is simpler and ideal when all instances should be identical—like web servers behind a load balancer.
Flexible mode: Instances can have different configurations and sizes. You get more control over individual VMs while still benefiting from scale set features. Useful when you need heterogeneous workloads or want to mix instance types for cost optimization.
Uniform is like a factory assembly line (everything identical), while flexible is like a custom workshop (each piece can be unique).
Key Takeaway: Instance protection prevents critical VMs from scale-in deletion, while orchestration modes (uniform vs. flexible) determine whether your scale set enforces identical instances or allows configuration variety.