Migrate on-premises machines to Azure
This article describes how to migrate on-premises machines to Azure, using the Azure Site Recovery. Generally, Site Recovery is used to manage and orchestrate disaster recovery of on-premises machines and Azure VMs. However, it can also be used for migration. Migration uses the same steps as disaster recovery with one exception. In a migration, failing machines over from your on-premises site is the final step. Unlike disaster recovery, you can't fail back to on-premises in a migration scenario.
This tutorial shows you how to migrate on-premises VMs and physical servers to Azure. You learn how to:
- Set up the source and target environment for migration
- Set up a replication policy
- Enable replication
- Run a test migration to make sure everything's working as expected
- Run a one-time failover to Azure
You can now migrate on-premises servers to Azure using the Azure Migrate service. Learn more
Before you start
Note that devices exported by paravirtualized drivers aren't supported.
Prepare Azure and on-premises
- Prepare Azure as described in this article. Although this article describes preparation steps for disaster recovery, the steps are also valid for migration.
- Prepare on-premises VMware or Hyper-V servers. If you're migrating physical machines, you don't need to prepare anything. Just verify the support matrix.
Select a protection goal
Select what you want to replicate, and where you want to replicate to.
- Click Recovery Services vaults > vault.
- In the Resource Menu, click Site Recovery > Prepare Infrastructure > Protection goal.
- In Protection goal, select what you want to migrate.
- VMware: Select To Azure > Yes, with VMWare vSphere Hypervisor.
- Physical machine: Select To Azure > Not virtualized/Other.
- Hyper-V: Select To Azure > Yes, with Hyper-V. If Hyper-V VMs are managed by VMM, select Yes.
Set up the source environment
|VMware||Set up the source environment, and set up the configuration server.|
|Physical machine||Set up the source environment and configuration server.|
|Hyper-V||Set up the source environment
Set up the source environment for Hyper-V deployed with System Center VMM.
Set up the target environment
Select and verify target resources.
- Click Prepare infrastructure > Target, and select the Azure subscription you want to use.
- Specify the Resource Manager deployment model.
- Site Recovery checks the Azure resources.
- If you're migrating VMware VMs or physical servers, Site Recovery verifies you have an Azure network in which the Azure VMs will be located when they're created after failover.
- If you're migrating Hyper-V VMs, Site Recovery verifies you have a compatible Azure storage account and network.
- If you're migrating Hyper-V VMs managed by System Center VMM, set up network mapping.
Set up a replication policy
|VMware||Set up a replication policy for VMware VMs.|
|Physical machine||Set up a replication policy for physical machines.|
|Hyper-V||Set up a replication policy
Set up a replication policy for Hyper-V deployed with System Center VMM.
|VMware||Enable replication for VMware VMs.|
|Physical machine||Enable replication for physical machines.|
Enable replication for Hyper-V deployed with System Center VMM.
Run a test migration
Run a test failover to Azure, to make sure everything's working as expected.
Migrate to Azure
Run a failover for the machines you want to migrate.
In Settings > Replicated items click the machine > Failover.
In Failover select a Recovery Point to fail over to. Select the latest recovery point.
The encryption key setting isn't relevant for this scenario.
Select Shut down machine before beginning failover. Site Recovery will attempt to shutdown virtual machines before triggering the failover. Failover continues even if shutdown fails. You can follow the failover progress on the Jobs page.
Check that the Azure VM appears in Azure as expected.
In Replicated items, right-click the VM > Complete Migration. This does the following:
Finishes the migration process, stops replication for the on-premises VM, and stops Site Recovery billing for the VM.
This step cleans up the replication data. It doesn't delete the migrated VMs.
Don't cancel a failover in progress: VM replication is stopped before failover starts. If you cancel a failover in progress, failover stops, but the VM won't replicate again.
In some scenarios, failover requires additional processing that takes around eight to ten minutes to complete. You might notice longer test failover times for physical servers, VMware Linux machines, VMware VMs that don't have the DHCP service enabled, and VMware VMs that don't have the following boot drivers: storvsc, vmbus, storflt, intelide, atapi.
After machines are migrated to Azure, there are a number of steps you should complete.
Some steps can be automated as part of the migration process using the in-built automation scripts capability in recovery plans
Post-migration steps in Azure
- Perform any post-migration app tweaks, such as updating database connection strings, and web server configurations.
- Perform final application and migration acceptance testing on the migrated application now running in Azure.
- The Azure VM agent manages VM interaction with the Azure Fabric Controller. It's required for some Azure services, such as Azure Backup, Site Recovery, and Azure Security.
- If you're migrating VMware machines and physical servers, the Mobility Service installer installs available Azure VM agent on Windows machines. On Linux VMs, we recommend that you install the agent after failover.
- If you’re migrating Azure VMs to a secondary region, the Azure VM agent must be provisioned on the VM before the migration.
- If you’re migrating Hyper-V VMs to Azure, install the Azure VM agent on the Azure VM after the migration.
- Manually remove any Site Recovery provider/agent from the VM. If you migrate VMware VMs or physical servers, uninstall the Mobility service from the VM.
- For increased resilience:
- For increased security:
- Lock down and limit inbound traffic access with Azure Security Center Just in time administration
- Restrict network traffic to management endpoints with Network Security Groups.
- Deploy Azure Disk Encryption to help secure disks, and keep data safe from theft and unauthorized access.
- Read more about securing IaaS resources, and visit the Azure Security Center.
- For monitoring and management:
- Consider deploying Azure Cost Management to monitor resource usage and spending.
Post-migration steps on-premises
- Move app traffic over to the app running on the migrated Azure VM instance.
- Remove the on-premises VMs from your local VM inventory.
- Remove the on-premises VMs from local backups.
- Update any internal documentation to show the new location and IP address of the Azure VMs.
In this tutorial you migrated on-premises VMs to Azure VMs. Now
Set up disaster recovery to a secondary Azure region for the Azure VMs.