Migrating VMs to GCP with Migrate to Virtual Machines Service

Xuan Gao
Google Cloud - Community
4 min readNov 29, 2023

Workload migration can be time-consuming. GCP offers a comprehensive suite of services and tools to streamline the migration process and empower organizations to seamlessly transition their workloads to GCP. Migrate to Virtual Machines is a service that simplifies the migration of virtual machines (VMs) to Compute Engine. Your source environment might be running in an on-premises environment, in a private hosting environment, or in another cloud provider. You can migrate one or thousands of applications across multiple data centers and clouds.

In this article I want to show you an example of how to use Migrate to Virtual Machines service to migrate AWS EC2 instances to GCP with ease.

  1. Log in to your GCP dashboard. Search and enable Migrate to Virtual Machines API.

2. Add a source. Source is the cloud environment or the on-prem VMware data center hosting the VMs that you want to migrate.

In this example, I chose AWS source. You need to choose which GCP region you want to migrate to. You also need to have the AWS Access Key and Secret Key in hand.

For Azure, you need to have the Subscription ID, Client ID, Tenant ID and Client secret value ready.

For VMWare source, you need to install and configure the Migrate Connector on your vSphere data center.

3. Onboard VMs. After adding a source, you will see a list of Source VMs. You can onboard them in a group.

4. Start replication. After onboarding a source VM, start replicating the disk data from the source VM to Google Cloud. This process takes place in the background with no disruption to the workload. You can go to the VM Migrations Tab and click start replication. It will take some time. You can check the Replication status for progress.

  • First sync VM is performing the first replication step.
  • Active (Current cycle: XX%) VM has performed XX% percent of the current replication step.
  • Active (Idle) VM is idle between replication steps.

5. Configure the target. Click Edit Target Details, where you need to give the instance name, choose the project and zone, and set up the machine configuration and network configuration.

6. Perform a cut-over. This process includes stopping the source VM, performing a final replication, and creating the production instance from the source VM. Make sure you are ready to stop the source VM. Test Clone is an optional step, where you can create a clone of the source VM from the replication data and test it on Google Cloud.

7. Finalize the migration. Clean up all resources consumed by the migration following a successful cut-over operation.Finalize can be performed only on VMs in the Cut-Over state.

We are done!

Please see GCP documentation for more details: https://cloud.google.com/migrate/virtual-machines/docs/5.0/how-to/migrating-vms

Migrate to Virtual Machines Service: https://cloud.google.com/migrate/virtual-machines

Written by Xuan Gao
Customer Engineer, Google Cloud

--

--