AWS Storage Blog

Migrate compute from Google Cloud Platform (GCP) to AWS using AWS Application Migration Service

Customers using Google Cloud Platform (GCP) might explore the option of spreading or transitioning their cloud usage away from GCP to alternative providers for various reasons, including cost evaluations, data centralization, or changes in business requirements. Regardless of the motivating factors, adopting effective migration solutions can lead to time and cost savings while reducing downtime.

For those transitioning to AWS, AWS Application Migration service (AWS MGN) offers assistance in moving IT infrastructure from on-premises data centers or other cloud providers. By providing a highly automated, lift-and-shift approach, AWS MGN streamlines, expedites, and reduces the expenses associated with cloud migration.

In this blog post, I explore one method of migrating virtual machines from Google Cloud Platform (GCP) to AWS: using AWS MGN. The migration process involves setting up AWS MGN by defining settings and initiating continuous data replication, performing testing by launching instances for non-disruptive tests before the cutover phase, and executing the migration by swiftly launching cutover instances on AWS. This solution can be helpful for customers seeking a seamless migration experience, with minimal cost, complexity, and disruption to business operations.

Key features of AWS MGN

First off, I wanted to start by highlighting some key features of AWS MGN:

Wide platform and source OS support: AWS MGN allows replication of any physical, virtual or cloud-based source server to the AWS Cloud for a large variety of operating systems. Refer to this User Guide to check the list of supported operating systems.

Continuous data replication: The service performs continuous block-level data replication from the source environment to the target AWS environment. This ensures that changes made on the source servers during the migration are seamlessly synchronized to the AWS Cloud.

Live migration: With AWS MGN, you can migrate applications while they are still running, avoiding lengthy downtimes and minimizing business disruptions. The service ensures that the source and target servers remain in sync throughout the migration process.

Application cutover control: AWS MGN allows you to control when the application cutover takes place. This ensures that you can verify the target environment’s readiness before finalizing the migration.

Automation and orchestration: The service automates several aspects of the migration process, such as server discovery, replication setup, and cutover. It also supports post-launch settings, allowing you to configure and automate actions performed after the server is launched in AWS. This reduces the risk of human error and accelerates the overall migration timeline.

Solution architecture

AWS MGN is a fully managed service provided by AWS. It empowers businesses to migrate their applications, virtual machines, and associated data to AWS efficiently, leveraging automation to streamline the process.

The following diagram depicts the general AWS MGN architecture for migrating GCP Compute Engine VM instances to AWS.

GCP AWS solution architecture

Source environment: The source environment consists of Google Compute Engine instances running applications that you wish to migrate to AWS. The service utilizes lightweight replication agents installed on the source servers to capture and replicate changes continuously and securely over port 443 using TLS.

Replication and Cutover Workflow: The migration process involves three key stages: server discovery and setup, replication, and cutover. Initially, AWS MGN discovers the source servers, assesses their compatibility with the cloud environment, and sets up the necessary replication settings. Continuous block-level data replication ensures that any changes made on the source servers are replicated to the AWS Cloud in real-time. Once you are ready for the cutover, you can initiate it, and AWS MGN will complete the migration by switching over to the AWS Cloud environment.

AWS Management Console: The AWS Management Console provides a user-friendly interface to control and monitor the migration process. IT teams can track the status of the migration, set cutover timing, and troubleshoot any issues that may arise during the migration.

Prerequisites

Before we begin the solution walkthrough, ensure that you have set up:

  • An account on AWS and a project on GCP.
  • An Amazon Virtual Private Cloud (Amazon VPC) and a virtual private cloud on GCP.
  • A number of running Google Compute Engine instances with administrative access.
  • Dedicated subnets on AWS to host the replication server, staging/target EC2 instances.
  • Ensure that you meet all of the network requirements.

Solution walkthrough

In this walkthrough, I explore how to seamlessly migrate your GCP Compute Engine virtual machine instances to AWS using AWS MGN.

Step 1: First time AWS MGN setup
Step 2: Add source servers
Step 3: Launch a test instance
Step 4: Mark test instances as ready for cutover
Step 5: Launch a cutover
Step 6: Initiate cutover and finalize migration

Step 1: First time AWS MGN setup

1. The first step to initialize MGN. Select Get started on AWS MGN landing page.

GCP AWS first time setup

2. Upon your initial login to AWS MGN, you will receive an automatic prompt to initialize the service. Select Set up service to complete the initialization of the service.

GCP AWS service initialization

The initialization process involves creating three templates. The “replication template” defines the data replication process for any newly added source server. The “launch template “defines how instances are launched on EC2. The “post-launch template” defines optional modernization automation actions that can be executed following launching new instances.

