Microsoft plays 'Spot the Azure VM that can disappear any time'
Then mercilessly evict it: Out, darned Spot
Microsoft has teased Azure Spot Virtual Machines, discounted VMs that can be "evicted any time if Azure needs capacity".
The rationale behind Spot VMs is simple. From Microsoft's point of view, they mop up spare capacity that would otherwise earn nothing, and for the customer they offer compute resources at a substantial saving.
How much of a saving? Prices vary according to demand. We dived in today and went through the motions of buying a D2s v3 (2vCPUs, 8GB, Linux) in the UK South region. Prices are as follows:
- Pay as you go: $0.116 per hour
- 1 year reserved instance: $0.0735 per hour
- 3 years reserved instance: $0.0498 per hour
- Spot VM: $0.023 per hour
The highest price is more than five times greater than the lowest price, illustrating the fact that there is huge benefit in careful buying when it comes to cloud computing.
How does it work? When you create a VM, you can opt for a Spot instance. There are two eviction types. If you choose Capacity, then you may pay anything up to the top whack, but your VM will only shut down for capacity reasons. If you choose Price or Capacity, you set a maximum price, and your VM will also shut down if the price goes too high.
When you set the maximum price for a Spot VM, the Azure portal shows you the current price, which is also the minimum you can specify. There is a link to a table showing prices in nearby regions – from which in our case we learn that UK West has no spare capacity right now.
What is the use of a Spot VM? The announcement suggests batch jobs, workloads that can be interrupted, test and development, scale out VMs, and short-lived jobs. You can receive an alert 30 seconds before shutdown, and it would be possible to write a script that would create a replacement VM at full price.
Spot VMs will replace a previous Azure effort called Low Priority VMs, designed to be used in Azure Batch for large-scale workloads. Azure Batch Pools will support Spot VMs from early 2020.
AWS and Google Cloud Platform also offer a variety of discount schemes. Paying full price for cloud VMs? Perhaps you are doing it wrong. ®