criticalFoundationSymptom-first#vm#allocation#capacity#sku#region

VM allocation failed — insufficient capacity in region or zone

az vm create returns An operation on target allocation failed

Likely source:availabilityscaling

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 tsv
  • Allocation 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>
READ

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 tsv
CHANGE

Retry 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.

1
az vm show -g <RG> -n <VM-NAME> -o table --query "[name,provisioningState,hardwareProfile.vmSize,location]"
READ

Confirm failure details

2
az vm list-sizes --location <LOCATION> --query "[].name" --output tsv | grep -i <SKU>
READ

Verify SKU exists in the region

3
az vm create -g <RG> -n <VM-NAME> --image <IMAGE> --size <ALT-SKU> -l <LOCATION> --zone <ALT-ZONE> --query provisioningState -o tsv
CHANGE

Retry 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.

Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.