question

LarryBilodeau-9315 avatar image
0 Votes"
LarryBilodeau-9315 asked JonEllison-0900 answered

Getting error on start/stop of VM created from an image

I created a image of my VM using the "capture" wizard. and also created a disk image of the attached disk. I then created a VM from the image and a "copy" of the disk image. Now every time I start or stop the VM i get the following warning:

"Failed to start virtual machine 'nonce-from-image'. Error: OS Provisioning for VM 'nonce-from-image' did not finish in the allotted time. However, the VM guest agent was detected running. This suggests the guest OS has not been properly prepared to be used as a VM image (with CreateOption=FromImage). To resolve this issue, either use the VHD as is with CreateOption=Attach or prepare it properly for use as an image:
Instructions for Windows: https://azure.microsoft.com/documentation/articles/virtual-machines-windows-upload-image/
Instructions for Linux: https://azure.microsoft.com/documentation/articles/virtual-machines-linux-capture-image/ "

The machine starts and seems fully functional. I don't have a VHD so the referenced docs don't look to me that they apply. What is it I need do to resolve this error message?



azure-virtual-machines
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@LarryBilodeau-9315 Any update on the issue?

If the suggested response helped you resolve your issue, do click on "Accept as Answer" and "Up-Vote" for the answer that helped you for benefit of the community.

Thanks.


0 Votes 0 ·
prmanhas-MSFT avatar image
1 Vote"
prmanhas-MSFT answered

@LarryBilodeau-9315 Apologies for the delay in response and all the inconvenience caused because of the issue.

I first did repro on my side as per mentioned by you in the verbatim of the query and I was able to go through it without any problem following this.

I did some research on the mentioned issue and found some articles and issues which talk about the same error and most of it is around generalizing the VM. This is an important step as outlined in the mentioned article in my answer as well.

One such issue on MSDN is here which states that :

Seems that the image is not generalized properly and that is the reason you are getting failed error.

Another issue on same line is here:

To add to this, it means that the image was not generalized and is probably still a specialized disk. deleting and recreating it with createoption = attach will resolve this issue.

Here are instructions for doing this with a Windows VM, just make sure you specify the OS type as Linux if it is not associated with the image already.

One more issue I found on Stack which talks about sysrep not being as the reason behind this issue

If you are using the image that is not sysprepped to create VM, it could cause the error, so please make sure your image is sysprepped.

When you specify CreateOption to Attach ( it will create a virtual machine from a specialized disk), do not specify the SourceImageUri parameter. For more information, please check “-CreateOption” from this documentation.

Now the above suggestion is made purely based upon assumption that maybe the VM is not generalised which is in most of the cases of reported issue and hence throwing the warning. You can check the same in your environment and let me know if that is the case. If not do let me know so we can dig into it further.

Hope it helps!!!

Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JonEllison-0900 avatar image
0 Votes"
JonEllison-0900 answered

I have the same issue. I created a base Azure VM using Windows2019 marketplace image. I made a few custom changes. Followed Microsoft's directions on deleting C:\windows\Panther and then running sysprep.exe checking the Generalize box. After sysprep runs, the vm shuts down. I then go to the VM in the portal and click Capture. Filled in all the required fields and successfully created the image. From the Image resource I click create VM, and get this error. Please provide a GUI explanation and guidance on how to remedy this error.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.