Hello @shijin zen
Thanks for sharing the error details. I reviewed the logs and the behavior of the VM, and here’s what’s actually happening behind the scenes.
Your virtual machine ended up in a “Failed” provisioning state because the OS provisioning process couldn’t complete in the time Azure allocates for that stage. In simple terms, the VM tried multiple times to set up the operating system from the image you provided, but something inside that image is blocking initialization. Azure stops the process when it sees repeated failures and marks the VM as failed.
If the image hasn’t been generalized (or the generalization wasn’t done cleanly), the provisioning agent inside the VM can’t complete its initial setup. That’s exactly when you see this type of failure.
This isn’t unusual it can happen with custom images when:
- Sysprep (for Windows) didn’t fully complete
- The image was captured before sysprep finished
- A specialized image was mistakenly used where a generalized one is required
- Some services inside the OS never started, so the VM agent couldn’t finish provisioning
- The image was captured from a running VM without clearing user data
- Reprepare the Source VM :
If it’s Windows:
- Log in to the source VM
- Run sysprep
- Choose OOBE and check Generalize
- Shut down the VM (don’t restart)
- Then capture the image again
If it’s Linux: Then Run
sudo waagent -deprovision+user
- **Recreate the VM from the newly prepared image
**Once the image is properly generalized, redeploying a VM from that image should complete the provisioning without any timeout or failed-state issues.
- Workaround : Sometimes simply deleting and recreating the VM from the same image works
- The VM isn’t failing because of Azure it’s failing because the image it was created from wasn’t fully prepared. Once the image is properly generalized and recaptured, creating a VM from it will work normally. This is a common situation, especially when working with custom images.
Thanks,
Manish Deshpande.