Save up to 90% on compute costs by using Azure's unused capacity for interruptible workloads
Azure Spot VMs let you purchase unused Azure compute capacity at massive discounts—up to 90% off pay-as-you-go prices. The catch? Azure can evict your VM with 30 seconds notice when it needs the capacity back for regular customers.
Think of Spot VMs like standby airline tickets: Airlines sell empty seats at steep discounts to standby passengers, but if a full-fare customer shows up, the standby passenger gets bumped. Same concept. Azure sells unused compute capacity cheaply, but reserves the right to reclaim it when needed.
Spot VM prices fluctuate based on supply and demand in each Azure region. When Azure has excess capacity, Spot prices drop. When demand is high, prices rise (potentially to pay-as-you-go rates).
| Pricing Model | Hourly Rate | Monthly Cost | Savings |
|---|---|---|---|
| Pay-as-you-go | $0.192 | $140 | - |
| 1-Year Reserved | $0.118 | $86 | 39% off |
| Spot VM (typical) | $0.019 | $14 | 90% off |
Bottom Line: A VM that costs $140/month pay-as-you-go can run for $14/month as a Spot VM. That's the same price as running it for just 73 hours at regular rates. If you can tolerate interruptions, the savings are extraordinary.
This is a hypothetical, illustrative example for teaching purposes, not an actual case study.
Company runs continuous integration builds (40 VMs), nightly data processing jobs (30 VMs), and dev/test environments (20 VMs). All of these workloads are interruptible—if a VM disappears, the job can restart elsewhere.
| Workload Type | VM Count | VM Size | Monthly Cost |
|---|---|---|---|
| CI/CD Build Agents | 40 | D4s_v3 (4 vCPU, 16GB) | $5,600 |
| Nightly Batch Processing | 30 | D8s_v3 (8 vCPU, 32GB) | $8,400 |
| Dev/Test Environments | 20 | D4s_v3 (4 vCPU, 16GB) | $2,800 |
| Total Monthly Cost | $16,800 | ||
| Workload Type | VM Count | Spot Savings | Monthly Cost |
|---|---|---|---|
| CI/CD Build Agents | 40 | 90% off | $560 |
| Nightly Batch Processing | 30 | 90% off | $840 |
| Dev/Test Environments | 20 | 90% off | $280 |
| Total Monthly Cost | $1,680 | ||
Bottom Line: By migrating interruptible workloads to Spot VMs, this company saves $181K annually. The workloads are already designed to handle failures (CI/CD can retry builds, batch jobs checkpoint progress, dev/test environments can restart), so evictions are handled gracefully at minimal operational cost.
Let's see how Spot VMs affect the financial statements for a $12M ARR SaaS company:
| P&L Line Item | Before Spot VMs | After Spot VMs |
|---|---|---|
| Revenue | $12,000,000 | $12,000,000 |
| Cost of Revenue: | ||
| Production infrastructure (Azure) | ($400,000) | ($400,000) |
| CI/CD + Batch + Dev/Test (Azure) | ($201,600) | ($20,160) |
| Other COGS | ($300,000) | ($300,000) |
| Gross Profit | $11,098,400 | $11,279,840 |
| Gross Margin % | 92.5% | 94.0% |
| Operating Expenses (R&D, S&M, G&A) | ($9,000,000) | ($9,000,000) |
| Operating Income (EBIT) | $2,098,400 | $2,279,840 |
| Operating Margin % | 17.5% | 19.0% |
Why This Matters: Moving non-production workloads to Spot VMs improved operating margin by 1.5 percentage points. For SaaS companies, every point of margin matters—investors benchmark on Rule of 40 (growth + margin ≥ 40%). With 25% growth, this company went from 42.5 (17.5% margin) to 44.0 (19% margin)—strengthening their investor story with zero impact to customer-facing services.
Spot VMs are ideal for workloads that can tolerate interruptions and restart automatically:
Build agents, test runners, deployment workers. If evicted, the build simply retries on another VM. Typical savings: 85-90%.
Data pipelines, ETL jobs, report generation. Use checkpointing to save progress. If evicted, resume from last checkpoint. Savings: 80-90%.
Developer workstations, QA environments, staging. Eviction just means "restart the VM." Developers don't notice. Savings: 85-90%.
Video transcoding, 3D rendering, image processing. Jobs are queued and retried if interrupted. Perfect Spot VM candidate. Savings: 85-90%.
Spark clusters, Hadoop jobs, ML training. Frameworks handle node failures gracefully. Use Spot for worker nodes, regular VMs for master. Savings: 70-85%.
Simulations, genomic analysis, HPC workloads. Long-running but can checkpoint. If evicted, save state and resume. Savings: 80-90%.
Avoid Spot VMs for mission-critical or customer-facing workloads:
Rule of Thumb: If losing the VM would impact customers, break SLAs, or lose unsaved data → don't use Spot. If it's a background job that can retry → Spot is perfect.
Azure gives you 30 seconds warning before evicting a Spot VM via the Azure Metadata Service. Here's how to architect for graceful handling:
Poll the Azure Metadata Service every 5-10 seconds:
curl -H "Metadata:true" "http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01"
If response includes "Preempt" event → you have 30 seconds.
Save state to durable storage (Azure Storage, Cosmos DB, message queue) every few minutes. On eviction, save final state and exit gracefully. When job resumes on new VM, load checkpoint and continue.
Don't assign work directly to VMs. Use Azure Storage Queue or Service Bus. Workers pull jobs, process them, and mark complete. If a worker disappears (eviction), the message becomes visible again and another worker picks it up. Zero data loss.
For large clusters (Spark, Kubernetes), use regular VMs for control plane/master nodes and Spot VMs for worker nodes. Workers can disappear without breaking the cluster. Typical mix: 10% regular, 90% Spot.
If you need 40 workers, provision 50 Spot VMs. When evictions happen, you still have capacity. The cost savings (90% off) mean you can afford over-provisioning.
az vm create \
--resource-group myRG \
--name mySpotVM \
--image UbuntuLTS \
--size Standard_D4s_v3 \
--priority Spot \
--max-price -1 \
--eviction-policy Deallocate
For large deployments, use VMSS with Spot priority:
Disclosure: Turbo360 is one of this site's supporting partners—see the homepage. Treat these figures as illustrative, not independently verified.
When pitching Spot VMs to leadership, emphasize these points:
Executive Talking Point: "By migrating our CI/CD pipelines, batch processing, and dev/test environments to Azure Spot VMs, we can reduce infrastructure costs by $181K annually—a 90% reduction for these workloads. This improves our operating margin from 17.5% to 19.0%, strengthening our Rule of 40 performance. Zero customer impact, automatic failover to regular VMs if Spot unavailable, and we can implement in 2-3 weeks."
Continue your learning journey