Muokkaa

Jaa


Migrate VMware VMs to Azure (agentless)

This article shows you how to migrate on-premises VMware VMs to Azure, using the Migration and modernization tool, with agentless migration. You can also migrate VMware VMs using agent-based migration. Compare the methods.

This tutorial is the third in a series that demonstrates how to assess and migrate VMware VMs to Azure.

Note

Tutorials show you the simplest deployment path for a scenario so that you can quickly set up a proof-of-concept. Tutorials use default options where possible, and don't show all possible settings and paths.

In this tutorial, you learn how to:

  • Add the Migration and modernization tool.
  • Discover VMs you want to migrate.
  • Start replicating VMs.
  • Run a test migration to make sure everything's working as expected.
  • Run a full VM migration.

If you don't have an Azure subscription, create a free account before you begin.

Prerequisites

Before you begin this tutorial, you should:

  1. Complete the first tutorial to prepare Azure and VMware for migration.
  2. We recommend that you complete the second tutorial to assess VMware VMs before migrating them to Azure, but you don't have to.
  3. Go to the already created project or create a new project
  4. Verify permissions for your Azure account - Your Azure account needs permissions to create a VM, and write to an Azure managed disk.

Note

If you're planning to upgrade your Windows operating system, Azure Migrate may download the Windows SetupDiag for error details in case upgrade fails. Ensure the VM created in Azure post the migration has access to SetupDiag. In case there is no access to SetupDiag, you may not be able to get detailed OS upgrade failure error codes but the upgrade can still proceed.

Set up the Azure Migrate appliance

The Migration and modernization tool runs a lightweight VMware VM appliance that's used for discovery, assessment, and agentless migration of VMware VMs. If you follow the assessment tutorial, you've already set the appliance up. If you didn't, set it up now, using one of these methods:

  • OVA template: Set up on a VMware VM using a downloaded OVA template.
  • Script: Set up on a VMware VM or physical machine, using a PowerShell installer script. This method should be used if you can't set up a VM using an OVA template, or if you're in Azure Government.

After creating the appliance, you check that it can connect to Azure Migrate: Server Assessment, configure it for the first time, and register it with the Azure Migrate project.

Replicate VMs

After setting up the appliance and completing discovery, you can begin replication of VMware VMs to Azure.

  • You can run up to 500 replications simultaneously.
  • In the portal, you can select up to 10 VMs at once for migration. To migrate more machines, add them to groups in batches of 10.

Note

Azure Migrate doesn't support agentless migration of VMware VMs with VMDK containing non-ASCII characters.

Enable replication as follows:

  1. In the Azure Migrate project > Servers, databases and web apps > Migration and modernization, select Replicate.

    Screenshot on selecting Replicate option.

  2. In Replicate, > Basics > Are your machines virtualized?, select Yes, with VMware vSphere.

  3. In On-premises appliance, select the name of the Azure Migrate appliance that you set up > OK.

    Screenshot on source settings.

  4. In Virtual machines, select the machines you want to replicate. To apply VM sizing and disk type from an assessment if you've run one, in Import migration settings from an Azure Migrate assessment?, select Yes, and select the VM group and assessment name. If you aren't using assessment settings, select No.

    Screenshot on selecting assessment.

  5. In Virtual machines, select VMs you want to migrate. Then click Next: Target settings.

    Screenshot on selecting VMs.

  6. In Target settings, select the subscription, target region, and Storage account.

    Note

    After starting first replication of a VM, the storage account cannot be changed. The default option selected in drop down will be used to create a new storage account. If the option is not selected, the storage account will be created in final step of enabling replication.

  7. In Virtual Network, select the Azure VNet/subnet, which the Azure VMs join after migration.

  8. In Availability options, select:

    • Availability Zone to pin the migrated machine to a specific Availability Zone in the region. Use this option to distribute servers that form a multi-node application tier across Availability Zones. If you select this option, you'll need to specify the Availability Zone to use for each of the selected machine in the Compute tab. This option is only available if the target region selected for the migration supports Availability Zones
    • Availability Set to place the migrated machine in an Availability Set. The target Resource Group that was selected must have one or more availability sets in order to use this option. Availability Set with Proximity Placement Groups is supported.
    • No infrastructure redundancy required option if you don't need either of these availability configurations for the migrated machines.
  9. In Disk encryption type, select:

    • Encryption-at-rest with platform-managed key
    • Encryption-at-rest with customer-managed key
    • Double encryption with platform-managed and customer-managed keys

    Note

    To replicate VMs with CMK, you'll need to create a disk encryption set under the target Resource Group. A disk encryption set object maps Managed Disks to a Key Vault that contains the CMK to use for SSE.

  10. 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 or Windows Server subscriptions, and you want to apply the benefit to the machines you're migrating. Then click Next.

    Screenshot on target settings.

  11. In Compute, review the VM name, size, OS disk type, and availability configuration (if selected in the previous step). VMs must conform with Azure requirements.

    • VM size: If you're using assessment recommendations, the VM size dropdown shows the recommended size. Otherwise, Azure Migrate picks a size based on the closest match in the Azure subscription. Alternatively, pick a manual size in Azure VM size.
    • 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 Zone: Specify the Availability Zone to use.
    • Availability Set: Specify the Availability Set to use.

    Note

    If you want to select a different availability option for a sets of virtual machines, go to step 1 and repeat the steps by selecting different availability options after starting replication for one set of virtual machines.

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

    Screenshot shows the Disks tab of the Replicate dialog box.

  13. In Tags, choose to add tags to your Virtual machines, Disks, and NICs.

    Screenshot shows the tags tab of the Replicate dialog box.

  14. In Review and start replication, review the settings, and click Replicate to start the initial replication for the servers.