At any moment, you can modify the configured settings for either a specific source server or a group of source servers. For additional information regarding replication settings, explore the details on how to change these replication settings for individual servers or multiple servers.

Once the service is initialized, you’ll be redirected into AWS MGN console Source servers page.

GCP AWS service initiation completed

Step 2: Add source servers

The next step to setting up AWS MGN is adding your source servers by installing the AWS Replication agent on them.

  1. Add source servers to AWS MGN by Installing the AWS MGN replication agent on each source Compute Engine instance. This agent will facilitate continuous block-level data replication from the source to the AWS Cloud.

For the Application Migration Service agent to replicate data, you need to have an AWS IAM User with proper privileges created in your target AWS account (see more information here).

  1. To install the AWS MGN replication agent, run the following command on the source instance:
wget -O ./aws-replication-installer-init.py https://aws-application-migration-service-us-west-2.s3.amazonaws.com/latest/linux/aws-replication-installer-init.py
sudo python3 aws-replication-installer-init.py
  1. When prompted, provide AWS Region and the required temporary credentials. Then, confirm volumes to be replicated. Once you’ve entered AWS credentials, installer will identify volumes attached to the system and prompt you to choose which disks you want to replicate.

GCP AWS install replication agent

Once the agent is installed, the replication starts right away! AWS MGN will begin continuous data replication from your source GCP Compute Engine instances to the target AWS EC2 instances. Any changes made during the migration process will be synchronized to AWS.

You can monitor the progress of the replication from the MGN console by clicking on the Source server name of your server.

GCP AWS monitor replication

Initially the progress bar will show 0%, but this will grow as the data is copied from your source server into target AWS environment.

GCP AWS migration dashboard

Under Server info tab, you can review retrieved information about the source server, including the recommended machine type when it starts on AWS, which you can always override in Launch settings.

GCP AWS server info

Under Disks settings tab, you can manage staging disk settings. As per default replication settings, to save cost, AWS MGN uses Standard HDD disks for data replication for volumes smaller than 500 GiB. You can change staging disk type on this tab.

GCP AWS disk settings

Under Replication settings tab, you can manage replication settings. You can configure custom replication settings for specific system. It may be useful especially for servers that experience significant amount of changes on their disks. In such case you may want to change the Replication Server instance type to one with more bandwidth and assign a dedicated Replication Server.

GCP AWS replication settings

Under Launch settings tab, you can manage launch settings. You can configure details of how EC2 instance of replicated system should be configured in AWS, including Instance type right sizing, which is a good idea since it allows to optimize cost.

GCP AWS launch settings

Note that Every time you change an EC2 Launch Template, a new version is created. In order for AWS MGN to use the new version you created, you must mark it as Default.

Step 3: Launch a test instance

Once the replication is complete, it is crucial to test the migration of your source server(s) to AWS prior to initiating a cutover in order to verify that your source server(s) function properly within the AWS environment. You can test one source server at a time, or simultaneously test multiple source servers. For each source server, you will be informed of the success or failure of the test.

To launch a test instance:

  1. On the Source servers page, check the box to the left of the server for which you want to launch a test instance.
  2. Open the Test and cutover
  3. Under Testing, choose the Launch test instances option to launch a test instance for this server.

GCP AWS migration dashboard ready for testing

The AWS MGN console will indicate when the test has started.

GCP AWS migration dashboard test in progress

4. Select the launched Job ID to view the specific Job for the test launch in the Launch History tab.

GCP AWS launch history started

After a while, you can tell that the Test instance launch completed successfully.

GCP AWS launch history completed

After you have launched your test instances, open the Amazon EC2 Console and SSH or RDP into your test instances in order to ensure that they function correctly. Validate connectivity and perform acceptance tests for your application.

Step 4: Mark test instances as ready for cutover

If you are completely done with your testing and are ready for cutover, you can finalize the test. This will change your source servers’ Migration lifecycle status to Ready for cutover, indicating that all testing is complete and that these servers are now ready for cutover. You will also have the option to delete your Test instances for cost saving purposes.

To finalize a test:

  1. Check the box to the left of every source server that has a launched Test instance for which you want to finalize the test.
  2. Open the Test and Cutover
  3. Under Testing, choose Mark as “Ready for cutover”

GCP AWS next action launched

4. Mark X servers as Ready for cutover dialog will appear. You have the option to select whether you want to terminate the launched instances used for testing. It is recommended to terminate these instances, as you will be charged for them even though you will no longer need them.

