Cloud migration is no longer a trend, it’s a necessity. As businesses strive to reduce costs, increase agility, and improve performance, moving workloads to the cloud becomes a natural step. One of the most common migration needs is lifting and shifting virtual machines from on-premise environments (like VMware or Hyper-V) into Amazon Web Services (AWS).
That’s where VM Import/Export comes into the picture, a major feature that helps migrate existing VMs into Amazon EC2 instances.
In this article, let’s see :
- What is Migration ? Why Migrate to Cloud,
- Migration Strategies: The 6 R's
- What Is VM Import Export?
- Common Uses for VM Import Export
- How VM Import Export Works
What is Migration?
The process of transferring or moving data, applications, workloads, from On-Premise to Cloud e.g.;(AWS, Azure, GCP, etc) called migration.
Why Migrate to cloud?
There are many reasons why from startups to global enterprises are migrating to the cloud and few of them are :
Scalability On Demand - In the cloud, you can scale your resources up or down instantly based on your workload. No need to buy new servers or overprovision. You only pay for what you use.
Cost Savings - Running and maintaining physical infrastructure is expensive. Cloud platforms reduce costs by offering a pay-as-you-go model to save cost on Hardware, Power and cooling, Physical space, Maintenance.
Security and Compliance - Cloud providers invest heavily in top-notch security features, encryption, and compliance certifications (like ISO, HIPAA, GDPR). Most businesses find that cloud security exceeds what they can manage on-prem.
Global Accessibility - The cloud allows access data and applications from anywhere in the world and perfect for remote work, international teams, or customer-facing platforms.
Faster Innovation - Cloud platforms offer ready-to-use services like: Machine learning, Analytics, DevOps tools, Databases and storage and this helps businesses innovate faster without reinventing the wheel.
Disaster Recovery and Business Continuity - If local data center goes down due to fire, flood, or cyberattack, cloud backups ensure that the systems can quickly bounce back. No more “single point of failure.”
Focus on What Matters - With cloud, stop worrying about hardware upgrades, patches, and power failures only focus more on strategy, innovation, and user experience.
Migration Strategies: The 6 R's
When organizations decided to move to the cloud, not every application or system is treated the same way. That's where the 6 R’s of cloud migration comes in, they are six proven strategies to help businesses choose the best approach for each workload.
1. Rehosting : Lift and Shift- refers to moving your application without making any changes to them. Whatever application running on your on-prem environment, just move an exact copy of your applications to the cloud, and you can always start optimizing your applications once it is migrated to the cloud.
One example is using AWS VM Import and Export feature, which helps to migrate the applications running on your Virtual Machine from your on-premises environment to AWS cloud.
2. Re-platform : Lift, Tinker and Shift - here no need to change the core architecture of your application however make few optimizations (like upgrading the OS or using managed services) but don’t change the core app architecture
For example: You reduce the amount of time you spend managing a database instance by migrating to the database as a service platform like Amazon RDS or you may choose to migrate your application to a fully managed platform like AWS Elastic Beanstalk.
3. Re-purchase : Drop and Shop - if you decided to move to a newer version or a different solution and you are planning to move from current licensing model to software as a service model then it would be categorize into Re-Purchase strategy. In nutshell, replace your existing software with a cloud-native version, often SaaS.
For example - Switching from on-prem Microsoft Exchange to Microsoft 365 or Google Workspace or want to move from a customer relationship management a CRM tool to salesforce or want to move from an HR system like HRMS to Workday system.
4. Re-factor OR Re-architect : Redesigned Cloud Native - This strategy tends to be the most expensive and also need a lot of planning but it can also be the most beneficial. Here you start looking at a cloud native features that are beneficial to your application and you start to redesign or re-architect the entire application. In nutshell, completely redesign your application to take full advantage of cloud features like microservices, auto-scaling, or serverless.
For example - Rebuilding a monolithic app as microservices on AWS Lambda and API Gateway.
5. Retain : Revisit - Do nothing for now, but you may want to revisit this at a later point of time. You may have some applications that you want to keep them on-promises for now due to some dependency like; you recently upgraded your applications to a newer version and you don't want to migrate them immediately or may have some application that are critical for the business and require major refactoring before they can be migrated to the cloud. In either case you can revisit these application that fall into this category at a later point of time.
For example - Keeping your mainframe system, license-based software or dependent mission critical server on-prem for a few more years.
6. Retire : Decommission applications or get rid of these application. Once you have completed discovery for your environment speak to the concern application owners and if they really need these application to be running or not ? if the applications are no longer required, decommission such application. This also helps to reduce the number of applications you want to migrate to the cloud and with the cost saving.
For example - Disabling an internal tool that is no longer used since its function is replaced by another app.
When to use "The Right Strategy"
What is VM Import/Export?
VM Import Export enables you to import virtual machine images (OVA, VMDK, VHD, or RAW formats) from your existing Virtualization Environment to Amazon EC2 as Amazon Machine Images (AMIs). And also to export your Amazon EC2 instance AMI back to your On-premises environment.
You can import Windows as well as Linux virtual machine hosted in VMware ESXi, VMware workstation, Microsoft Hyper-V and Citrix Xen virtualization formats.
VM import will convert your Virtual Machine into Amazon EC2 AMI which you can use to run your Amazon EC2 instances in case if you want to launch EC2 Instances in a different region you can always copy the EMI that you have created from your virtual machine images to that particular region and you can launch your EC2 Instance in a different region.
For large VM infrastructure, AWS recommend to use Server Migration Services (SMS) because AWS Server Migration Service automates the import process by reducing the workload of migrating the larger VM infrastructure. It also has a feature of replication that you can set up between your On-Prem Environment and AWS Cloud
Whether you are planning to permanently migrate or need a hybrid setup, this tool offers flexibility and control over your workloads.
Common use cases, or the benefits of using VM Import and Export
- Migrate your existing Applications and Workloads to AWS EC2
- Import your VM Image Catalog to AWS EC2
- Create a Disaster Recovery Repository for your VM images. (You can import your local VM images into Amazon EC2 for backup and disaster recovery purposes If on-premises environment suffers any kind of failure, you can quickly launch your EC2 instances on AWS from that AMI's you created during VM Import and export and at the same time you can also start exporting the AMI to rebuild your On-Premises infrastructure)
- AWS CLI installed and configured - How to install and configure AWS CLI
- A VM image in OVA VMDK, VHD, or RAW format
- An S3 bucket to upload the disk image - How to create S3 Bucket
- IAM permissions for "vmimport" role
- A proper container file (JSON) describing the import task
Setup:
Step by Step process to Import a VM into AWS
(Use AWS CLI or CloudShell to run these commands)
aws s3 mb s3://your-vm-import-bucket
aws s3 cp my-vm.vmdk s3://your-vm-import-bucket/
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Service": "vmie.amazonaws.com" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": { "sts:ExternalId": "vmimport" }
}
}]
}
{
"Description": "My On-Prem VM",
"Format": "vmdk",
"UserBucket": {
"S3Bucket": "your-vm-import-bucket",
"S3Key": "my-vm.vmdk"
}
}
Step 5: Start the Import Task- Run following command in one line to start the VM import
aws ec2 import-image --description "My VM" --disk-containers file://containers.json
You will receive a task ID, which you can track using following command.
aws ec2 describe-import-image-tasks --import-task-ids import-ami-abc123
Once complete, you will get an AMI ID, which you can use to launch EC2 instances.
How about Exporting VMs ?
aws ec2 create-instance-export-task \ --instance-id i-1234567890abcdef0 \ --target-environment vmware \ --export-to-s3-task DiskImageFormat=vmdk,ContainerFormat=ova,S3Bucket=my-export-bucket,S3Prefix=exports/