Migrate from AWS to Google Cloud

Migrate from AWS to Google Cloud

Introduction

As more and more organizations adopt cloud computing as a solution for their IT infrastructure needs, it's becoming increasingly common for companies to switch between cloud providers as their requirements and priorities change. In particular, moving virtual machines from one cloud platform to another can offer significant benefits in terms of cost savings, performance improvements, and flexibility. In this article, we'll take a closer look at the process of migrating virtual machines from AWS to GCP, including the challenges involved and the best practices to follow

Setup

For this project, I migrated an ec2 instance that had already been created from AWS to google cloud.

The first step was to identify the Public IPv4 address of the instance, this can be gotten from the AWS console under EC2 instances

The next step was to prepare the instance for migration, I did this by SSHing into the instance and installing apache 2

This next part happen in the Google cloud console. I created an aws source in google cloud, and I did this by navigating from the google cloud console moving clicking on compute Engine then Migrate to Virtual Machines, selecting the source tab and "Add AWS Source" the entering the information in the space provided and click create(this might take a few minutes). after that, a table appeared showing the EC2 instances from the AWS console.

Groups

Groups are best for performing bulk migration tasks on multiple VMs simultaneously, they make it easier to perform migration in batches.

The next step in the process is creating a group for the VMs, This part is fairly simple all you have to do is to select the machines to migrate and click add to a group

Replication

The first phase of migration is to start replicating the disk data from the source VMs to Google Cloud. This is a continuous process that takes place in the background. This process happens in 2 parts First replication creates the initial snapshot of the source VM data disks and replicates the snapshot data to Google Cloud. and Incremental replication which occurs at set time intervals (every two hours by default) but only data updates that occur after the first replication are replicated this time using the Change Block Tracking(CBT) mechanism.

Next I did the actual migration. I did this by navigating to the group i created selecting the virtual machines i would like to migrate and selecting "Start replication"

Testing

You can test if the migration was successful in the test-clone phase. this is where you deploy a clone of a migrated VM to a Compute Engine instance in your testing environment. Before you can start this phase you must have a valid target environment and be in the Active (Current cycle: XX%) or Active (Idle) state.

The first step would be configuring a target and filling out the necessary information

and then go back to the group selecting Test-Clone

The next step is cut -over; here you transfer control to your migrated VMs running in a Compute Engine instance in your production environment on Google Cloud. this Phase includes a short VM downtime and should take place during a scheduled maintenance window during which you can stop the source AWS EC2 instance and redirect the traffic to the VM running on Google Cloud

Finalizing

The replication data used to create a Compute Engine VM is retained after cut-over. You can use that data to create additional instances of your migrated VM after the cut-over. Finalizing deletes all replication data and any other storage resources associated with a migrated VM.

This can be done by selecting the group and selecting finalize replication on the menu

Conclusion

Migrating virtual machines from AWS to GCP can be a complex process that requires careful planning and execution. However, by following best practices and using the appropriate tools and services, organizations can achieve significant benefits such as cost savings, improved performance, and greater flexibility.

Throughout this project, I have learned about the steps involved in migrating an EC2 instance from AWS to GCP, including identifying the instance's public IPv4 address, preparing the instance for migration, creating an AWS source in Google Cloud, creating a group for the VMs, replicating the disk data, testing the migration, and finalizing the replication.

I also learned the importance of having a target environment and being in an active or idle state before starting the test-clone and cutover phases. It is essential to plan the migration during a scheduled maintenance window to minimize VM downtime and redirect traffic to the VM running on Google Cloud.

Overall, this project has helped me to develop a deeper understanding of cloud migration and the challenges involved. It has also shown me the importance of careful planning, attention to detail, and following best practices when migrating virtual machines from one cloud provider to another.