Skip to content
CAMPUX Cloud Bootcamp
Field notes · Compute
Azure Spot VMs

Are Azure Spot VMs worth it? Only if your workload can survive a 30-second eviction

By Captain O6 min read

A Spot VM can cost a fraction of the standard price for the exact same hardware — but Azure can take it back with 30 seconds notice, mid-job, whenever it wants the capacity. Whether that trade is worth it comes down to one question about your workload.

New to cloud? CAMPUX is a free, build-first course. Start here →

Here is the short answer: Azure Spot VMs are worth it when your workload can be interrupted and picked back up, and a bad idea when it can't. Microsoft is blunt about the mechanism — Spot VMs run on Azure's unused capacity at a significant discount, and "at any point in time when Azure needs the capacity back, the Azure infrastructure will evict Azure Spot Virtual Machines" with 30 seconds notice. There is no SLA and no high-availability guarantee. You are renting the seats nobody bought, and the moment a paying customer wants them, you are asked to leave.

So the discount is not free money — it is a payment for accepting interruption. If losing a machine mid-task means a re-run of a batch job, take the discount. If losing a machine mid-task means a dropped customer order or a corrupted database, do not go anywhere near Spot. Everything below is just working out which side of that line your workload sits on.

What a Spot VM actually is

A Spot VM is an ordinary Azure virtual machine placed on spare capacity in a datacenter. Same sizes, same images, same disks, same networking. Microsoft confirms an already-running Spot VM behaves like a standard VM in every way except that it has no SLA and can be evicted at any time. The reason it is cheap is the reason it is fragile: you only get to use the hardware while nobody with a full-price reservation needs it. Pricing is variable by region and SKU, and the portal will show you the historical eviction rate, where a figure like "10%" means roughly a one-in-ten chance the machine gets pulled within the next hour. You can pick a cheaper, quieter region right from the create screen.

You are renting the seats nobody bought. The discount is the airline paying you to give up your seat the instant a full-fare passenger shows up.

Spot VMs are surplus capacity at up to ~90% off, but Azure can evict them on 30 seconds notice.on-demandfull pricespotup to ~90% offeviction30-second noticereclaimed anytimecheap surplus capacity — for batch, CI, and stateless or checkpointed work
Figure — Spot VMs sell Azure's spare capacity at a steep discount — often up to ~90% off pay-as-you-go — with one catch: Azure can reclaim them whenever it needs the capacity back, giving just a 30-second eviction notice. So they are ideal for interruptible, restartable work — batch jobs, CI runners, rendering, dev boxes, or anything that checkpoints — and wrong for stateful, always-on services. Set a max price and an eviction policy, and design the job to resume where it left off.

The catch: eviction, no SLA, and the price cap

Two things can get a Spot VM evicted. Azure needs the capacity back for pay-as-you-go workloads, or the live Spot price rises above the maximum price you set. On the max price: you name the most you will pay per hour, in dollars to five decimals. Set it to -1 and the VM is never evicted for price — you simply pay the current Spot rate, capped at the standard price, so you can never be charged more than a normal VM. That removes price evictions but not capacity evictions; nothing removes those. When eviction comes, you can opt in to a best-effort heads-up through Azure Scheduled Events, delivered up to 30 seconds before the machine goes. Thirty seconds is enough to flush a checkpoint or drain a queue. It is not enough to gracefully shut down a database.

Which workloads fit, and which never do

Spot rewards work that is interruptible and can resume from where it stopped. Microsoft points at batch processing, dev/test environments, and large compute jobs. In practice the good fits are:

The list of what must never run on Spot is shorter and firmer: production databases, anything holding state on the local disk, your customer-facing web tier, message brokers, domain controllers, any always-on service where a 30-second eviction is an outage. If the answer to "what happens when this machine vanishes right now?" is anything worse than "it comes back and retries," keep it on standard VMs. Microsoft's own guidance is the same: if you need capacity right away, use standard VMs, not Spot.

Deallocate vs Delete: choose before you get evicted

