VMs and Virtual Machine Scale Sets
IaaS compute and how it scales
Azure VMs are IaaS machines with SKU families; VMSS is autoscaling VMs in zones. Know VM sizes, images, disks, and how VMSS + Autoscale keep the right number of machines.
What you will learn
- Choose VM sizes by workload (general purpose, compute, memory, GPU)
- Explain VMSS, autoscaling and instance orchestration
- Use managed disks, snapshots and boot diagnostics
An Azure VM is a virtual machine with a chosen SKU (family+size), an image, managed disks, and public/private IPs. VMSS is a group of VMs that scales automatically across zones based on load metrics or schedules.
What is this?
Azure VMs come in families: general purpose (D, B), compute-optimized (F), memory-optimized (E), storage-optimized (L), GPU (NC/ND) and HPC. A VM uses an image (Ubuntu, Windows Server) and managed disks (Ultra/Premium SSD/Standard SSD/Standard HDD). VMSS (Virtual Machine Scale Sets) is an automatically managed pool: capacity, update policies, autoscaling rules (CPU, custom metrics, scheduled), and health monitoring. Availability sets/zones protect through fault/update domain and zone distribution.
Why do you need it?
- VMs are still the home of legacy/compliance-bound workloads — the fastest migration pattern.
- VMSS turns scaling into config: rules, min/max instance count, and health polling.
- Managed disks snapshot, resize and attach cleanly — no manual storage housekeeping.
- Sizing right the first time is the cheapest cost optimization you'll ever do.
Mental model
A fleet of taxis vs a self-dispatching fleet
Standalone VMs vs VMSS
You can call one taxi (provision a VM) each time, or set up a fleet app that dispatches more cars when the queue grows and idles them when quiet — VMSS with autoscale.
How it works
- The VM size pins vCPUs/RAM/network; SKU family targets a workload class (B-series burstable for dev).
- Managed disks persist at their own tier; ephemeral OS disks trade resilience for performance.
- VMSS instance count is the managed dimension — autoscale rules add/remove instances based on metrics and cooldowns.
- Health: configured probes drive 'unhealthy instances reset/replaced' with the automatic repairs feature.
- Zones: VMSS can spread instances across multiple zones for zone-level HA.
How VMSS autoscaled across zones.
In production
- A rendering farm uses GPU-family VMs in a VMSS scaled on queue depth, using Spot instances for elasticity.
- A Windows estate runs on B-series burstable for dev and D-series for prod, with snapshots for DR.
- A gaming backend spreads a VMSS across 2 zones with a health probe that replaces failing instances automatically.
Best practices
- Right-size before scaling; a bigger-than-needed fleet hides in autoscale.
- Prefer managed disks + disk encryption; enable boot diagnostics.
- Use VMSS with zones and health probes, not a single oversized VM.
- Separate OS disk from data disks to snapshot only what changes.
Common mistakes
- Choosing a huge SKU for burst traffic and paying for idle.
- No autoscale minimum, so traffic collapse scales to zero and cold-starts the fleet.
- Ignoring cooldown values — rapid scale-up/down cycles look like a sawtooth bill.
- Forgetting images drift, so VMs become pets instead of cattle.
Common issues
Autoscale not scaling outMetric thresholds never cross, or cooldown/evaluation windows are too long
Watch the metric live, tighten the evaluation period, and check autoscale status in the portal.
Scale set deallocates instances daily at 3amA scheduled autoscale rule fires at a wrong timezone/time
Review scheduled rules and use UTC consistently.
Snapshots ballooning storage costFull snapshots taken hourly without differential/incremental
Use incremental snapshots and set a retention policy.
Debugging tips
- VM won't boot: check boot diagnostics and serial console logs, not just status.
- Scale-in storms: review autoscale cooldowns and the metric the rule watches.
- Disk full: monitor disk utilization and grow managed disks while attached.
- VM unreachable: audit NSG inbound rule, public IP and a probe endpoint.
Interview checkpoint
Hands-on lab
- Create a VMSS in two zones
- Configure an autoscale rule
- Observe instance count changes
Autoscale a VMSS with the CLI
30 min · intermediate
Quick quiz
What does a Virtual Machine Scale Set add over standalone VMs?