Migrate Hyper-V VM with Azure Migrate
Introduction
Azure Migrate provides a centralized hub to assess and migrate to Azure on-premises servers, infrastructure, applications, and data. It provides the following:
-
Unified migration platform: A single portal to start, run, and track your migration to Azure.
-
Range of tools: A range of tools for assessment and migration. Azure Migrate tools include Azure Migrate: Discovery and assessment and Azure Migrate: Server Migration. Azure Migrate also integrates with other Azure services and tools, and with independent software vendor (ISV) offerings.
-
Assessment and migration: In the Azure Migrate hub, you can assess and migrate:
- Windows, Linux and SQL Server: Assess on-premises servers including SQL Server instances and migrate them to Azure virtual machines or Azure VMware Solution (AVS) (Preview).
- Databases: Assess on-premises databases and migrate them to Azure SQL Database or to SQL Managed Instance.
- Web applications: Assess on-premises web applications and migrate them to Azure App Service by using the Azure App Service Migration Assistant.
- Virtual desktops: Assess your on-premises virtual desktop infrastructure (VDI) and migrate it to Windows Virtual Desktop in Azure.
- Data: Migrate large amounts of data to Azure quickly and cost-effectively using Azure Data Box products.
Scenario
In this lab, we will create a Windows Virtual Machine and install Hyper-V on it to simulate the on-premise environment. Then use Azure Migrate as the hub for executing a migration, together with accompanying tools.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Preparation
- An Azure account with Azure Subscription
Step by step
Step 1: Installing Hyper-V in Azure Nested Virtualization
- Create an Azure VM capable of nesting (Windows Server 2016, etc)
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Connect and login to the Azure VM
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 2: Install Ubuntu with Hyper-V
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Here can name our virtual machine.
- Select Store the virtual machine in a different location to store the virtual machine.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Choose the generation of the virtual machine
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Specify the amount of money to allocate to this virtual machine.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Configure Networking.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Connect virtual Hard Disk.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Installation Options.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Completing the New Virtual Machine Wizard.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 3: Discover and assess the on-premises environment
In this step, you will use Azure Migrate: Server Assessment to assess the on-premises environment. This will include selecting Azure Migrate tools, deploying the Azure Migrate appliance into the on-premises environment, creating a migration assessment, and using the Azure Migrate dependency visualization.
- Select All services in the portal’s left navigation, then search for and select Azure Migrate to open the Azure Migrate Overview blade, shown below.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Select Discover assess and migrate, then Create a project. Select your subscription and create a new resource group named AzureMigrate. Enter SmartHotelMigration as the Migrate project name, and choose geography close to you to store the migration assessment data. Then select Create.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- The Azure Migrate deployment will start. Once it has been completed, you should see the Azure Migrate: Discovery and assessment and Azure Migrate: Server Migration panels for the current migration project, as shown below.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 4: Deploy the Azure Migrate appliance
In this step, you will deploy and configure the Azure Migrate appliance in the on-premises Hyper-V environment. This appliance communicates with the Hyper-V server to gather configuration and performance data about your on-premises VMs and returns that data to your Azure Migrate project.
- Under Azure Migrate: Server Assessment, select Discover to open the Discover machines blade. Under Are your machines virtualized?, select Yes, with Hyper-V.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- In 1: Generate Azure Migrate project key, provide a name for the Azure Migrate appliance that you will set up for the discovery of Hyper-V VMs. Select Generate key to start the creation of the required Azure resources.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Wait for the key to be generated, then copy the Azure Migrate project key to your clipboard.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Download Azure Migrate appliance
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Set up an appliance with a script
-
Extract the zipped file to a folder on the server that will host the appliance. Make sure you don't run the script on an existing Azure Migrate appliance.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Launch PowerShell on the server, with administrator (elevated) privileges.
-
Change the PowerShell directory to the folder containing the contents extracted from the downloaded zipped file.
-
Run the script AzureMigrateInstaller.ps1.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Step 5: Enroll your device with Azure Migrate
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Paste the project key copied from the portal site.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →


- Specify host login as the friendly name for credentials, username, and password for the Hyper-V host/cluster that the appliance will use to discover VMs. Select Save.

- select Add discovery source to specify the Hyper-V host/cluster IP address/FQDN and the friendly name for credentials to connect to the host/cluster.

- Select Start discovery to kick off VM discovery from the successfully validated hosts/clusters.

- Return to the Azure Migrate blade in the Azure portal. Select Servers, then select Refresh. Under Azure Migrate: Server Assessment you should see a count of the number of servers discovered so far. If discovery is still in progress, select Refresh periodically until discovered servers are shown. This may take several minutes.

