Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Friday, August 10, 2018 3:04 AM
what is the best way to migrate a vhdx into azure?
I know the vhdx must be made into a vhd. What is the simplest tool for this?
Next how do we upload and make this vhd into a IaaS (linux) in Azure?
Please recommend detailed steps for this?
dsk
All replies (7)
Friday, August 10, 2018 3:23 AM
You can convert a virtual disk by using the Convert-VHD command in Windows PowerShell. Select Run as administrator when you start PowerShell.
The following example command converts from VHDX to VHD, and from a dynamically expanding disk to fixed-size:
Convert-VHD –Path c:\test\MY-VM.vhdx –DestinationPath c:\test\MY-NEW-VM.vhd -VHDType Fixed
For more details, refer “Migrate on-prem VM to Azure”.
Let me know if there are still any additional issues I can help with.
If this answer was helpful, click “Mark as Answer” or “Up-Vote”. To provide additional feedback on your forum experience, click here
Friday, August 10, 2018 3:42 AM
The “Migrate on-prem VM to Azure” has lots of CLI commands.
Is there a detailed way to do this using the GUI?
Or at least using the GUI as much as possible.
dsk
Friday, August 10, 2018 5:26 AM
Step1: Converting VHDX to VHD:
Copy the location of vhdx want to convert (C:\ProgramData\Microsoft\Windows\Hyper-V\Ubuntu1804\Virtual Hard Disks\Ubuntu1804.vhdx).
Open PowerShell as administrator mode:
Convert-VHD -Path "C:\ProgramData\Microsoft\Windows\Hyper-V\Ubuntu1804\VirtualHardDisks\Ubuntu1804.vhdx " -DestinationPath "H:\OS\MigrateUbuntu1804.vhd"
Optional: In case if you get this error message (Only blobs formatted as VHDs can be imported.) while uploading. You can try the below conversion method.
Converting to a fixed virtual hard disk:
Note: If you upload vhd now, you will get this error message (Only blobs formatted as VHDs can be imported.) because the file size should be fixed not dynamic.
The vhd file is fixed size and it is aligned to 1 MB. Otherwise, please follow this guide to convert the dynamic vhd to a fixed one.
Shutdown the virtual machine (do not put it into a saved state)
Open the virtual machine settings and select the virtual hard disks one at a time
Click the Edit button on the settings page:
Locate Virtual Hard Disk:
Choose Action:
Convert Virtual Hard Disk: VHD
Convert Virtual Hard Disk: Fixed Size
Specify Virtual Hard Disk location:
Completing the Edit VHD:
Step 2: Continued.... (Since it allows limited images; posting as separate steps)
Friday, August 10, 2018 5:28 AM | 1 vote
Step2: Upload a VHD
From Azure Portal, create Azure Storage account:
Go to Azure Portal => + Create a resource => Storage => Storage account -blob, file, table, queue.
Upload vhd to Azure Storage blob:
Go to create storage account => Blobs
Create a container:
Click on Blobs => + Container => Enter Name and create
Upload disk to your container:
Uploading VHD:
Uploaded:
Step 3: Create Managed Disk using uploaded .vhd:
Go to Azure Portal => + Create a resource => Managed Disks
Step 4: Create VM using Managed Disk:
Let me know if there are still any additional issues I can help with.
If this answer was helpful, click “Mark as Answer” or “Up-Vote”. To provide additional feedback on your forum experience, click here
Friday, August 10, 2018 2:52 PM
So I realize the vhd must be 1st generation to convert to azure Iaas? Can a 2nd generation vhd be converted to azure Iaas?
dsk
Saturday, August 11, 2018 2:37 AM
Azure only supports generation 1 virtual machines. You can convert a generation 1 virtual machine from VHDX to the VHD file format and from dynamically expanding to a fixed sized disk. But you can't change a virtual machine's generation.
For more information, see Should I create a generation 1 or 2 virtual machine in Hyper-V?
If this answer was helpful, click “Mark as Answer” or “Up-Vote”. To provide additional feedback on your forum experience, click here
Tuesday, August 14, 2018 6:10 AM
Just Checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same. And, if you have any further query do let us know.