Note

If there is a connectivity issue with Azure or if the appliance services are down for more than 90 minutes, the active replication cycles for replicating servers are reset to 0% and the respective cycle runs from the beginning.

Note

You can update replication settings any time before replication starts (Manage > Replicating machines). You can't change settings after replication starts.

Track and monitor

  1. Track job status in the portal notifications.

  2. Monitor replication status by clicking on the numerical value next to Azure VM in Migration and modernization.

    Monitor replication

Replication occurs as follows:

  • When the Start Replication job finishes successfully, the machines begin their initial replication to Azure.
  • During initial replication, a VM snapshot is created. Disk data from the snapshot is replicated to replica managed disks in Azure.
  • After initial replication finishes, delta replication begins. Incremental changes to on-premises disks are periodically replicated to the replica disks in Azure.

Run a test migration

When delta replication begins, you can run a test migration for the VMs, before running a full migration to Azure. We highly recommend that you do this at least once for each machine, before you migrate it.

  • Running a test migration checks that migration will work as expected, without impacting the on-premises machines, which remain operational, and continue replicating.
  • Test migration simulates the migration by creating an Azure VM using replicated data (usually migrating to a non-production VNet in your Azure subscription).
  • You can use the replicated test Azure VM to validate the migration, perform app testing, and address any issues before full migration.

Do a test migration as follows:

  1. In Migration goals > Servers, databases and web apps > Migration and modernization, select the numerical value next to Azure VM.

    Screenshot of Test migrated servers.

  2. Right-click the VM to test, and click Test migrate.

    Screenshot of Test migration.

  3. In Test migration, select the Azure VNet in which the Azure VM will be located during testing. We recommend you use a non-production VNet.

  4. Choose the subnet to which you would like to associate each of the Network Interface Cards (NICs) of the migrated VM.

    Screenshot shows subnet selection during test migration.

  5. You have an option to upgrade the Windows Server OS during test migration. To upgrade, select the Upgrade available option. In the pane that appears, select the target OS version that you want to upgrade to and select Apply. Learn more.

  6. The Test migration job starts. Monitor the job in the portal notifications.

  7. After the migration finishes, view the migrated Azure VM in Virtual Machines in the Azure portal. The machine name has a suffix -Test.

  8. After the test is done, right-click the Azure VM in Replicating machines, and click Clean up test migration.

    Screenshot of Clean up migration.

    Note

    You can now register your servers running SQL server with SQL VM RP to take advantage of automated patching, automated backup and simplified license management using SQL IaaS Agent Extension.

    • Select Manage > Replicating machines > Machine containing SQL server > Compute and Network and select Yes to register with SQL VM RP.
    • Select Azure Hybrid benefit for SQL Server if you have SQL Server instances that are covered with active Software Assurance or SQL Server subscriptions and you want to apply the benefit to the machines you're migrating.hs.

Migrate VMs

After you've verified that the test migration works as expected, you can migrate the on-premises machines.

  1. In the Azure Migrate project > Servers, databases and web apps > Migration and modernization, select numerical value next to Azure VM.

    Replicating servers

  2. In Replicating machines, right-click the VM > Migrate.

  3. In Migrate > Shut down virtual machines and perform a planned migration with no data loss, select Yes > OK.

    • By default Azure Migrate shuts down the on-premises VM, and runs an on-demand replication to synchronize any VM changes that occurred since the last replication occurred. This ensures no data loss.
    • If you don't want to shut down the VM, select No
  4. You have an option to upgrade the Windows Server OS during migration. To upgrade, select the Upgrade available option. In the pane that appears, select the target OS version that you want to upgrade to and select Apply. Learn more.

  5. A migration job starts for the VM. Track the job in Azure notifications.

  6. After the job finishes, you can view and manage the VM from the Virtual Machines page.

Complete the migration

  1. After the migration is done, right-click the VM > Complete migration. This stops replication for the on-premises machine, and cleans up replication state information for the VM.
  2. We automatically install the VM agent for Windows VMs and Linux during migration.
  3. Verify and troubleshoot any Windows activation issues on the Azure VM.
  4. Perform any post-migration app tweaks, such as updating host names, database connection strings, and web server configurations.
  5. Perform final application and migration acceptance testing on the migrated application now running in Azure.
  6. Cut over traffic to the migrated Azure VM instance.
  7. Remove the on-premises VMs from your local VM inventory.
  8. Remove the on-premises VMs from local backups.
  9. Update any internal documentation to show the new location and IP address of the Azure VMs.

Post-migration best practices

Next steps

Investigate the cloud migration journey in the Azure Cloud Adoption Framework.