Troubleshoot deployment issues when creating a new Windows VM in Azure
When you try to create a new Azure Virtual Machine (VM), the common errors you encounter are provisioning failures or allocation failures.
- A provisioning failure happens when the OS image fails to load either due to incorrect preparatory steps or because of selecting the wrong settings during the image capture from the portal.
- An allocation failure results when the cluster or region either does not have resources available or cannot support the requested VM size.
If your Azure issue is not addressed in this article, visit the Azure forums on MSDN and Stack Overflow. You can post your issue in these forums, or post to @AzureSupport on Twitter. You also can submit an Azure support request. To submit a support request, on the Azure support page, select Get support.
The following top issues may help resolve your issue. To start troubleshooting, review these steps:
For other VM deployment issues and questions, see Troubleshoot deploying Windows virtual machine issues in Azure.
Collect activity logs
To start troubleshooting, collect the activity logs to identify the error associated with the issue. The following links contain detailed information on the process to follow.
Issue: Custom image; provisioning errors
Provisioning errors arise if you upload or capture a generalized VM image as a specialized VM image or vice versa. The former will cause a provisioning timeout error and the latter will cause a provisioning failure. To deploy your custom image without errors, you must ensure that the type of the image does not change during the capture process.
The following table lists the possible combinations of generalized and specialized images, the error type you will encounter and what you need to do to fix the errors.
The following table lists the possible upload and capture combinations of Windows generalized (gen.) and specialized (spec.) OS images. The combinations that will process without any errors are indicated by a Y, and those that will throw errors are indicated by an N. The causes and resolutions for the different errors you will run into are given below the table.
|OS||Upload spec.||Upload gen.||Capture spec.||Capture gen.|
Y: If the OS is Windows generalized, and it is uploaded and/or captured with the generalized setting, then there won’t be any errors. Similarly, if the OS is Windows specialized, and it is uploaded and/or captured with the specialized setting, then there won’t be any errors.
N1: If the OS is Windows generalized, and it is uploaded as specialized, you will get a provisioning timeout error with the VM stuck at the OOBE screen.
N2: If the OS is Windows specialized, and it is uploaded as generalized, you will get a provisioning failure error with the VM stuck at the OOBE screen because the new VM is running with the original computer name, username and password.
To resolve both these errors, use Add-AzureRmVhd to upload the original VHD, available on-premises, with the same setting as that for the OS (generalized/specialized). To upload as generalized, remember to run sysprep first.
N3: If the OS is Windows generalized, and it is captured as specialized, you will get a provisioning timeout error because the original VM is not usable as it is marked as generalized.
N4: If the OS is Windows specialized, and it is captured as generalized, you will get a provisioning failure error because the new VM is running with the original computer name, username, and password. Also, the original VM is not usable because it is marked as specialized.
To resolve both these errors, delete the current image from the portal, and recapture it from the current VHDs with the same setting as that for the OS (generalized/specialized).
Issue: Custom/gallery/marketplace image; allocation failure
This error arises in situations when the new VM request is pinned to a cluster that either cannot support the VM size being requested, or does not have available free space to accommodate the request.
Cause 1: The cluster cannot support the requested VM size.
- Retry the request using a smaller VM size.
- If the size of the requested VM cannot be changed:
- Stop all the VMs in the availability set. Click Resource groups > your resource group > Resources > your availability set > Virtual Machines > your virtual machine > Stop.
- After all the VMs stop, create the new VM in the desired size.
- Start the new VM first, and then select each of the stopped VMs and click Start.
Cause 2: The cluster does not have free resources.
- Retry the request at a later time.
- If the new VM can be part of a different availability set
- Create a new VM in a different availability set (in the same region).
- Add the new VM to the same virtual network.
If you encounter issues when you start a stopped Windows VM or resize an existing Windows VM in Azure, see Troubleshoot Resource Manager deployment issues with restarting or resizing an existing Windows Virtual Machine in Azure.