Managed disk stuck in Attaching state
az vm show disk state shows Attaching for more than 5 minutes
Focused incident mode — strips away everything but this runbook.
Symptoms
- az vm show disk state shows Attaching for more than 5 minutes
- VM cannot be stopped or deallocated because of the stuck disk
- az disk show ProvisioningState stuck at Updating
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Disk provisioning state
az disk show --ids <DISK-ID> --query "{state:provisioningState}" -o jsonVM disk listing
az vm show -g <RG> -n <VM-NAME> --query storageProfile.dataDisks -o json
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
- Multiple disks attached in parallel via template or script
- Disk provisioningState stuck at Updating for 10+ minutes
Confirm before fixing
az disk show --ids <DISK-ID> --query provisioningState -o tsvConfirm the stuck state
Fix
az disk update --ids <DISK-ID> --set provisioningState=AvailableAttempt to reset the provisioning state (platform-side fix may be needed)
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 disk show --ids <DISK-ID> --query "{state:provisioningState,sku:sku.name}" -o tableConfirm disk state
az vm get-instance-view -g <RG> -n <VM-NAME> --query provisioningState -o tsvCheck for pending platform operations
az vm restart -g <RG> -n <VM-NAME>Restart VM to complete disk attach
Prevention
- Attach disks sequentially, not in parallel, using Bicep or Terraform with depends_on.
- Validate disk and VM are in the same zone before attach.
- Use Premium SSD or Ultra Disk for critical workloads to reduce platform delays.
- Set up alerts on disk provisioningState != Succeeded.
Related runbooks
Same stack, same failure family — worth a skim.
az vm show returns ProvisioningState = Creating for over 15 minutes
az vm create returns An operation on target allocation failed
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.