Share via

OSProvisioningTimedOut when deploying multiple virtual machines using Compute Gallery Image

Mitchell, Daniel 35 Reputation points
2024-01-16T16:22:15.63+00:00

I am consistently getting OSProvisioningTimedOut errors when attempting to deploy 10+ virtual machines. My image is generalized and added to an azure compute gallery with 9 replicas. My understanding is I should be able to deploy 180 VMs concurrently with that image based on the number of replicas. But it seems to time out closer to 30.

azure.core.exceptions.HttpResponseError: (OSProvisioningTimedOut) OS Provisioning for VM 'VMNAME' 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).
 * 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/ 
 * 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.
Code: OSProvisioningTimedOut
Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


Answer accepted by question author

kobulloc-MSFT 26,861 Reputation points Microsoft Employee Moderator
2024-02-10T20:22:33.0133333+00:00

I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

Why am I receiving the following error? OS Provisioning for VM 'VMNAME' 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).

Solution from @Mitchell, Daniel :

The issue is caused by the way the image was generalized. Microsoft support recommended the following options when running Sysprep and this appears to have solved my problem. Engineering team has seen that it’s helping in these scenarios where the specialize pass takes a very long time and recommends to sysprep the image with the option /mode:vm.

 Sysprep /generalize /shutdown /oobe /mode:vm

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Mitchell, Daniel 35 Reputation points
    2024-02-09T17:20:54.3733333+00:00

    I worked with Microsoft support on this and we have a solution. The issue is caused by the way the image was generalized. Microsoft support recommended the following options when running Sysprep and this appears to have solved my problem.

    Engineering team has seen that it’s helping in these scenarios where the specialize pass takes a very long time and recommends to sysprep the image with the option /mode:vm.

     Sysprep /generalize /shutdown /oobe /mode:vm
    

    Was this answer helpful?

    1 person found this answer helpful.

  2. kobulloc-MSFT 26,861 Reputation points Microsoft Employee Moderator
    2024-01-20T01:15:59.43+00:00

    Hello, @Mitchell, Daniel ! Thank you for following up!

    Why am I receiving the following error? OS Provisioning for VM 'VMNAME' 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).

    In this case, it appears that the issue is related to the last line in the error message:

    Also, make sure the image has been properly prepared (generalized).

    To ensure that the VM has been properly prepared/generalized, use the following steps: https://learn.microsoft.com/en-us/azure/virtual-machines/generalize


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers. If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A! User's image

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

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