When you create the Spot VM you pick an eviction policy, and it decides what happens to the machine when Azure reclaims it. Deallocate (the default) stops the VM and moves it to the stopped-deallocated state so you can try to start it again later, but the deallocated VM still counts against your quota and you keep paying storage for its disks. Delete removes the VM and its underlying disks entirely, so you stop paying for storage but keep nothing. The rule of thumb: use Deallocate when the machine holds a configured environment you want back, and Delete for disposable, cattle-not-pets workers where a scale set will just spin up a replacement. Which brings up the natural home for Spot, a scale set that treats every node as replaceable and keeps refilling the pool as instances come and go.

Before you flip the Spot switch

Test the failure, not just the happy path. Azure lets you simulate an eviction with a single API call, so you can prove your job actually checkpoints and resumes before you trust real money to it. Two more facts that bite people: the Spot flag can only be set at creation — you cannot convert a running standard VM to Spot or back — and B-series sizes are not supported. Decide up front, and pair a -1 max price with a Delete policy on stateless workers for the cleanest, cheapest setup.

The honest verdict

Spot VMs are one of the largest discounts in the cloud, and they are worth it exactly when your workload treats a lost machine as a retry instead of a disaster. For batch, CI, dev/test, and stateless compute that checkpoints its progress, running on Spot can cut the compute line of your bill hard, and it belongs in the same toolbox as the other moves in cutting your Azure bill. For anything stateful or always-on, the discount is a trap: you will save pennies until the eviction that costs you an outage. Match the tool to the workload and Spot is close to free money. Mismatch it and it is the most expensive cheap VM you will ever run.

The takeaway

Ask one question before you choose Spot: "if this machine disappears in 30 seconds with no warning, is that a retry or an incident?" If it is a retry (batch, CI runners, dev boxes, stateless workers, checkpointable jobs) take the discount, set a -1 max price, and pick Deallocate or Delete to match how disposable the box is. If it is an incident (databases, prod web, anything stateful) stay on standard VMs. Price the interruption honestly and Spot is one of the best deals in the cloud; misjudge it and you learn the cost the hard way, in the middle of the one job that could not afford to restart.

Questions people also ask

Can an Azure Spot VM be evicted?

Yes, and you should design for it. Azure reclaims a Spot VM whenever it needs the capacity back for pay-as-you-go workloads, or when the live Spot price rises above your max price. You get a minimum of 30 seconds notice through Scheduled Events. Setting a max price of -1 stops price evictions, but nothing stops capacity evictions.

Are Azure Spot VMs worth it?

They are worth it when your workload treats a lost machine as a retry instead of an incident. For batch jobs, CI runners, dev/test boxes, and stateless compute that checkpoints its progress, the discount cuts your compute bill hard. For databases, stateful services, or anything customer-facing, the savings are a trap that pays off until the eviction that causes an outage.

What is the difference between a Spot VM and a Reserved Instance?

A Reserved Instance is a one or three year commitment on standard capacity with a guaranteed SLA and no eviction risk, so you use it for predictable, always-on workloads. A Spot VM rents spare capacity at a deeper discount with no SLA and eviction on 30 seconds notice. You pick Reserved for stability, Spot for interruptible work.

How much do Azure Spot VMs save?

The discount is variable by region and SKU, and it moves with supply and demand. Most Spot VMs land between 75% and 90% off the standard rate, though during high demand for spare capacity the saving can drop to 30% or 40%. The portal shows you the current price and historical eviction rate before you commit.

Which workloads should never run on Spot VMs?

Anything where a 30-second eviction is an outage. That means production databases, message brokers, domain controllers, your customer-facing web tier, and anything holding unique state on the local disk. If you need capacity right now with a guarantee it stays, use standard or reserved VMs. Note that B-series burstable sizes are not supported on Spot at all.

Further reading — the Microsoft docs
Your next class · free
You've read the idea. Class 11 — Virtual machines is where you build it, hands-on — no account needed.Start Class 11 →
Captain O
Founder & instructor · CAMPUX Cloud Engineering Bootcamp
Drilled in Class 11d — Virtual Machines. Back to all field notes →