| name | spot-vms |
| description | Spot VMs and Spot VMSS — eviction policy, max price, workload fit |
Spot Vms
When to use this skill
- Batch/CI/render/ML training
- Stateless workers in VMSS
Key concepts
- Spot price varies; eviction occurs when capacity is needed or price exceeds your max.
- Eviction policy: Deallocate (preserves disks, can be restarted) vs Delete (cleaner for ephemeral).
- Eviction type:
Capacity only (cheaper, fewer evictions) vs Price or Capacity.
- Use
--max-price -1 to pay up to PAYG (only evicted for capacity).
- Spot VMSS supports a fall-back policy via mixed PAYG instances.
Azure CLI examples
az vm create -g <rg> -n <name> --image Ubuntu2204 \
--priority Spot --eviction-policy Deallocate \
--max-price -1 --size Standard_D4s_v5
Common pitfalls
- Running stateful single-instance workloads on Spot — eviction = downtime.
- Not handling Scheduled Events / IMDS eviction signal for graceful shutdown.
- Forgetting that Premium OS disks survive eviction with Deallocate policy — Delete avoids the cost.
References
Validation-first: verify every Azure fact against the Microsoft Learn MCP server (cite the Learn URL); Learn overrides built-in knowledge. If no Learn MCP server is configured, flag the answer ⚠️ unverified and mark specs as indicative. Analysis only — verify against Microsoft documentation before applying.