VMProvisioningStateFailed - VM Provisioning State Failed: VM Creation or Configuration Error
VM provisioning failed before completion—Azure couldn't create, start, or configure the VM, leaving it in "Failed" provisioningState. This is a server-side error caused by issues like quota exhaustion, image deployment failures, network misconfiguration, or extension installation problems. The VM remains in Failed state and blocks most operations until you delete and recreate it. Common causes include insufficient compute quota (regional or subscription-level vCPU limits), unavailable VM images in the region, network security group rules blocking required traffic, or custom script extensions failing due to script errors or permission issues. Similar provisioning failures can occur in AKS node provisioning, Azure SQL database provisioning, and App Service plan provisioning.
#Common Causes
- →Insufficient Compute Quota: You've hit regional or subscription-level quota limits. VM cores have regional quotas that vary by subscription tier. This is persistent—you must free quota or request an increase before retrying VM creation.
- →Image Deployment Failure: The VM image can't be deployed to the target storage account or location. The image may be unavailable in that region, or storage account connectivity issues prevent image deployment. This is persistent—you must use an available image or fix connectivity.
- →Network Configuration Error: Network resources (virtual network, subnet, network security group) are misconfigured or unavailable. Network security group rules may be blocking required traffic, or the subnet may not have available IP addresses. This is persistent—you must fix network configuration before retrying.
- →Extension Installation Failure: VM extensions can't install or execute. Custom script extensions may fail due to script errors, permission issues, or network connectivity problems preventing extension downloads. This is persistent—you must fix the extension issue before retrying.
✓Solutions
- 1Step 1: Diagnose - Check VM provisioning state: az vm show --resource-group <rg> --name <vm> --query "provisioningState" --output table
- 2Step 2: Diagnose - Check VM status and error details: az vm get-instance-view --resource-group <rg> --name <vm> --query "instanceView.statuses" --output table
- 3Step 3: Diagnose - Check compute quota usage: az vm list-usage --location <region> --query "[?name.value=='cores'].{Name:name.localizedValue,Current:currentValue,Limit:limit}" --output table
- 4Step 4: Diagnose - Verify image availability: az vm image show --urn <image-urn> --output table
- 5Step 5: Diagnose - Review VM extension logs: az vm extension list --resource-group <rg> --vm-name <vm> --query "[].{Name:name,ProvisioningState:provisioningState}" --output table
- 6Step 6: Fix - Free quota by deleting unused VMs or request a quota increase.
- 7Step 7: Fix - Use an available image or fix storage account connectivity.
- 8Step 8: Fix - Review network security group rules and subnet configuration. Ensure NSG rules aren't blocking required traffic.
- 9Step 9: Fix - Review extension logs and fix underlying issues (script errors, permissions, network).
- 10Step 10: Verify - Delete the failed VM and retry creation. The new VM should have provisioningState: "Succeeded".
</>Code Examples
1# This script helps diagnose VMProvisioningStateFailed errors
2
3# Step 1: Set VM details (replace with your actual values)
4RESOURCE_GROUP="my-resource-group"
5VM_NAME="my-vm"
6REGION="eastus"
7echo "Diagnosing VM: $VM_NAME in resource group: $RESOURCE_GROUP"
8
9# Step 2: Check VM provisioning state
10echo "Checking VM provisioning state..."
11PROVISIONING_STATE=$(az vm show \
12 --resource-group $RESOURCE_GROUP \
13 --name $VM_NAME \
14 --query "provisioningState" \
15 --output tsv 2>/dev/null)
16
17if [ ! -z "$PROVISIONING_STATE" ]; then
18 echo "Provisioning state: $PROVISIONING_STATE"
19 if [ "$PROVISIONING_STATE" == "Failed" ]; then
20 echo "WARNING: VM provisioning failed"
21 fi
22else
23 echo "VM not found or inaccessible"
24fi
25
26# Step 3: Check VM status and error details
27echo "Checking VM status and error details..."
28az vm get-instance-view \
29 --resource-group $RESOURCE_GROUP \
30 --name $VM_NAME \
31 --query "instanceView.statuses[?code=='ProvisioningState/']" \
32 --output table
33
34# Step 4: Check compute quota usage
35echo "Checking compute quota usage in region $REGION..."
36az vm list-usage \
37 --location $REGION \
38 --query "[?name.value=='cores'].{Name:name.localizedValue,Current:currentValue,Limit:limit}" \
39 --output table
40
41# Step 5: Check for quota exhaustion
42CURRENT=$(az vm list-usage --location $REGION --query "[?name.value=='cores'].currentValue" -o tsv)
43LIMIT=$(az vm list-usage --location $REGION --query "[?name.value=='cores'].limit" -o tsv)
44if [ ! -z "$CURRENT" ] && [ ! -z "$LIMIT" ]; then
45 if [ $CURRENT -ge $LIMIT ]; then
46 echo "WARNING: Quota limit reached or exceeded"
47 echo "Current: $CURRENT, Limit: $LIMIT"
48 fi
49fi
50
51# Step 6: Review VM extension status
52echo "Reviewing VM extension status..."
53az vm extension list \
54 --resource-group $RESOURCE_GROUP \
55 --vm-name $VM_NAME \
56 --query "[].{Name:name, ProvisioningState:provisioningState, Type:type}" \
57 --output table
58
59# Step 7: Check extension instance view for errors
60echo "Checking extension instance views for errors..."
61EXTENSIONS=$(az vm extension list --resource-group $RESOURCE_GROUP --vm-name $VM_NAME --query "[].name" -o tsv)
62for ext in $EXTENSIONS; do
63 echo "Extension: $ext"
64 az vm extension show \
65 --resource-group $RESOURCE_GROUP \
66 --vm-name $VM_NAME \
67 --name $ext \
68 --instance-view \
69 --query "{status:statuses[0].code, message:statuses[0].message}" \
70 --output table
71done
72
73# Step 8: Check network configuration
74echo "Checking network configuration..."
75NIC_ID=$(az vm show --resource-group $RESOURCE_GROUP --name $VM_NAME --query "networkProfile.networkInterfaces[0].id" -o tsv)
76if [ ! -z "$NIC_ID" ]; then
77 echo "Network interface: $NIC_ID"
78 az network nic show --ids $NIC_ID --query "{subnet:ipConfigurations[0].subnet.id, privateIp:ipConfigurations[0].privateIpAddress}" --output table
79fi
80
81# Step 9: Instructions for fixing failed VMs
82echo ""
83echo "To fix a failed VM:"
84echo " 1. Delete the failed VM: az vm delete --resource-group $RESOURCE_GROUP --name $VM_NAME --yes"
85echo " 2. Fix the underlying issue (quota, image, network, extension)"
86echo " 3. Retry VM creation with corrected configuration"↗Related Errors
Provider Information
This error code is specific to AZURE services. For more information, refer to the official AZURE documentation.