This document helps you migrate virtual machines (VMs) from your source environment to Google Cloud by using Migrate to VMs. Your source environment might be running in an on-premises environment, in a private hosting environment, or in another public cloud.
This document is part of a multi-part series about migrating to Google Cloud. If you're interested in an overview of the series, see Migration to Google Cloud: Choosing your migration path.
This document is part of a series:
- Migrating VMs with Migrate to VMs: Getting started
- Migrating VMs with Migrate to VMs: Building your foundation
- Migrating VMs with Migrate to VMs: Migrating your VMs (this document)
- Migrating VMs with Migrate to VMs: Best practices
This document is useful if you're planning to migrate VMs from a supported source environment to Compute Engine with Migrate to VMs. These source environments can include the following:
- A VMware vSphere environment
- A Microsoft Azure VM environment
- An Amazon Elastic Compute Cloud (Amazon EC2) environment
- Physical servers and VMs running an operating system that Google Cloud supports
This document assumes that you have already planned and built a foundation for Migrate to VMs, by following Migrating VMs with Migrate to VMs: Building your foundation. In the deployment phase of the migration framework, you migrate your VMs to Google Cloud.
Structure of a migration
The following terms are important for understanding how to organize a VM migration from a supported source environment to Google Cloud:
- A workload is a set of one or more VMs that are organized around a focused business use case.
- A migration is the process of moving workloads from a source environment to a target environment.
- A sprint is a division of the migration work. Multiple sprints compose a migration.
- A wave is a way to organize the VMs that you want to migrate into batches. This organization avoids a single, high-risk migration. A sprint consists of one or more waves.
- A runbook is a file that specifies which VMs are included in a wave, and describes the properties of the source and destination VMs. A single wave contains one runbook.
- A job is an operation that Migrate to VMs performs on the VMs in a runbook. A single wave can contain one or more jobs.
- A run group defines the logical order in which multiple VMs are migrated within a wave.
- A stub VM is a management object that Migrate to VMs creates on VMware vSphere to interact with the physical server during a migration.
The following Unified Modeling Language (UML) diagram shows the structure of a migration in terms of sprints, waves, runbooks, run groups, and jobs.
Migrating virtual machines with Migrate to VMs
To migrate VMs with Migrate to VMs, you perform the following steps:
- Prepare your VMs.
- Organize migrations in sprints.
- Create runbooks.
- Create waves.
- Run jobs against waves.
Preparing and adapting virtual machines
Before migrating your VMs with Migrate to VMs, you must do the following:
- Prepare your VMs and physical servers for the migration.
- Adapt your VMs to operate in the Google Cloud environment.
Prepare your virtual machines and physical servers
Migrate to VMs automatically modifies the configuration of Linux and Windows VMs before, during, and after the migration. For example, Migrate to VMs installs operating system packages and drivers on VMs.
You can also use Migrate to VMs to migrate physical servers to Google Cloud. You prepare each physical server for the migration, and then Migrate to VMs can migrate it like any other VM.
To prepare your physical server for migration, do the following
- Configure the Migrate to VMs physical server connector on the physical server.
- Register a stub VM that Migrate to VMs uses to perform the migration of the physical server.
Adapt your virtual machines
In addition to the default configuration modifications that Migrate to VMs applies to VMs, Migrate to VMs provides custom configuration scripts to adapt your VMs before, during, and after the migration. For example, you can install an operating system package or modify the configuration of a VM. You can choose to run these adaptation scripts during the following stages of migration:
- Before the migration, when a VM is still in your source environment.
- During the migration, when a VM is running in cached mode in the target environment.
- After the migration, after a VM detach operation.
Organizing the migration into sprints and waves
To mitigate the risks of a migration, we recommend that you divide the work into sprints, and then divide each sprint into waves.
To organize the migration in sprints, do the following:
Review the information that you gathered when assessing your workloads, where you determined what you want to migrate, and which workloads to migrate first.
For example, let's say that you want to migrate the
application-1workload and the following four VMs associated with that workload:
database-replica-vmVMs run a database.
backend-vmVM runs the backend of a the
frontend-vmVM runs the frontend of
Plan for a number of sprints that's equal to the number of workloads that you want to migrate. Map the sprints to each workload. A sprint is mapped to exactly one workload, and each workload is mapped to exactly one sprint.
For example, to migrate the
application-1workload, you plan for one sprint called
Plan your sprints so that each sprint contains all VMs that are necessary to run the workload mapped to that sprint. For example, if you mapped the
application-1workload to the
sprint-1sprint, then all VMs that support the
application-1workload should be part of the sprint:
Divide each sprint into one or more waves. We recommend that you use waves to manage dependencies between multiple VMs.
For example, you can divide the
sprint-1sprint into three waves:
wave-1to migrate the
wave-2to migrate the
wave-3to migrate the
(Optional) If you need to customize the order in which Migrate to VMs migrates the VMs in a wave, you use run groups. For example, you can use a run group to migrate the
database-replica-vmVM before the
Review the recommendations to rightsize the target VMs. You get performance-based or cost-based recommendations from Migrate to VMs Cloud, according to the usage patterns and the configuration of the VMs that you are migrating in the wave.
To create a wave, you do the following:
- Create the runbook for the wave from the Migrate to VMs Manager.
When you create the runbook, you specify the following information for each
- A premium OS license,
- Whether the UEFI-based VMs should have Secure Boot enabled
- Load the runbook into the wave using the Migrate to VMs Manager
- Validate the wave.
For more information about runbooks, see Runbook reference.
Running jobs on waves
You run jobs on the waves that you created. Jobs manage the lifecycle of VMs during the migration. We recommend that you run the following jobs:
- Run test clones before migrating VMs.
- Migrate VMs.
- Monitor migration jobs and waves.
- Validate your target environment.
Run test clones before migrating VMs
Before you migrate the source VMs, we recommend that you evaluate and test how your source VMs will perform in Google Cloud to help you discover any issues. By running the test clone operation against source VMs, Migrate to VMs creates clones that behave exactly like the source VMs, and runs them in Google Cloud without actually migrating the source VMs. This operation lets you measure against your previous on-premises performance baselines for your VM and make any needed changes to VM size or types. Test clones don't modify any live data because data from the test environment is not written back to the source environment. For more information about creating test clones, see Creating a test clone.
After creating the test clones, you can assess how they run in Google Cloud. You can gather information about the behavior and performance of the workloads in the new environment, and evaluate this data against the baseline of the workloads running in the current environment. You can preemptively fix any issues before the migration takes place, without disrupting your source environment.
After you complete the assessment of test clones and fix any issues, you run the delete clone operation to shut down and remove the clones from your Google Cloud environment.
Migrate to VMs runs the following operations on the VMs to migrate during the migration:
- Storage migration
- Prepare to detach
- Upgrade OS
For more information about VM lifecycle stages, see VM migration lifecycle.
Migrate to VMs conveniently groups the run-in-cloud, storage migration, and prepare to detach operations in the full migration operation. We recommend that you run the full migration operation, instead of separately running the run-in-cloud, storage migration, and prepare to detach operations due to the following reasons:
- You don't have to remember the right order in which you should run the operations because you can let Migrate to VMs take care of this aspect.
- If any operation fails when running the full migration operation on a VM, you can fix the issue, and re-run the full migration operation. Migrate to VMs automatically skips the operations part of the full migration operation that completed successfully, and resumes from the operation that failed.
If you want to roll back a VM from Google Cloud to your source environment, you can run the move back operation on that VM before detaching it.
If any of the VMs that you need to migrate runs an OS or uses a file system that Migrate to VMs doesn't support, you can migrate those VMs by running the offline migration operation.
To run operations on the VMs in a wave, you create and start a new job on a wave.
Monitoring jobs and waves
Monitoring and logging are crucial to assess how the migration is progressing and to solve any issues. In addition to monitoring Migrate to VMs components, we recommend that you monitor the migration when Migrate to VMs runs jobs on waves. You can monitor waves and jobs and view the console log of a VM running in Google Cloud.
Validate your target environment
After migrating your VMs to Google Cloud, you validate the VMs against the baseline that you established when you ran test clones and against your compliance test suites. This validation helps ensure that your workloads are behaving correctly.
Optimizing your environment after migration
When you complete all the migration waves, the migration is considered done but your Google Cloud environment might need optimizations. For example, you can rightsize Compute Engine VMs, or you can start using managed services.
For more information about optimization, see Migration to Google Cloud: Optimizing your environment.
- Install the Migrate to VMs PowerShell module.
- Use multiple IP addresses.
- Use external DNS.
- Migrate VMs to sole-tenant nodes and Windows BYOL.
- Migrate your VMs to containers with Migrate to Containers.
- Explore reference architectures, diagrams, and best practices about Google Cloud. Take a look at our Cloud Architecture Center.