Azure lets you buy spare capacity at a lower price—up to 90% less than the pay-as-you-go market price. However, once Azure needs this spare capacity back, your spot instances (which Azure calls spot VMs) will be terminated, with an advance warning of only 30 seconds. This can make it challenging to use this Azure pricing model for mission critical and production workloads.
Because of their unreliable nature, spot instances are typically used for stateless applications, batch processing, or development and testing scenarios, where it is acceptable to have an application instance fail. It is possible to use spot instances on Azure for stateful and mission critical applications, but this requires careful management, and the use of automated cloud optimization tools.
In this article, you will learn:
Spot instances are a very compelling pricing option on Azure, but before using it, you need to consider its pros and cons.
Azure spot instances pros
The obvious pro of spot instances is their low price, which may be discounted at up to 90% of pay-as-you-go rates. Other advantages include:
Azure spot instances cons
Learn more in our detailed guide to Azure spot instances
Azure has separate pricing for individual spot VMs and spot VMs used as part of Virtual Machine Scale Sets (VMSS).
Azure offers a wide range of VM types and sizes, with support for multiple operating systems, databases, and hardware configurations. Current generation VMs offer auto-scaling and load balancing at no additional cost.
Spot instances let you purchase unused VM capacity at up to 90% less than the pay-as-you-go price. Actual discount rates vary depending on regions, VM type, and other factors.
Examples of Virtual Machines Spot Pricing
The following examples show the comparative price of pay-as-you-go and spot VMs, for Linux VMs, in the West US region. Azure prices are subject to change—for the latest costs see the official pricing page.
VM Type | Description | Pay-as- You-Go Price | Spot Price | Spot Discount |
Av2 A1 | Cost-effective VM for light workloads | $0.036/hour | Starting from $0.005/hour | Up to 86% |
Fsv2 F2s | Compute-optimized VM with Xeon Platinum 8168 CPU | $0.0846/hour | Starting from $0.0102/hour | Up to 88% |
Dv3 D2 | General-purpose VM with Xeon processor | $0.096/hour | Starting from $0.0125/hour | Up to 87% |
Ev3 E2 | VM with Xeon processor and a larger amount of system memory | $0.126/hour | Starting from $0.016/hour | Up to 88% |
Virtual Machine Scale Sets (VMSS) can help you build scalable applications. This service lets you deploy and manage several VMs as a single group.
VM Scale Sets are deployed by Azure Resource Manager (ARM), Azure’s infrastructure as code (IaC) framework. VMSS comes with Azure load balancing and auto scaling capabilities built in. Currently, you can run VMSS with VMs with plain Linux or Windows, or custom machine images.
There are two modes of operations when using VM scale sets:
VMSS are available on all Azure Linux or Windows VM sizes. You are billed for deployed Azure VMs and related resources your VMs use, such as networking and storage. There is no additional charge for the VMSS service itself. However, you should note that for some VM types, spot pricing for VMSS offers smaller discounts than regular VMs.
Examples of Virtual Machines Scale Sets Spot Pricing
The following examples show the comparative price of spot vs pay-as-you-go VMs within a VMSS. Prices shown are for Linux VMs in the West US region.
VM Type | Pay-as- You-Go Price | Spot Price | % Discount |
Av2 A1 | $0.036/hour | Starting from $0.0088/hour | Up to 76% |
Fsv2 F2s | $0.0846/hour | Starting from $0.0288/hour | Up to 66% |
Dv3 D2 | $0.096/hour | Starting from $0.0452/hour | Up to 53% |
Ev3 E2 | $0.126/hour | Starting from $0.0354/hour | Up to 72% |
Related content: Read our guide to Azure autoscaling
Azure spot VMs may be terminated according to current price or available capacity—in Azure, this process is called “eviction”. When you create an Azure Spot VM, you can select one of two eviction policies:
You can use Azure Scheduled Events to to set up in-VM notifications, and alert applications running on a VM when it is about to be evicted. You receive 30 seconds notice before the VM is evicted, and you can use this time to shut down applications and save results of operations performed on the VM.
You can use the Azure Portal to see information about VMs, including eviction rates by VM size and historical prices.
Select the View Price History to compare historical spot prices and eviction rates for different Regions and VM sizes. This can help you identify spot VMs that are more attractive for you, because they potentially have a lower price or a lower chance of eviction.
If you are looking to broaden your usage of Azure spot VMs for even mission-critical workloads, Spot by NetApp’s Elastigroup and Ocean products enable you to do so for non-containerized and AKS workloads respectively.
By leveraging proprietary, predictive algorithms that consider both current spot market activity and historical trends, Spot by NetApp will spin up new replacement spot instances in advance while gracefully draining at-risk ones. If spot instances are not available, the workload will be moved to pay-as-you-go instances. In those situations, Spot by NetApp will move workloads back to spot instances as soon as they become available.
Learn more about Spot by NetApp’s solutions for Azure cloud cost optimization
Complete access
for up to 20 instances