# Spot Instance

> A spare cloud server sold very cheap. The cloud can take it back at short notice.

**Field:** Infrastructure  
**Category:** Virtualization & Cloud  
**Also known as:** Spot Instances, Spot VM, Preemptible VM, Azure Spot Virtual Machine

## Think of it like

Think of it like a cheap seat at a show. You must give it up if someone who paid full price comes.

## Definition

A spot instance is a spare cloud server rented at a deep discount. Clouds sell their unused machines this way. When the cloud needs a machine back, it takes it after a short warning. Some clouds warn two minutes ahead, and some only seconds. So spot servers suit work that can stop and start again. Batch jobs, tests and video renders are good fits.

## Example

AWS says spot can cost up to 90% less, and it warns two minutes before taking a server back. Azure warns 30 seconds ahead. Lucy saves each video frame as it is done, so a lost server costs her one frame.

## Example code

```console
$ curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/spot/instance-action
{"action": "terminate", "time": "2026-11-18T08:22:00Z"}
```

On AWS, a spot server can ask if it is about to be taken back. This answer gives the time it will be shut down.

## Why it matters

It is the cheapest way to rent a lot of computing. Work that can be cut short gets done for a small part of the price.

## Common mistake

Running a database or a checkout page on spot servers. When the server is taken back, the work stops and data can be lost.

## Three principles

- **Spare machines.** Unused machines, sold cheap.
- **Can vanish.** Taken back after a short warning.
- **Built to stop.** Only for work that can restart.

## Related terms

- [Reserved Instance](https://learn.benibix.com/term/infrastructure/reserved-instance)
- [Savings Plan](https://learn.benibix.com/term/infrastructure/savings-plan)
- [Cloud Instance](https://learn.benibix.com/term/infrastructure/cloud-instance)
- [Autoscaling](https://learn.benibix.com/term/infrastructure/autoscaling)
- [FinOps](https://learn.benibix.com/term/infrastructure/finops)

## Told apart from

- [Spot Instance vs Reserved Instance](https://learn.benibix.com/compare/spot-instance-vs-reserved-instance): People think spot and reserved are two ways to get the same cheap server, and they are not. A reserved instance is a promise to pay for one or three years, and the server is yours the whole time. A spot instance needs no promise and costs even less. But the cloud can take it back after a short warning. Reserve what must stay up, and use spot for work that can stop.

## Taught in

- [Reserved and Spot Instances](https://learn.benibix.com/learn/infrastructure-virtualization/reserved-and-spot-instances): Cloud Computing, 11/11

![Four columns for four ways to pay for the same cloud server: on-demand, savings plan, reserved instance and spot. A price bar in each: on-demand is full height, savings plan and reserved are each up to 72% lower, and spot is up to 90% lower. Under each bar is what you promise and the catch: nothing and the top price; an amount each hour for one or three years; one server type for one or three years; nothing, but the server can be taken back.](https://learn.benibix.com/diagrams/inf-cloud-pricing.svg)

---

Source: https://learn.benibix.com/term/infrastructure/spot-instance
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