Step 6: Create a migration assessment, and using the data gathered during the discovery phase.
In this step, you will use Azure Migrate to create a migration assessment for the SmartHotel application, using the data gathered during the discovery phase.
- Continuing from step 5, select Assess under Azure Migrate: Server Assessment to start a new migration assessment.

- On the Create Assessment Basics blade, ensure the Assessment type to be Azure VM and Discovery Source to be Machines discovered from Azure Migrate Appliance. Under Assessment properties, select Edit.

- The Assessment properties blade allows you to tailor many of the settings used when making a migration assessment report. Take a few moments to explore the wide range of assessment properties. Hover over the information icons to see more details on each setting. Choose any settings you like, then select Save. (You have to make a change for the Save button to be enabled; if you don’t want to make any changes, just close the blade.)

- Select Next to move to the Select machines to assess tab. Choose to Create New and enter the group name

- Select Next, followed by Create assessment. On the Azure Migrate - Windows, Linux, and SQL Server blade, select Refresh periodically until the number of assessments shown

- Select Assessments under Azure Migrate: Discovery and assessment to see a list of assessments. Then select the actual assessment.

- Select Azure readiness

- Select Unknown OS for UbuntuWAF. A new browser tab opens showing Azure Migrate documentation. Note on the page that the issue relates to the OS not being specified in the host hypervisor, so you must confirm the OS type and version are supported.

- Return to the portal browser tab to see details of the issue. Note the recommendation to migrate the VM using Azure Migrate: Server Migration.

Step 7: Register the Hyper-V Host with Azure Migrate: Server Migration
- Return to the Azure Migrate blade in the Azure Portal, and select Servers under Migration goals on the left. Under Migration Tools, select Discover.

- In the Discover machines panel, under Are your machines virtualized, select Yes, with Hyper-V. Under Target region enter the same region as used for your Azure SQL Database which can be found in the Azure portal and check the confirmation checkbox. Select Create resources to begin the deployment of the Azure Site Recovery resource used by Azure Migrate: Server Migration for Hyper-V migrations.

- Copy the Download link for the Hyper-V replication provider software installer to your clipboard.

-
Open the remote desktop window, launch Chrome from the desktop shortcut, and paste the link into a new browser tab to download the Azure Site Recovery provider installer.
-
Return to the Discover machines page in your browser (outside remote desktop session). Select the blue Download button and download the registration key file.

-
Open the file location in Windows Explorer, and copy the file to your clipboard. Return to the remote desktop session and paste the file to the desktop.
-
Still within the remote desktop session, open the AzureSiteRecoveryProvider.exe installer you downloaded a moment ago. On the Microsoft Update tab, select Off and select Next. Accept the default installation location and select Install.
-
Select Finalize registration, which should now be enabled.


- The Azure Migrate: Server Migration panel should now show discovered servers.

Step 8: Enable Replication from Hyper-V to Azure Migrate
- Under Azure Migrate: Server Migration, select Replicate. This opens the Replicate wizard.

- In the Source settings tab, under Are your machines virtualized?, select Yes, with Hyper-V from the drop-down. Then select Next.

- In the Virtual machines tab, under Import migration settings from an assessment, select Yes, apply migration settings from an Azure Migrate assessment. Select the VM group and the migration assessment. The Virtual machines tab should now show the virtual machines included in the assessment. Select the virtual machines, then select Next.

- In the Target settings tab, select your subscription and the existing resource group. Under Replication storage account select the migration storage… storage account and under Virtual Network select jeff. Under Subnet select default. Select Next.

- In the Compute tab, select the Standard_F2s_v2 VM size for each virtual machine. Select Next

-
In the Disks tab, review the settings but do not make any changes. Select Next, then select Replicate to start the server replication.
-
In the Azure Migrate - Servers blade, under Azure Migrate: Server Migration, select the Overview button.

- Select Replicating Machines under Manage on the left. Select Refresh occasionally and wait until the machines have a Protected status, which shows the initial replication is complete. This will take several minutes.

Step 9: Server migration
- Return to the Azure Migrate: Server Migration overview blade. Under Step 3: Migrate, select Migrate.

- On the Migrate blade, select the 3 virtual machines then select Migrate to start the migration process.


- Navigate to the resource group and check that the VM, network interface, and disk resources have been created for each of the virtual machines being migrated.

Step 10: Clean up resources
- You should complete all of these steps after attending the Hands-on lab. Failure to delete the resources created during the lab will result in continued billing.
Conclusion
In this exercise, you migrated the web tier and application tiers of the application from on-premises to Azure using Azure Migrate: Server Migration. You also installed the VM Agent on the migrated virtual machines and cleaned up migration resources.
Reference
Microsoft Azure Workshop - Application Migration