Deployment gets Stuck when deploying VM from custom Image

Reinhard Sanz 1 Reputation point
2021-03-15T10:18:08.087+00:00

Hey, I recently uploaded a .vhd file to my azure storage account and created custom image from it. Image creation finished with no problems, but when i try to deploy a VM from it it seems to get stuck during deployment. Without throwing an error. The deployment state looks like this:
77784-image.png

The overview looks like this:
77728-image.png

I am unable to ping the public ip address, it seems it is just stuck in "Creating", i "extracted" the .vhd file from a .ova file could that be a problem?

Edit: After a while it throws following error message:
{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"OSProvisioningTimedOut","message":"OS Provisioning for VM 'imagetest' did not finish in the allotted time. The VM may still finish provisioning successfully. Please check provisioning state later. Also, make sure the image has been properly prepared (generalized).\r\n * Instructions for Windows: https://azure.microsoft.com/documentation/articles/virtual-machines-windows-upload-image/ \r\n * Instructions for Linux: https://azure.microsoft.com/documentation/articles/virtual-machines-linux-capture-image/ \r\n * If you are deploying more than 20 Virtual Machines concurrently, consider moving your custom image to shared image gallery. Please refer to https://aka.ms/movetosig for the same."}]}

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,328 questions
{count} votes

3 answers

Sort by: Most helpful
  1. EJegel 6 Reputation points
    2021-12-23T00:07:59.18+00:00

    I had the same/similar issue when creating a new VM from a custom image.
    I resolved my problem by removing the Azure VM Image and recreating with the flag "-HyperVGeneration V2" in the powershell New-AzImageConfig command.
    The VHD was taken from a Hyperv Gen 2 VM. It seems without specifying that tag the Azure VM Image defaults to Gen 1 and the system fails to boot.

    1 person found this answer helpful.
    0 comments No comments

  2. Reinhard Sanz 1 Reputation point
    2021-03-16T15:46:42.947+00:00

    @vipullag-MSFT
    I would have replied to your comment but it won't let me submit..
    Hey, yes i still have the same problem, even after several hours of waiting after the "timeout" nothing really happend the VM still gets displayed the same.

    I also tried creating a disk from the .vhd and deploying a VM from the disk (using it as the osDisk) there the deployment went through smoothly and quickly, but it seems it still gets stuck. The VM gets displayed like normal, but i am unable to connect to it using SSH, etc.
    A quick check of the state using the rest API shows everything succeded except the following: (Even after a few hours of waiting)
    "vmAgent": {
    "vmAgentVersion": "Unknown",
    "statuses": [
    {
    "code": "ProvisioningState/Unavailable",
    "level": "Warning",
    "displayStatus": "Not Ready",
    "message": "VM status blob is found but not yet populated.",
    "time": "2021-03-16T15:40:03+00:00"
    }
    ]
    },

    0 comments No comments

  3. Olga Os - MSFT 5,941 Reputation points Microsoft Employee
    2021-03-23T19:30:10.383+00:00

    What screenshot do you see in the boot diagnostic screen? It may help you to identify in what state your VM stuck during the booting.

    80778-image.png

    There's a variety of reasons for OSProvisioningTimedOut to happen:

    • Provisioning Agent (PA) issue - quickest way to diagnose is attach os disk as data disk and look at the PA logs (Windows = c:\windows\panther\wasetup.xml / Linux = /var/log/waagent.log)
    • Image not sysprep'ed / deprovisioned correctly - so VM either fails to boot or is stuck in the OOBE Windows setup screen, waiting for user input (VM screenshot will help you diagnose)
    • The VM Deployment includes a VM extension; sometimes extensions could take long time to be installed and/or enabled (executed), if they take longer than allocated time the deployment will be marked as failed, however the VM has been created and started successfully.

    Please also keep in mind, you must carefully follow up steps on preparing the VHD before uploading to the Azure.

    Kindly review these steps by following our official article "Prepare a Windows VHD or VHDX to upload to Azure"

    Hope above is helpful to start your investigation.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.