GCP AWS ready for cutover

The AWS Application Migration Service console will confirm that the servers were marked as ready for cutover. The console will indicate that testing has been finalized. The selected source servers’ Migration lifecycle column will show the Ready for cutover status and the launched Test instances will be deleted if that option was selected.

Now, you are ready to launch the cutover instance.

Step 5: Launch a cutover

Once you have finalized the testing of all of your source servers, you are ready for cutover. You should perform the cutover at a set date and time. The cutover will migrate your source servers to the cutover instances on AWS. Plan the cutover timing carefully. Coordinate with stakeholders to minimize any potential business disruptions during the migration.

You can cutover one source server at a time, or simultaneously cutover multiple source servers. For each source server, you will be informed of the success or failure of the cutover. For each new cutover, AWS MGN first deletes any previously launched Test instance and dependent resources. Then, it launches a new cutover instance which reflects the most up-to-date state of the source server. After the cutover, data replication continues as before. The new and modified data on the source server is transferred to the Staging Area Subnet, and not to the cutover instances that were launched during the cutover. The post-launch modernization actions are triggered after launching test or cutover instances, and can provide additional value in the migration process.

To launch a cutover instance:

  1. Go to the Source servers page and check the box to the left of each server you want to cutover.
  2. Open the Test and cutover menu.
  3. Under Cutover, choose the Launch cutover instances option.

GCP AWS launch cut over

4. When the Launch cutover instances for X servers dialog appears, choose Launch to begin the cutover.
5. On the Source servers page, the Migration lifecycle column will show Cutover in progress and the Next actions column will show Finalize cutover. When the cutover starts, the Application Migration Service Console will indicate Launch job started.

GCP AWS cut over in progress

6. Click the cutover Job ID to view the specific Job for the cutover launch in the Launch history tab.

GCP AWS launch cutover started

After a while, you can tell that the launch cutover has completed successfully.

GCP AWS launch cutover completed

Step 6: Initiate cutover and finalize migration

If you are completely done with your migration and performed a successful cutover, you can finalize the cutover. This will change your source servers’ Migration lifecycle status to Cutover complete, indicating that the cutover is complete and that the migration has been performed successfully. In addition, this will stop data replication and cause all replicated data to be discarded. All AWS resources used for data replication will be terminated.

To finalize a cutover:

  1. Check the box to the left of every source server that has a launched cutover instance you want to finalize.
  2. Open the Test and cutover
  3. Under Cutover, choose Finalize cutover.

GCP AWS finalize cutover

4. The Finalize cutover for X servers dialog will appear. Choose Finalize.
5. The AWS MGN console will indicate Cutover finalized when the cutover has completed successfully.

GCP AWS cutover complete

6. The AWS MGN console will automatically stop data replication for the source servers that were cutover in order to save resource costs. The selected source servers’ Migration lifecycle column will show the Cutover complete status, the Data replication status column will show Disconnected, and the Next actions column will show Mark as archived.

The source servers have now been successfully migrated into AWS.

You can now archive your source servers that have launched cutover instances. Archiving will remove these source servers from the main Source servers page, allowing you to focus on source servers that have not yet been cutover. You will still be able to access the archived servers through filtering options.

To archive your cutover source servers:

1. Check the box to the left of the of each source server for which the Migration lifecycle column states Cutover complete.
2. Open the Actions menu and choose Mark as archived.

GCP AWS mark as archived

Cleaning up

After migrating into AWS, perform a series of clean-up steps to ensure that your environment is optimized, secure, and cost-efficient:

  • Identify and terminate any resources in Google Cloud that are no longer needed, such as the original Compute Engine instance and associated resources (e.g., disks, snapshots) if they won’t be used again.
  • Review and delete any temporary resources created during the migration in AWS, such as replication instances or target instances that are no longer needed.

Conclusion

In this blog post, I demonstrated the migration of Google Compute Engine instances to the AWS Cloud using AWS MGN. At a high level, the steps consisted of defining settings and initiating continuous data replication, performing testing by launching instances for non-disruptive tests before the cutover phase, and executing the migration by launching cutover instances on AWS. By following the steps outlined in this post, you can simplify your migration process, reduce downtime, and leverage the power of AWS to enhance your cloud infrastructure. Happy cloud computing!

To learn more, visit AWS MGN and quick start guide.

Ramy Afifi

Ramy Afifi

Ramy Afifi serves as an AWS Senior Partner Solutions Architect, specializing in the Worldwide Public Sector. His commitment lies in fostering a positive influence by leading organizations on their path to cloud adoption and transforming complex business needs into actionable solutions.