As a Microsoft fanboy and as an IT Manager in my campus, let me give a quick steps to migrate your HyperV VMs to Microsoft’s Cloud Infrastructure-Azure!
In this blog post, let me explain in detail about moving an active on premise Hyper-V VM to Azure cloud. This helps in recovering a virtual machine to an Azure hosted machine.
This article shows how to upload a virtual hard disk (VHD) with an operating system so you can use it as an image to create virtual machines based on that image on Azure Platform.
Let me walkthrough the steps in VM creation-
Prerequisites
- An active Azure account.
- Windows Azure PowerShell installed on a machine.
- VHD file with Windows Azure supported OS. ( convert into vhd if you have vhdx, using Hyper-V manager).
- Create a storage account, create a container under that storage account. Note down the url for uploading the vhd file for creating Image on Azure.
- Install Windows Azure Powershell on a Windows machine.
Starting with Download
You can download and install the Azure Powershell modules by running the Web Platform Installer 5.0, which is available in Microsoft website.
Preparing VHD file upload into Azure cloud storage container:
VHD file preparation must be generalised to suit Azure Environment. For that:
- You need to login into that particular vm
- run sysprep executable under system32 in elevated command prompt
- select Generalize, and select options as below.
Establishing secure connection:
Establishing a secure connection between your computer and your subscription in Microsoft Azure is a must.
- Microsoft Azure Active Directory method or the certificate method can be used for the establishment.
- Open Windows Powershell and type Add-AzureAccount
- Login using your Azure Account, your powershell prompt completes with success message as below.
- Next, type the following command in Powershell: Get-AzurePublishSettingsFile
A browser window opens and prompts you to download file ‘.publishsettings’ as below. It contains information and certificate of your Microsoft Azure subscription.
- Store this file in a separate directory.
- Type the following command: Import-AzurePublishSettingsFile <PathToFile>
Where <PathToFile> is the full path to the .publishsettings file.
- Your machine will get registered to your Azure Account.
Uploading vhd file:
Follow the below steps to upload VHD in Azure container:
- In Azure Powershell, type:
Add-AzureVhd -Destination “<BlobStorageURL>/<YourImagesFolder>/<VHDName>.vhd” -LocalFilePath <PathToVHDFile>
- Uploading in progress
- Once completed, you will get below message:
Creating an Image from VHD:
Next step is to create an Image from the vhd file in Azure with below steps:
- Login to your Azure account→ Select ‘Virtual Machines→ Images’
- Select create:
Once the details are filled along the check box ticked, image will be created for the uploaded VHD. Using this Image you can create VM.
Creating Virtual machine
- Now create a new VM with ‘Compute→ Virtual Machine→ From Gallery→ My Images’.
- Select desired image file.
- Add Virtual machine configuration details:
Once VM creation process done, you can login to the vm and verify installed applications and data.
Hope the walkthrough is as smooth as you could ever imagine.
To learn more about our VM support, please do contact our support at: vembu-sales@vembu.com