On Prem VM migration to Azure

Dalbir Singh 1 Reputation point
2022-07-27T08:25:56.66+00:00

Hi Experts,

Call for help!

We have a requirement of moving out VMs as is in Azure from the current on prem environment and the process team is following -

  1. Create a RAW image from an on-prem VM.
  2. Convert the RAW image to VHD.
  3. Move the VHD file to Azure Storage.
  4. Convert the Disks to managed disks.
  5. Mount the OS disk to the C drive and other disks respectively.

Issue - Once we mount the OS disk, we are not able to RDP to the machine we have followed the steps suggested in the below links and as usual there are millions of documents and none point in the right direction unfortunately.

Links followed to figure out options to get this done -
Prepare a Windows VHD to upload to Azure - Azure Virtual Machines | Microsoft Learn - Microsoft documentation.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/create-vm-specialized-portal - Microsoft documentation.
https://regroove.ca/stellark/2021/02/24/upload-a-vhd-to-azure-and-create-a-virtual-machine/ - Some helpful people created this and

We have tried options

  1. Created image from managed disk and tried to initiate the VM and got exception as below
    Provisioning failed.
    OS Provisioning for VM 'demo-1' 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/.

and the suggested solution 1 to use CreateOption=Attach creates the VM but does not allow us to RDP to the machine, so we are assuming it's not booting up. The other option suggested in the hyperlink is to create an image using SysPrep which is not an option for us as we are performing a lift and shift.

Let me know if you have some thoughts on how we could get around this.

Thanks and Regards
Dalbir Singh

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,041 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Prrudram-MSFT 28,281 Reputation points Microsoft Employee Moderator
    2022-08-02T06:13:19.08+00:00

    Hello @Dalbir Singh ,

    Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.

    The approach you have followed is often referred to as lift and shift method. For your issue, first thing to check whether the VM booted after it has been spun on azure using the uploaded VHDs? You can check that from the "Boot Diagnostics" blade on Azure VM as shown below (Assuming it is windows VM)

    227057-image.png

    If you don't see the login screen, then that's a boot issue. It's not an RDP issue. If you see login screen and cannot RDP, then you need to follow the TSG available at
    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-rdp-connection
    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/detailed-troubleshoot-rdp

    It appears to be an issue with the VHD itself. To eliminate the issue with the VHD, you can try to create a VM on Hyper-V on-premises itself and see if the VM can be booted fine.

    Recommendations:

    I would suggest you use Azure Migrate for this migration. It will replicate the on-prem VMs to managed disks and helps migrate the VM to azure with a lot ease. I am adding links to the Migrate document. Please refer to the how to guides:

    https://learn.microsoft.com/en-us/azure/migrate/
    https://learn.microsoft.com/en-us/azure/migrate/migrate-support-matrix

    Please "Accept as Answer" and Upvote if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    0 comments No comments

  2. Andreas Baumgarten 123.6K Reputation points MVP Volunteer Moderator
    2022-08-02T06:23:37.44+00:00

    Hi @Dalbir Singh ,

    in addition to @Prrudram-MSFT :

    The VM in Azure is configured to use DHCP? This is important because static IP configuration in-guest OS is causing issues and trouble.

    I can second the recommendation of @Prrudram-MSFT to use Azure Migrate to move VMs to Azure. We have done this way a lot of times and it works very good.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    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.