Voiced by Amazon Polly |
Overview
In today’s cloud-driven world, businesses often need to shift workloads across cloud platforms to take advantage of better pricing, features, or performance. Migrating an Ubuntu server from Microsoft Azure to Amazon Web Services (AWS) can seem complex, but using AWS MGN (Application Migration Service) simplifies this process.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Introduction
However, there are specific considerations to be aware of—especially concerning the Azure-customized Ubuntu kernel. This blog will guide you through migrating an Ubuntu server from Azure to AWS using AWS MGN, including addressing the challenge of the Azure kernel.
Step-by-Step Guide to Migrating from Azure to AWS with AWS MGN
- Prepare Azure Environment
Before migrating, ensure that your Azure environment is properly set up.
- Access the Azure Portal and identify the Ubuntu server(s) that need to be migrated.
- Ensure you have the credentials and access rights to the Azure and AWS environments.
- Understanding the Azure Kernel Limitation
One of the key challenges when migrating Ubuntu servers from Azure to AWS is that Azure uses an Azure-tuned Ubuntu kernel, which is optimized for the Azure platform. However, this kernel is not supported on AWS, meaning you must replace it with a standard Ubuntu kernel before the migration.
Steps to Replace the Azure Kernel:
- Check the Current Kernel: Log in to your Azure Ubuntu server and check the current kernel version.
1 |
uname -r |
If the output contains “azure,” you use the Azure-tuned kernel.
- Install the Generic Ubuntu Kernel: You must install the generic Ubuntu kernel compatible with AWS.
1 2 |
sudo apt update sudo apt install linux-image-generic |
- Update GRUB: Once the new kernel is installed, you must update the GRUB bootloader to make the generic kernel the default.
1 |
sudo update-grub |
- Reboot the Server: Reboot the server to apply the changes.
1 |
sudo reboot |
- Verify the Kernel: After rebooting, verify that the server is now using the generic kernel by running:
1 |
uname -r |
The output should no longer include “azure.” You are now using a standard Ubuntu kernel compatible with AWS.
- Set Up AWS MGN
- Log in to AWS Console: Navigate to the AWS Management Console and search for Application Migration Service (MGN).
- Create Source Servers:
- In AWS MGN, go to Source Servers and click on Add Source Server.
- You will be prompted to install the AWS MGN agent on your source server.
- Install AWS MGN Agent on Ubuntu in Azure
You must install the AWS MGN agent on your Ubuntu server hosted in Azure to enable migration.
- Connect to your Ubuntu server via SSH using Azure Portal or an SSH client.
1 |
ssh azureuser@<server-ip> |
- Download and install the AWS MGN agent by running the following commands:
1 2 |
wget https://aws-elastic-disaster-recovery-agent.s3.amazonaws.com/latest/install_linux_agent.sh sudo install_linux_agent.sh --region <aws-region> |
Replace <aws-region> with your specific AWS region (e.g., us-west-2).
- Once installed, the agent will automatically register the server in your AWS MGN console.
- Configure AWS MGN Settings
- Replication Settings: In AWS MGN, go to Source Servers, and you should see your Ubuntu server listed.
- Click on the server and configure the Replication Settings, where you can specify:
- Data Transfer Speed
- Disk and Network settings
- Tags and encryption options
- Click on the server and configure the Replication Settings, where you can specify:
- AWS MGN will now start the continuous replication process in the background. Depending on the size of your server, the initial replication may take some time.
- Launch Test Instance in AWS
Once replication is complete, it’s recommended to launch a test instance to ensure everything is functioning as expected before performing the actual cutover.
- In the AWS MGN console, select the source server and choose Launch Test Instance.
- Review the instance details, such as instance type and network settings, to match your requirements.
AWS will then create a new Amazon EC2 instance based on the replicated data from the Azure server.
- Connect to the Amazon EC2 instance to verify that it runs correctly.
1 |
ssh ec2-user@<ec2-instance-ip> |
- Check for any discrepancies in the system and resolve any issues.
- Perform Cutover to AWS
Once you’ve confirmed the test instance works correctly, you can perform the cutover, permanently moving the workload to AWS.
- In the AWS MGN console, select the source server and choose Launch Cutover Instance.
- Confirm the instance configurations and launch the cutover instance. This instance will be your production server in AWS.
The original server in Azure will remain unaffected until you decide to decommission it. You can now point your users and applications to the new AWS environment.
Post-Migration Steps
- Validate Application: Test your application thoroughly on the AWS instance to ensure everything functions as expected.
- Data Consistency: Verify that all the data on AWS is intact and up-to-date.
- Decommission Azure Resources: Once the migration is complete, you can safely decommission the Azure resources to avoid incurring unnecessary costs.
Key Considerations
- Azure Kernel Replacement: Remember to switch from the Azure-tuned Ubuntu kernel to the generic Ubuntu kernel, as the Azure-specific kernel is not supported on AWS.
- Network Configuration: Ensure your Amazon VPC and security groups are properly configured to allow the necessary traffic.
- Downtime: Minimize downtime by conducting thorough testing before cutover. MGN allows continuous data replication, ensuring the final cutover is quick and smooth.
- Costs: Monitor Azure and AWS billing to manage the costs during the migration. AWS MGN is free for 90 days per server, but be aware of charges for running instances.
Conclusion
Migrating an Ubuntu server from Azure to AWS using AWS MGN offers a seamless and automated way to transition workloads. By following the steps outlined in this blog, you can reduce downtime, ensure data consistency, and easily shift your cloud infrastructure from Azure to AWS.
With AWS MGN, you can not only migrate but also continually optimize and scale your applications on AWS, setting the stage for a more agile and cost-effective cloud environment.
Drop a query if you have any questions regarding AWS MGN and we will get back to you quickly.
Making IT Networks Enterprise-ready – Cloud Management Services
- Accelerated cloud migration
- End-to-end view of the cloud environment
About CloudThat
CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.
FAQs
1. Is AWS MGN free to use for migrations?
ANS: – AWS MGN is free for the first 90 days per server. After that, you will incur running instances and other AWS service charges. Monitoring both Azure and AWS billing during the migration process is recommended.
2. What happens to my original Azure server after migration?
ANS: – The original Azure server remains unaffected by the migration. Once the cutover to AWS is successful, you can decommission the Azure server to avoid extra costs.

WRITTEN BY Aniket Kumar Ambasta
Aniket Ambasta works as a Subject Matter Expert at CloudThat. He is an AWS Solutions Architect – Associate certified professional, skilled in cloud migration, infrastructure, security, and cloud FinOps. Apart from his professional interests, he loves exploring and learning new technologies.
Comments