As our customers sought to migrate their Ubuntu-based virtual machines from Azure to AWS EC2 to optimize costs and improve flexibility, ensuring a seamless migration process was critical. Any downtime or data inconsistency could negatively impact their business operations. We proposed leveraging AWS cloud migration, specifically AWS Application Migration Service (MGN), to facilitate the migration of Ubuntu VMs from Azure to AWS with minimal downtime.
This blog will discuss the step-by-step process of using AWS MGN to migrate an Ubuntu Linux VM, focusing on the prerequisites and technical steps required for a successful migration.
Before starting the migration process, ensure the following:
AWSApplicationMigrationAgentInstallationPolicy, AWSApplicationMigrationAgentPolicy
If the steps outlined in this guide are not followed correctly, you may encounter an issue where the status check fails when launching the EC2 instance. This typically happens because the migrated VM is still using Azure-specific settings, such as the wrong kernel or cloud-init configuration.
When the Azure-specific kernel or services are still active, the EC2 instance may fail to boot properly in the AWS environment, resulting in a Status Check Failed error. To avoid this issue, follow the migration steps.
uname -r
sudo passwd root
sudo apt-get update
sudo apt-get install gcc-12
sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives –config gcc
sudo apt-get install linux-headers-$(uname -r)
sudo wget -O ./aws-replication-installer-init
“https://aws-application-migration-service-ap-south-1.s3.ap-south-1.amazonaws.com/latest/linux/aws-replication-installer-init”
sudo apt install linux-aws
dpkg –list | grep linux-image
sudo vim /etc/default/grub
By default GRUB_DEFAULT value will be 0. Update it with the AWS kernel.
GRUB_DEFAULT=”Advanced options for Ubuntu>Ubuntu, with Linux 6.5.0-1024-aws” (update the version based on the aws kernel version installed in the source VM)
systemctl –type=service
sudo systemctl disable hv-kvp-daemon.service
sudo systemctl disable walinuxagent.service
sudo systemctl disable walinux-agent-network-setup.service
dpkg-reconfigure cloud-init
Select the “EC2: read data from EC2 metadata service” option by clicking the space bar and unselect the azure option and press the tab and click enter
sudo chmod +x aws-replication-installer-init; sudo ./aws-replication-installer-init –region –aws-access-key-id –aws-secret-access-key –no-prompt
: Replace this with your AWS region (e.g., us-west-2, ap-south-1)
: Replace this with the IAM Access Key ID
: Replace this with the IAM Secret Access Key
By following this process, we successfully migrated the client’s Ubuntu VM from Azure to AWS using AWS cloud transformation services with minimal downtime. The AWS Linux kernel optimizes performance in the AWS environment, while our method retains the integrity of data and system configurations during the migration. This process is an essential step in legacy Cloud management services helping clients move their Azure cloud applications to AWS while ensuring cost optimization and flexibility. If you’re planning a similar migration, this guide can serve as a detailed reference to execute it smoothly.
Looking for a reliable Cloud consulting company to optimize your cloud journey? CloudifyOps offers top-tier cloud infrastructure services,delivering scalable, secure, and cost-efficient solutions. Whether you need seamless cloud migration or expert cloud management, we are here to help.
Get in touch with CloudifyOps today to unlock your cloud potential and drive innovation.
CloudifyOps Pvt Ltd, Ground Floor, Block C, DSR Techno Cube, Survey No.68, Varthur Rd, Thubarahalli, Bengaluru, Karnataka 560037
Indiqube Vantage, 3rd Phase, No.1, OMR Service Road, Santhosh Nagar, Kandhanchavadi, Perungudi, Chennai, Tamil Nadu 600096.
CloudifyOps Inc.,
200, Continental Dr Suite 401,
Newark, Delaware 19713,
United States of America
Copyright 2024 CloudifyOps. All Rights Reserved