I can see that migrating on premise workloads to Azure is particularly interesting for my clients and students. For this reason I made detailed tutorial with demo in this post on how to migrate your VMs with Azure Migrate. You will see detailed steps on how to discover, assess and migrate you Hyper-V VMs to Azure with Azure Migrate Assessment and Azure Migrate Migration tools that are part of Azure Migrate.
Azure Migrate helps you migrate to the Azure cloud, it provides a central hub to track discovery, assessment, and migration of on-premises workloads, and VMs. The hub provides Azure Migrate tools for assessment and migration, as well as integrated tools from independent software vendors.
In the previous version of Azure Migrate only assessment and migration of on-premises VMware VMs was supported, in this newest version you can migrate on-premises also Hyper-V VMs to Azure, as well as physical servers, other virtualized servers, and cloud VMs. In addition to all this, you can migrate to Azure using independent software vendor tools but if you go deeper and compare these tools with Azure Migrate you will see that (for now) only Corent SurPaaS tool has the same capabilities, to assets and migrate. With Carbonite Migrate you can migrate only and tolls like Cloudamize, Device 42, Turbonomic and UnifyCloud will give you capabiltes only to assess.
My students are almost always confused with Azure Migrate and Azure Site Recovery. The reason for this is that you must replicate the VMs prior migration with Azure Migrate. Azure Migrate Server Migration is a tool for migrating on-premises and public cloud workloads to Azure. This toll is optimized for migration. On the other hand, Site Recovery is a disaster recovery tool, but Azure Server Migration and Site Recovery share same components used for data replication, but they serve different purposes.
The new version of Azure Migrate provides a number of new features:
• Unified migration platform: Azure Migrate now provides a single portal to centralize, manage, and track your migration journey to Azure, with an improved deployment flow and portal experience.
• Assessment and migration tools: Azure Migrate provides native tools, and integrates with other Azure services, as well as with independent software vendor (ISV) tools.
• Azure Migrate assessment: Using the Azure Migrate Server Assessment tool, you can assess VMware VMs and Hyper-V VMs for migration to Azure. You can also assess for migration using other Azure services, and ISV tools.
• Azure Migrate migration: Using the Azure Migrate Server Migration tool, you can migrate on-premises VMware VMs and Hyper-V VMs to Azure, as well as physical servers, other virtualized servers, and private/public cloud VMs. In addition, you can migrate to Azure using ISV tools.
• Azure Migrate appliance: Azure Migrate deploys a lightweight appliance for discovery and assessment of on-premises VMware VMs and Hyper-V VMs.
o This appliance is used by Azure Migrate Server Assessment, and Azure Migrate Server Migration for agentless migration.
o The appliance continuously discovers server metadata and performance data, for the purposes of assessment and migration.
• VMware VM migration: Azure Migrate Server Migration provides a couple of methods for migrating on-premises VMware VMs to Azure. An agentless migration using the Azure Migrate appliance, and an agent-based migration that uses a replication appliance, and deploys an agent on each VM you want to migrate.
• Database assessment and migration: From Azure Migrate, you can assess on-premises databases for migration to Azure using the Azure Database Migration Assistant. You can migrate databases using the Azure Database Migration Service.
• Web app migration: You can assess web apps using a public endpoint URL with the Azure App Service. For migration of internal .NET apps, you can download and run the App Service Migration Assistant.
• Data Box: Import large amounts offline data into Azure using Azure Data Box in Azure Migrate.
In this post I'm will focus on Azure Migrate Server Migration and Azure Migrate Server Assessment tool. The Azure Migrate Server Migration tool provides agentless replication for on-premises Hyper-V VMs, using a migration workflow that's optimized for Hyper-V. You will need to install a software agent only on Hyper-V hosts or cluster nodes. Nothing needs to be installed on Hyper-V VMs.
Now, first thing that we need to do is to discover our on-premises environment and for that you will need to deploy the Azure Migrate appliance. Once set up, this appliance remains connected to Azure Migrate and performs continuous discovery of your on-premises environment. You can download this appliance from azure portal in the form of virtual machine, you just export the VM on your Hyper-V host and you are good to go. Before you start, ensure that prerequisites are met.
Set up an Azure Migrate project
We will use for the purpose of this demo two tier application "EduApp" that is running on Hyper-V host on premise. We will start with discovery, assess, test migration and then migration of the two VMs in Azure.
- In the Azure portal > All services, search for Azure Migrate.
- In the search results, select Azure Migrate.
- In Overview, under Discover, assess and migrate servers, click Assess and migrate servers.
- In Getting started, click Add tools.
- In the Migrate project tab, select your Azure subscription, and create a resource group if you don't have one.
- In Project Details, specify the project name, and the region in which you want to create the project.
You can create an Azure Migrate project in these regions.
Geography
|
Region
|
Asia
|
Southeast Asia
|
Europe
|
North Europe or West Europe
|
United Kingdom
|
UK South or UK West
|
United States
|
East US, West US 2 or West Central US
|
The project region is used only to store the metadata gathered from on-premises VMs.
You can select a different Azure target region when you migrate the VMs. All Azure regions are supported for migration target.
- Click Next.
- In Select assessment tool, select Azure Migrate: Server Assessment > Next.
- In Select migration tool, select Azure Migrate: Server Assessment > Next.
- In Review + add tools, review the settings, and click Add tools.
Wait a few minutes for the Azure Migrate project to deploy. You'll be taken to the project page. If you don't see the project, you can access it from Servers in the Azure Migrate dashboard.
Set up the appliance VM
Azure Migrate Server Assessment runs a lightweight Hyper-V VM appliance.
This appliance performs VM discovery and sends VM metadata and performance data to Azure Migrate: Server Assessment.
To set up the appliance you:
- Download a compressed Hyper-V VHD from the Azure portal.
- Create the appliance, and check that it can connect to Azure Migrate Server Assessment.
- Configure the appliance for the first time, and register it with the Azure Migrate project.
- Download the VHD
- Download the zipped VHD template for the appliance.
- In Migration Goals > Servers > Azure Migrate: Server Assessment, click Discover.
- In Discover machines > Are your machines virtualized?, click Yes, with Hyper-V.
- Click Download to download the VHD file.
Verify security
Check that the zipped file is secure, before you deploy it.
On the machine to which you downloaded the file, open an administrator command window.
Run the following command to generate the hash for the VHD
C:\>CertUtil -HashFile <file_location> [Hashing Algorithm]
Example usage: C:\>CertUtil -HashFile C:\AzureMigrate\AzureMigrate.ova SHA256
For appliance version 1.19.06.27, the generated hash should match these settings.
MD5
3681f745fa2b0a0a6910707d85161ec5
SHA256
e6ca109afab9657bdcfb291c343b3e3abced9a273d25273059171f9954d25832
Create the appliance VM
- Import the downloaded file, and create the VM.
- Extract the zipped VHD file to a folder on the Hyper-V host that will host the appliance VM. Three folders are extracted.
- Open Hyper-V Manager. In Actions, click Import Virtual Machine.
- In the Import Virtual Machine Wizard > Before you begin, click Next.
- In Locate Folder, specify the folder containing the extracted VHD. Then click Next.
- In Select Virtual Machine, click Next.
- In Choose Import Type, click Copy the virtual machine (create a new unique ID). Then click Next.
- In Choose Destination, leave the default setting. Click Next.
- In Storage Folders, leave the default setting. Click Next.
- In Choose Network, specify the virtual switch that the VM will use. The switch needs internet connectivity to send data to Azure.
- In Summary, review the settings. Then click Finish.
- In Hyper-V Manager > Virtual Machines, start the VM.
- Verify appliance access to Azure
Make sure that the appliance VM can connect to Azure URLs.
Configure the appliance
- Set up the appliance for the first time.
- In Hyper-V Manager > Virtual Machines, right-click the VM > Connect.
- Provide the language, time zone, and password for the appliance.
- Open a browser on any machine that can connect to the VM, and open the URL of the appliance web app: https://appliance name or IP address: 44368.
Alternately, you can open the app from the appliance desktop by clicking the app shortcut.
- In the web app > Set up prerequisites, do the following:
- License: Accept the license terms, and read the third-party information.
- Connectivity: The app checks that the VM has internet access. If the VM uses a proxy:
- Click Proxy settings, and specify the proxy address and listening port, in the form http://ProxyIPAddress or http://ProxyFQDN.
- Specify credentials if the proxy needs authentication.
- Only HTTP proxy is supported.
- Time sync: Time is verified. The time on the appliance should be in sync with internet time for VM discovery to work properly.
- Install updates: Azure Migrate Server Assessment checks that the appliance has the latest updates installed.
- Register the appliance with Azure Migrate
- Click Log In. If it doesn't appear, make sure you've disabled the pop-up blocker in the browser.
- On the new tab, sign in using your Azure credentials.
- Sign in with your username and password.
- Sign-in with a PIN isn't supported.
- After successfully signing in, go back to the web app.
- Select the subscription in which the Azure Migrate project was created. Then select the project.
- Specify a name for the appliance. The name should be alphanumeric with 14 characters or less.
- Click Register.
If you're running VHDs on SMBs, you must enable delegation of credentials from the appliance to the Hyper-V hosts. You need to enable CredSSP on hosts in ordeer to discover configuration information for Hyper-V VMs with disks on SMB shares.
- Identify Hyper-V hosts running Hyper-V VMs with disks on SMB shares.
- Run the following command on each identified Hyper-V host:
Enable-WSManCredSSP -Role Server -Force
VMs can only be migrated to managed disks (standard HHD, premium SSD) in Azure
- Connect from the appliance to Hyper-V hosts or clusters, and start VM discovery.
- In User name and Password, specify the account credentials that the appliance will use to discover VMs. Specify a friendly name for the credentials, and click Save details.
- Click Add host, and specify Hyper-V host/cluster details.
- Click Validate. After validation, the number of VMs that can be discovered on each host/cluster is shown.
- If validation fails for a host, review the error by hovering over the icon in the Status column. Fix issues, and validate again.
- To remove hosts or clusters, select > Delete.
You can't remove a specific host from a cluster. You can only remove the entire cluster.
You can add a cluster, even if there are issues with specific hosts in the cluster.
- After validation, click Save and start discovery to start the discovery process.
It takes around 15 minutes for metadata of discovered VMs to appear in the Azure portal.
The appliance comes with a Windows Server 2016 evaluation license, which is valid for 180 days. If the evaluation period is close to expiry, it is recommend that you download and deploy a new appliance, or that you activate the operating system license of the appliance VM.
Verify VMs in the portal
After discovery phase is finished, you can verify that the VMs appear in the portal as discoverd servers.
- Open the Azure Migrate dashboard.
- In Azure Migrate - Servers > Azure Migrate: Server Assessment page, click the icon that displays the count for Discovered servers.
Set up an assessment
Next, the Azure Migrate Server Assessment part is very important, let's say crucial from the architectural point of migration process. It is something that you must pay attention to.
After successful discovery of your on premise VMs the next step will be assessment.
I’m going to dedicate a post for assessment component of Azure migrate and Log Analytics but for now we are going to cover the basics.
Not all machines are suitable for running in Azure. Azure Migrate Server Assessment assesses each on-premises machine for migration suitability to Azure, and categorizes the assessed machines into one of the following suitability categories:
- Ready for Azure - The machine can be migrated as-is to Azure without any changes. It will boot in Azure with full Azure support.
- Conditionally ready for Azure - The machine may boot in Azure but may not have full Azure support. For example, a machine with an older version of Windows Server OS is not supported in Azure. You need to be careful before migrating these machines to Azure and follow the remediation guidance suggested in the assessment to fix the readiness issues before you migrate.
- Not ready for Azure - The machine will not boot in Azure. For example, if an on-premises machine has a disk of size more than 64 TB attached to it, it cannot be hosted on Azure. You need to follow the remediation guidance suggested in the assessment to fix the readiness issue before migrating to Azure. Right-sizing and cost estimation is not done for machines that are marked as not ready for Azure.
- Readiness unknown - Azure Migrate could not find the readiness of the machine due to insufficient metadata collected from the on-premises environment.
In order to get VMs dependencies which is a very important part of any migration assessment, an Log Analytics (OMS) workspace needs to be created and agent must be installed on every VM. Remember that you can only create or attach a workspace in the same subscription where the Azure Migrate project is created.
Dependency visualization in Server Assessment allows you to create high-confidence groups for migration assessments. Using dependency visualization, you can view network dependencies of machines and identify related machines that need to be migrated together to Azure. This functionality is useful in scenarios where you are not completely aware of the machines that constitute your application and need to be migrated together to Azure.
To attach a Log Analytics workspace to a project:
While associating a workspace, you will get the option to create a new workspace or attach an existing one.
When you create a new workspace, you need to specify a name for the workspace. The workspace is then created in a region in the same Azure geography as the migration project.
When you attach an existing workspace, you can pick from all the available workspaces in the same subscription as the migration project. Note that only those workspaces are listed which were created in a region where Service Map is supported.
Once you have attached a workspace to a project, you cannot change it later.
The associated workspace is tagged with the key Migration Project, and value Project name, which you can use to search in the Azure portal. To navigate to the workspace associated with the project, you can go to Essentials section of the project Overview page and access the workspace
To use dependency visualization, you need to download and install agents on each on-premises machine that you want to analyze.
Microsoft Monitoring agent(MMA) needs to be installed on each machine.
The Dependency agent needs to be installed on each machine.
In addition, if you have machines with no internet connectivity, you need to download and install Log Analytics gateway on them.
You don't need these agents on machines you want to assess unless you're using dependency visualization.
- In Azure Migrate - Servers > Discovered servers you can see notification in DEPENDENCIES section
- Click on Requires agent installation
Install and verify connectivity of agents with Log Analytics.
Next set up an assessment.
There are two types of assessments you can run using Azure Migrate Server Assessment.
Assessment
|
Details
|
Data
|
Performance-based
|
Assessments based on collected performance data
|
Recommended VM size: Based on CPU and memory utilization data.
Recommended disk type (standard or premium managed disk): Based on the IOPS and throughput of the on-premises disks. |
As on-premises
|
Assessments based on on-premises sizing.
|
Recommended VM size: Based on the on-premises VM size
Recommended disk type: Based on the storage type setting you select for the assessment. |
Review the best practices for creating assessments.
Run an assessment as follows:
- In Servers > Azure Migrate: Server Assessment, click Assess.
- In Assess Servers, specify a name for the assessment and choose the Appliance name.
- In Assess Servers, Select or create a group, and select the VMs the you want to assess
- Click Create Assessment to create the group, and run the assessment.
After the assessment is created, view it in Servers > Azure Migrate: Server Assessment.
An assessment describes:
Azure readiness: Whether VMs are suitable for migration to Azure.
Monthly cost estimation: The estimated monthly compute and storage costs for running the VMs in Azure.
Monthly storage cost estimation: Estimated costs for disk storage after migration.
View an assessment
- In Migration goals > Servers > Azure Migrate: Server Assessment, click Assessments.
- In Assessments, click on an assessment to open it.
Review Azure readiness
In Azure readiness, we can see that in this case we have issue with UEFI, this is an unsupported boot type.
Azure does not support VMs with EFI boot type. It is recommended the you to convert the boot type to BIOS before you run a migration but you can use Azure Migrate Server Migration to do the migration of such VMs, it will convert the boot type of the VM to BIOS during the migration.
Click on an Azure readiness status. You can view VM readiness details, and drill down to see VM details, including compute, storage, and network settings.
Review cost details
This view shows the estimated compute and storage cost of running VMs in Azure.
Review the monthly compute and storage costs.
Costs are aggregated for all VMs in the assessed group. Cost estimates are based on the size recommendations for a machine, and its disks and properties.
Estimated monthly costs for compute and storage are shown.
The cost estimation is for running the on-premises VMs as IaaS VMs. Azure Migrate Server Assessment doesn't consider PaaS or SaaS costs.
Review monthly storage cost estimates.
This view shows aggregated storage costs for the assessed group, split over different types of storage disks.
You can drill down to see details for specific VMs.
Review confidence rating
When you run performance-based assessments, a confidence rating is assigned to the assessment.
The confidence rating helps you estimate the reliability of the size recommendations provided by the assessment. The confidence rating is based on the availability of data points needed to compute the assessment. Depending on the percentage of data points available, the confidence rating for the assessment is provided as below:
Availability of data points Confidence rating
0%-20% 1 Star
21%-40% 2 Star
41%-60% 3 Star
61%-80% 4 Star
81%-100% 5 Star
Migrate Hyper-V VMs to Azure
Once we are done with installing and configuring all components, run the assessments, we can proceed with the migration of our VMs. For that we need to prepare our Hyper-V hosts. You do this by downloading and installing replication provider software on your Hyper-V hosts.
- In the Azure Migrate project > Servers, in Azure Migrate: Server Migration, click Discover.
- In Discover machines > Are your machines virtualized?, select Yes, with Hyper-V.
- In Target region, select the Azure region to which you want to migrate the machines.
- Select Confirm that the target region for migration is region-name.
- Click Create resources. This creates an Azure Site Recovery vault in the background.
If you've already set up migration with Azure Migrate Server Migration, this option won't appear since resources were set up previously.
You can't change the target region for this project after clicking this button and all subsequent migrations are to this region.
- In Prepare Hyper-V host servers, download the Hyper-V Replication provider, and the registration key file.
The registration key is needed to register the Hyper-V host with Azure Migrate Server Migration and this key is valid for five days after you generate it.
Replicate Hyper-V VMs
Our next step is to replicate the VMs. This what I was trying to explain in the beginning of this post. You must replicate the VMs prior migration. With Azure Migrate discovery completed, we can begin replication of our Hyper-V VMs to Azure.
- In the Azure Migrate project > Servers, Azure Migrate: Server Migration, click Replicate.
- In Replicate, > Source settings > Are your machines virtualized?, select Yes, with Hyper-V. Then click Next: Virtual machines.
- In Virtual machines, select the machines you want to replicate.
If you've run an assessment for the VMs, you can apply VM sizing and disk type (premium/standard) recommendations from the assessment results. To do this, in Import migration settings from an Azure Migrate assessment?, select the Yes option.
If you didn't run an assessment, or you don't want to use the assessment settings, select the No options.
- If you selected to use the assessment, select the VM group, and assessment name.
- In Virtual machines, search for VMs as needed, and check each VM you want to migrate. Then, click Next: Target settings.
- In Target settings, select the target region to which you'll migrate, the subscription, and the resource group in which the Azure VMs will reside after migration.
- In Replication Storage Account, select the Azure storage account in which replicated data will be stored in Azure.
- Virtual Network, select the Azure VNet/subnet to which the Azure VMs will be joined after migration.
- In Azure Hybrid Benefit: Select No if you don't want to apply Azure Hybrid Benefit. Then, click Next.
- Select Yes if you have Windows Server machines that are covered with active Software Assurance. Then click Next.
- In Compute, review the VM name, size, OS disk type, and availability set. VMs must conform with Azure requirements.
OS disk: Specify the OS (boot) disk for the VM. The OS disk is the disk that has the operating system bootloader and installer.
Availability set: If the VM should be in an Azure availability set after migration, specify the set. The set must be in the target resource group you specify for the migration.
- In Disks, specify whether the VM disks should be replicated to Azure, and select the disk type (standard SSD/HDD or premium-managed disks) in Azure. Then click Next.
You can exclude disks from replicationand is so thay won't be present on the Azure VM after migration.
- In Review and start replication, review the settings, and click Replicate to start the initial replication for the servers.
Replication process.
When you enable replication for a VM, initial replication to Azure storage begins, using the specified replication policy. Traffic replicates to Azure storage public endpoints over the internet. YOu shoul note that replicating traffic over a site-to-site virtual private network (VPN) from an on-premises site to Azure isn't supported.
After initial replication finishes, delta replication begins. Tracked changes for a machine are logged.
Communication happens as follows:
VMs communicate with the replication appliance on port HTTPS 443 inbound, for replication management.
The replication appliance orchestrates replication with Azure over port HTTPS 443 outbound.
VMs send replication data to the process server (running on the replication appliance) on port HTTPS 9443 inbound. This port can be modified.
The process server receives replication data, optimizes and encrypts it, and sends it to Azure storage over port 443 outbound.
The replication data logs first land in a cache storage account in Azure. These logs are processed and the data is stored in an Azure managed disk.
When you enable replication for a VM, initial replication to Azure storage begins, using the specified replication policy. Traffic replicates to Azure storage public endpoints over the internet. YOu shoul note that replicating traffic over a site-to-site virtual private network (VPN) from an on-premises site to Azure isn't supported.
After initial replication finishes, delta replication begins. Tracked changes for a machine are logged.
Communication happens as follows:
VMs communicate with the replication appliance on port HTTPS 443 inbound, for replication management.
The replication appliance orchestrates replication with Azure over port HTTPS 443 outbound.
VMs send replication data to the process server (running on the replication appliance) on port HTTPS 9443 inbound. This port can be modified.
The process server receives replication data, optimizes and encrypts it, and sends it to Azure storage over port 443 outbound.
The replication data logs first land in a cache storage account in Azure. These logs are processed and the data is stored in an Azure managed disk.
Once we are done with replication we can proceed with test migration, remember test migration is not mandatory, but it is highly recommended.
- In Azure Migrate - Servers >Azure Migrate: Server Migration - Replicating machines right click the VM and click Test migration
- In Azure Migrate - Servers >Azure Migrate: Server Migration - Replicating machines > Test migration select Virtual Network and click Migrate
After a while test migration is completed. In order to delete the virtual machine created during test failover use 'Cleanup test failover' option on the virtual machine.
After cleanup finishes we are ready to migrate the VM, remember cleanup must be done in order to execute migration.
We are done, the VMs has been migrated, we can see that is running is Azure and the same VM is stoped on our Hyper-V host.
So, there you have it. Hope this really helps you on your venture of migration your datacenter in cloud. Please feel free to comment below.