VM allocation failed — insufficient capacity in region or zone
az vm create returns An operation on target allocation failed
Focused incident mode — strips away everything but this runbook.
Symptoms
- az vm create returns An operation on target allocation failed
- ProvisioningState stuck at Creating then transitions to Failed
- Portal shows Allocation failed when attempting to create or resize a VM
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
VM provisioning state
az vm show -g <RG> -n <VM-NAME> --query provisioningState -o tsvAllocation error detail
az vm show -g <RG> -n <VM-NAME> -o json --query error
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- Allocation failed error points to the specific SKU and zone
- az vm list-sizes shows the SKU in the region but allocation fails
Confirm before fixing
az vm list-sizes --location <LOCATION> --query "[].name" --output tsv | grep -i <SKU>Confirm SKU presence in the region
Fix
az vm create -g <RG> -n <VM-NAME> --image <IMAGE> --size Standard_D2s_v3 -l <LOCATION> --zone <ALT-ZONE> --query provisioningState -o tsvRetry in a different availability zone
Expected: Succeeded
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
az vm show -g <RG> -n <VM-NAME> -o table --query "[name,provisioningState,hardwareProfile.vmSize,location]"Confirm failure details
az vm list-sizes --location <LOCATION> --query "[].name" --output tsv | grep -i <SKU>Verify SKU exists in the region
az vm create -g <RG> -n <VM-NAME> --image <IMAGE> --size <ALT-SKU> -l <LOCATION> --zone <ALT-ZONE> --query provisioningState -o tsvRetry with a different SKU and/or zone
Prevention
- Pre-reserve capacity with Azure Reserved VM Instances for production workloads.
- Use multiple availability zones in deployment templates to spread allocation risk.
- Pin to a set of known-available SKUs and test allocation in CI before production.
- Set up Azure Advisor recommendations for quota and capacity alerts.
Related runbooks
Same stack, same failure family — worth a skim.
az vm show returns ProvisioningState = Creating for over 15 minutes
VM powerState shows stopped (deallocated) without manual action
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.