Spot VM is a special VM type that uses Azure's surplus capacity at up to 90% discount. It comes with a 30-second-notice Eviction (stop) risk, so it isn't suitable for stateful workloads, but with the right design it can dramatically cut costs for batch processing, AKS Spot Node Pools, and Dev/Test environments. This article covers Eviction Policy, Max Price, Placement Score, AKS integration, and cost impact in a single guide.
| Policy | Behavior | Use Case |
|---|---|---|
| Deallocate | Stop only; retains Disk and Network settings; can be restarted later | Web tier scale-out, restart and continue |
| Delete | VM itself is deleted; fully zero stopped-cost; cannot restart | Batch processing, AKS Spot Node Pool |
Decision rule: choose Delete for batch processing where 'if interrupted, restart from scratch on another VM' works, and Deallocate for Web tier scale-out where you want to 'restart and continue.' Delete is the standard for AKS Spot Node Pool.
| Setting | Behavior | Recommendation |
|---|---|---|
| -1 (Capacity Only) | Ignore Spot Price; evict only on capacity shortage | ★ Microsoft recommended |
| Pay-as-you-go Price | Cap at the same price as a regular VM | Evict only on price spikes |
| Specific price (e.g. 0.05 USD/h) | Low cap leads to frequent Evictions | Not recommended |
-1 (Capacity Only) is the standard. No risk of cost blow-up (Spot Price never exceeds Pay-as-you-go) + minimum Eviction frequency. Avoid setting Max Price too low, since frequent Evictions destroy practical usability.
GA in 2023, an API/Portal feature that lets you check Spot availability by Region/VM Size before creating a Spot VM.
The standard pattern for using Spot VMs as AKS Nodes.
kubernetes.azure.com/scalesetpriority=spot:NoSchedule by DefaultIdeal for batch workloads, CI/CD pipelines, and development Pods. The standard for production Web is a hybrid: regular Node Pool plus Spot to absorb burst load.
VMSS Flexible mode's Spot Priority Mix lets you mix Spot VMs and regular (Regular) VMs within a single VMSS.
When a Spot VM is evicted, it is automatically replenished with a regular VM.
Assuming Japan East Region, Standard_D4s_v5 (4 vCPU/16 GB RAM, Pay-as-you-go monthly cost of about JPY 40,000):
| Time Window | Spot Monthly Cost | Discount | Eviction Risk |
|---|---|---|---|
| Surplus hours | About JPY 4,000 | 90% | Low |
| Normal hours | About JPY 10,000 | 75% | Medium |
| High-demand hours | About JPY 20,000 | 50% | High |
Savings are dramatic, but you must factor in processing interruption and re-execution costs from Eviction. Evaluate with 'Total Cost (Spot cost + re-execution cost from Eviction)'.
Implementing Graceful Shutdown to properly complete processing after receiving the Eviction notice (30 seconds in advance).
# Eviction 通知 Polling (Linux)
while true; do
EVICTION_NOTICE=$(curl -s -H Metadata:true \
"http://169.254.169.254/metadata/scheduledevents?api-version=2020-07-01")
if echo "$EVICTION_NOTICE" | grep -q "Preempt"; then
echo "Eviction detected, gracefully shutting down..."
# ジョブ完了処理・State 保存・Pod Drain など
break
fi
sleep 5
doneIn AKS, kubelet automatically detects Eviction and gracefully shuts down Pods, so applications only need standard SIGTERM handling.
What is Spot VM?
Spot VM is a special VM type that uses Azure's surplus capacity at up to 90% discount. It can be stopped (Eviction) with only 30 seconds notice when Microsoft needs the capacity back for other customers, making it unsuitable for stateful workloads and mission-critical production. Typical use cases: 1) Batch processing (genomics analysis, video rendering, ML training), 2) Dev/Test environments, 3) Temporary scale-out of stateless Web tiers, 4) Cost optimization via AKS Spot Node Pool, 5) Azure Batch worker nodes, 6) HPC jobs. Manage risk and cost via Eviction Policy (Deallocate/Delete) and Max Price. The savings are dramatic (you can achieve 1/10 of Pay-as-you-go pricing), and with the right design Spot VMs can be used even in production.
How do you choose an Eviction Policy?
There are 2 Eviction Policies: Deallocate (stop only, retains Disk and Network settings, can be restarted later, recommended default): on Eviction the VM moves to Deallocated state with Public IP/Disk/NIC settings preserved, and can be restarted later when capacity frees up. Compute cost while stopped is zero, but Disk and Public IP continue to incur charges. Delete (full deletion, minimum cost, cannot restart): on Eviction the VM itself is deleted; Disk/NIC/Public IP may remain or be deleted depending on settings; choose when you want completely zero stopped-cost. Decision rule: choose Delete for batch processing where 'if interrupted, restart from scratch on another VM' is fine; choose Deallocate for Web tier scale-out where 'restart and continue' is preferred. Delete is the standard for AKS Spot Node Pool (Kubernetes manages Pod state, so the VM itself isn't needed). In production, picking the right policy for the use case is critical.
What is the strategy for Max Price settings?
Spot VM's Max Price lets you specify the highest price you're willing to pay. Behavior: 1) Eviction triggers when the Spot Price (the current market price, fluctuating with Azure surplus capacity) exceeds Max Price, 2) the VM keeps running while below Max Price. Options: 1) -1 (Capacity Only, ignores Spot Price, evicts only on capacity shortage, most stable), 2) Pay-as-you-go Price (e.g. 0.10 USD/h, cap at the same price as a regular VM, evict only on price spikes), 3) A specific price (e.g. 0.05 USD/h, evicts based on price). Microsoft recommends -1 (Capacity Only): no risk of cost blow-up (Spot Price never exceeds Pay-as-you-go) and minimum Eviction frequency. -1 is the production standard; avoid setting Max Price too low, as frequent Evictions ruin practical usability.
What is Spot Placement Score?
Spot Placement Score (GA in 2023) is an API/Portal feature that lets you check Spot availability by Region/VM Size before creating a Spot VM. Score uses a 1-10 scale, where 10 means the highest Spot availability (less likely to be evicted) and 1 means low availability (high Eviction risk or possible creation failure). Typical use patterns: 1) Check the Score before running batch jobs and pick high-Score Regions, 2) Region selection for AKS Spot Node Pool, 3) Track Score trends in cost optimization reports, 4) Auto-switch to a different VM Size/Region when Score drops (automated with Logic App/Functions). Enables dynamic multi-region decisions like 'Japan East Score 3 → Japan West Score 8, so deploy to Japan West'. Microsoft provides the Score via machine learning predictions, making it a key decision-support feature for production Spot operations.
What are the constraints of Spot VM?
Key constraints: 1) VM size limits (only some SKUs support Spot; B-series, H-series Burstable, etc. are not supported), 2) Region limits (Spot is not offered in some Regions), 3) Reserved Instance/Savings Plan cannot be applied (already heavily discounted), 4) No VM Snapshot (when Eviction Policy is Delete), 5) No standalone SLA for Spot (no availability guarantee since it's surplus capacity from Microsoft), 6) Eviction notice is 30 seconds (need Graceful Shutdown in a short window), 7) Separate Quota (regular vCPU Quota and Spot vCPU Quota are managed separately and need a request), 8) Limited Spot support for Confidential VM, 9) Spot VM backup via Azure Backup is not recommended, 10) Cannot be used together with the Auto-shutdown feature. In production, the key to success is designing your architecture around these constraints and focusing on Stateless + Idempotent workloads.
How do you configure an AKS Spot Node Pool?
AKS Spot Node Pool is the standard pattern for using Spot VMs as Nodes. Configuration steps: 1) Add an AKS Node Pool → set Mode: User and Priority: Spot, 2) Choose Eviction Policy: Delete (AKS recommended), 3) Set Max Price: -1 (Capacity Only), 4) Set Min/Max Node count (integrate with Cluster Autoscaler), 5) Apply the Taint kubernetes.azure.com/scalesetpriority=spot:NoSchedule by Default, 6) Only Pods that allow the same key in their Tolerations will be scheduled on Spot Nodes. AKS automatically detects Eviction → relocates Pods to another Spot Node, or fails over to a regular Node Pool. Ideal for batch workloads, CI/CD pipelines, and development Pods. The standard for production Web is a hybrid: regular Node Pool plus Spot to absorb burst load.
How much cost reduction can you expect?
Spot VM discount rates vary by VM size, Region, and demand. Example (Japan East, Standard_D4s_v5, 4 vCPU/16 GB RAM, assumed Pay-as-you-go monthly cost of about JPY 40,000): 1) Surplus hours: about JPY 4,000 (90% off), 2) Normal hours: about JPY 10,000 (75% off), 3) High-demand hours: about JPY 20,000 (50% off), with possibly frequent Evictions. GPU series (NCsv3, NDv4) discounts are even larger; ML training that costs JPY 2M/month on Pay-as-you-go can drop to JPY 400K/month on Spot (80% reduction). Savings are dramatic, but you must factor in the cost of processing interruption and re-execution due to Eviction. In production, evaluate using 'Total Cost (Spot cost + re-execution cost from Eviction)'. With proper design, you can achieve 1/5 to 1/10 of Pay-as-you-go cost.
What related certifications cover this topic?
AZ-104 (Administrator) Domain 3 (Compute 20-25%) covers Spot VM fundamentals; AZ-305 (Solutions Architect Expert) covers cost optimization design from an architect's perspective; AZ-204 (Developer Associate) covers Spot usage from a developer's perspective (batch processing); AZ-400 (DevOps Engineer Expert) covers Spot usage in CI/CD pipelines; AKS Node Pool configuration is tested in depth. Outside Microsoft: CKA (Kubernetes Administrator) covers Pod scheduling on Spot Node Pools. This is a critical Azure cost optimization skill and is essential for FinOps engineers and SREs.
Related Articles & Deep Dives
AKS Node Pool 戦略|System/User/Spot/GPU/Windows の使い分けとコスト最適化【2026 年版】
Azure Kubernetes Service (AKS) の Node Pool 設計戦略を完全解説。System / User / Spot / GPU / Windows Node Pool の使い分け、Cluster Autoscaler vs Node Auto Provisioning (NAP/Karpenter)、Pod の Affinity / Tolerations、コスト最適化、関連認定試験 (AZ-104 / AZ-400 / CKA) を日本語で網羅。
Azure Kubernetes Service (AKS) 入門ガイド|アーキテクチャ・Networking・Ingress・セキュリティ完全解説【2026 年版】
Azure Kubernetes Service (AKS) の入門ガイド。Control Plane と Node Pool の構造、Azure CNI Overlay vs Kubenet の選定、Application Gateway / NGINX Ingress 選定、Workload Identity (新方式)、Private Cluster・Microsoft Defender for Containers・Azure Policy のセキュリティ、関連認定試験 (AZ-104 / AZ-204 / AZ-400 / CKA) を日本語で網羅。
Azure DevOps エンジニア キャリアロードマップ|AZ-104 → AZ-400 → SC-100 シニア DevOps への道【2026 年版】
Azure DevOps Engineer になるための認定取得ロードマップ完全版。AZ-900 → AZ-104 → AZ-400 の王道ルート、GitHub と Azure DevOps の両方を扱う AZ-400 の構成、Kubernetes 認定 (CKA / CKAD / CKS) との二刀流、IaC (Bicep / Terraform) 戦略、年収レンジまで日本語で網羅。
Azure VMSS 完全ガイド|Uniform/Flexible・Auto Scale・Rolling Upgrade・Spot 混在【2026 年版】
Azure Virtual Machine Scale Sets (VMSS) の完全ガイド。Uniform vs Flexible Orchestration mode の使い分け、Auto Scale (Metric/Schedule/Custom)、Custom Image と Azure Compute Gallery、Rolling Upgrade Policy、Spot + Regular 混在パターン、関連認定試験 (AZ-104 / AZ-305 / AZ-400) を日本語で網羅。
The technical content of this article is based on the Azure Spot Virtual Machines Documentation. This article is not an official Microsoft Corporation product and has no affiliation or sponsorship with them. Microsoft and Azure are trademarks of the Microsoft group of companies. Information is based on official public materials as of May 24, 2026. Always check the official pages for the latest information.
Practice with certification-focused question sets
View Azure exam prep pageNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
AZ-900 Azure Fundamentals: Complete Exam Guide (2026)
Pass AZ-900 — cloud concepts, Azure architecture, management...
Azure Certification Roadmap: Which Cert to Take Next (2026)
Choose your Azure certification path — Fundamentals, Associa...
AI-901 Azure AI Fundamentals (Beta): Complete Guide (2026)
Pass AI-901 — Microsoft Foundry, generative AI, responsible ...
Microsoft Entra ID Fundamentals for Azure Certs (2026)
Entra ID basics every cert candidate needs — tenants, identi...
DP-900 Azure Data Fundamentals: Complete Guide (2026)
Pass DP-900 — relational, non-relational, analytics, Power B...