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.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

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.

Download Banner
Azure cloud platform with open and flexible cloud platform that enables you to quickly build,deploy and manage application to Microsoft-managed data center.

Azure cloud

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.

15

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

3

  • Login using your Azure Account, your powershell prompt completes with success message as below.

16

  • 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.

5

  • 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>

6

  • Uploading in progress

7

  • Once completed, you will get below message:

8

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’

9

  • Select create:

10

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’.

11

  • Select desired image file.

12

  • Add Virtual machine configuration details:

13

14

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

Rate this post