Compute Design: VMs & When to Use Them
VM sizing, SKU selection, dedicated hosts, and the big question β when should you even use VMs? Design compute solutions that match workload requirements without over-provisioning.
Choosing the right compute model
Azure offers four compute models β the architectβs job is choosing the right one for each workload.
VMs (IaaS): Full control, any OS, any software β but you manage everything. Like renting an empty office and furnishing it yourself.
Containers: Package your app with its dependencies β runs anywhere consistently. Like moving with pre-packed boxes.
App Service (PaaS): Just deploy your code β Azure handles the infrastructure. Like renting a serviced office.
Functions (Serverless): Run code in response to events β pay only when it runs. Like hiring a freelancer per task.
The compute decision tree
| Factor | Virtual Machines | AKS (Containers) | App Service | Azure Functions |
|---|---|---|---|---|
| Model | IaaS | Container orchestration | PaaS | Serverless / PaaS |
| Control | Full OS + runtime | Container runtime + orchestration | Runtime only | Function code only |
| Scaling | VMSS (manual/auto) | Pod autoscaler + cluster autoscaler | Built-in auto-scale | Automatic (event-driven) |
| Startup time | Minutes | Seconds | Seconds | Milliseconds (warm) to seconds (cold) |
| Min cost | Per-VM-hour (always on) | Node pool VMs (always on) | Free tier / B1 from ~$13/mo | Free tier / pay per execution |
| Max scale | 1000s of VMs (VMSS) | 1000s of pods | 30 instances (100 with zone) | 200 instances (Consumption) |
| Best for | Legacy apps, OS-level control, specific software | Microservices, multi-container apps | Web apps, APIs, simple deployments | Event processing, integrations, scheduled tasks |
Design principle: Start with the highest-level abstraction that meets your requirements. Functions > App Service > Containers > VMs. Only go lower when you need the control.
VM-based solution design
When VMs are the right choice, design decisions include:
VM sizing and SKU families
| Family | Optimised For | Example SKUs | Use Case |
|---|---|---|---|
| B-series | Burstable | B2s, B4ms | Dev/test, low-traffic web servers |
| D-series | General purpose | D4s_v5, D8s_v5 | Most production workloads |
| E-series | Memory-optimised | E4s_v5, E16s_v5 | Databases, in-memory caching |
| F-series | Compute-optimised | F4s_v2, F16s_v2 | Batch processing, gaming, analytics |
| N-series | GPU | NC6s_v3, ND40rs_v2 | ML training, rendering, HPC |
| L-series | Storage-optimised | L8s_v3, L16s_v3 | Big data, data warehousing, large databases |
| M-series | Memory-intensive | M128s, M416s_v2 | SAP HANA, extremely large in-memory databases |
ποΈ Priyaβs VM selection: GlobalTechβs migration:
- Web servers: D4s_v5 (general purpose, good balance of CPU/memory)
- SQL Servers: E16s_v5 (memory-optimised for in-memory queries)
- Batch processing: F8s_v2 (compute-optimised, short-lived workloads)
- Dev/test: B2s (burstable, cheap when idle)
Dedicated hosts and isolation
| Option | Isolation Level | Use Case |
|---|---|---|
| Standard VMs | Shared hardware (hypervisor isolation) | Most workloads |
| Isolated VM sizes | Dedicated hardware (single-tenant) | Compliance requiring hardware isolation |
| Azure Dedicated Host | Entire physical server dedicated to you | Maximum control, licensing compliance (BYOL) |
π¦ Elenaβs requirement: PCI DSS requires hardware isolation for payment processing VMs. Elena uses Azure Dedicated Host β the entire physical server hosts only FinSecureβs VMs, with visibility into maintenance schedules.
Cost Optimisation: Reserved Instances and Spot VMs
Reserved Instances (1 or 3 year): Save 30-72% vs pay-as-you-go for predictable workloads. Commit to a VM size and region.
Spot VMs: Save up to 90% by using surplus Azure capacity. VMs can be evicted with 30-second notice. Perfect for batch processing, dev/test, and fault-tolerant workloads.
Azure Hybrid Benefit: Use existing Windows Server or SQL Server licenses on Azure VMs β save up to 85% when combined with reserved instances.
Design pattern: Production = Reserved Instances. Batch = Spot VMs. Dev/test = B-series + Spot.
Knowledge check
ποΈ GlobalTech is migrating a legacy application that requires Windows Server 2019, custom COM+ components, and direct disk access. The application cannot be refactored. Which compute option should Priya recommend?
π NovaSaaS runs a memory-intensive analytics engine on Azure VMs that processes 500 GB datasets in RAM. The workload is steady Monday-Friday but idle on weekends. Marcus wants to minimise cost while ensuring consistent performance during business hours. Which approach should he recommend?
π¬ Video coming soon
Next up: When VMs are too heavy β Container Solutions: AKS, ACI & Container Apps.