Hands-on: AWS Virtual Machine Migration Lab


  • Learn how to migrate on-premises virtual machines to AWS while meeting specific company requirements.


  • Basic knowledge of AWS and virtualization concepts.
  • AWS CLI installed on students’ computers.
  • Access to AWS accounts.

Lab Steps:

Step 1: Setup On-Premises Environment (Instructor’s Role)

  • Before the lab session, set up a simulated on-premises environment with a virtual machine for the instructor to use for demonstration purposes.

Step 2: Introduction (Instructor)

  • Begin the lab by introducing the scenario and explaining the company requirements.

Step 3: Create AWS MGN Replication Configuration (Students)

  • Instruct students to use the AWS CLI to create a replication configuration to replicate the virtual machine from the on-premises data center. Provide them with sample on-premises server information (server ID and timestamp) to use in the command.

Step 4: Install AWS MGN Replication Agent (Instructor’s Role)

  • Explain the concept of the replication agent and its installation process. For the lab’s sake, demonstrate how to install the agent on the instructor’s machine.

Step 5: Launch AWS EC2 Instances (Students)

  • Instruct students to use the AWS CLI to create EC2 instances based on the replicated virtual machine. They should create the instances in AWS, specifying instance type, subnet, and key pair.

Step 6: Testing (Students)

  • After launching the EC2 instances, students should test the environment to ensure that everything works as expected. This can include testing the web application or services running on the migrated VMs.

Step 7: Cutover (Instructor)

  • Explain the concept of cutover and the importance of successful testing. For the lab’s sake, demonstrate how to perform the cutover on the instructor’s machine.

Step 8: Wrap-up and Q&A (Instructor)

  • Conclude the lab session by summarizing the key points, emphasizing the importance of meeting company requirements, and addressing any questions or concerns the students may have.

Lab Evaluation:

  • Students can be evaluated based on their ability to complete each step successfully.
  • Encourage students to ask questions and discuss their experiences during the lab.

Additional Notes:

  • Provide students with documentation or a lab manual that includes the necessary AWS CLI commands and explanations.
  • Create AWS IAM roles and permissions to allow students to perform the necessary AWS CLI commands safely.
  • It’s important to note that AWS services and interfaces may change over time, so ensure that the lab materials are up to date with the latest AWS CLI commands and practices.

The first setup step for Application Migration Service is creating the Replication Settings template. Add source servers to Application Migration Service by installing the AWS Replication Agent (also referred to as “the Agent”) on them. The Agent can be installed on both Linux and Windows servers. After you have added all of your source servers and configured their launch settings, you are ready to launch a Test instance. Once you have finalized the testing of all of your source servers, you are ready for cutover. The cutover will migrate your source servers to the Cutover instances on AWS.

The recommended solution for meeting the company’s requirements involves using AWS Application Migration Service (AWS MGN) to migrate virtual machines to AWS. Here’s how you can implement this solution using the AWS CLI, along with an explanation of the parameters:

  1. Create a Job on AWS Application Migration Service (AWS MGN):
    First, you need to create a migration job on AWS MGN to import virtual machines from your on-premises data center to AWS. You can use the create-replication-configuration command to define your replication configuration. Here are the steps with AWS CLI commands:
   aws mgn create-replication-configuration \
     --server-id <On-Premises-Server-ID> \
     --seed-replication-time <Timestamp>
  • <On-Premises-Server-ID>: The ID of the on-premises server you want to replicate.
  • <Timestamp>: The timestamp at which you want to start replicating changes.
  1. Install the Replication Agent on Each Application Tier:
    You’ll need to install the AWS MGN replication agent on each application tier server in your on-premises environment. The agent facilitates the synchronization of changes. There is no specific AWS CLI command for this step, as the installation process may vary depending on your specific on-premises setup.
  2. Launch Amazon EC2 Instances based on Replicated VM from AWS MGN:
    Once the replication is set up, you can launch Amazon EC2 instances in AWS based on the replicated VMs. Use the create-replication-job command to start the replication job:
   aws mgn create-replication-job \
     --replication-configuration-id <Replication-Config-ID> \
     --server-id <On-Premises-Server-ID> \
     --seed-replication-time <Timestamp>
  • <Replication-Config-ID>: The ID of the replication configuration you created earlier.
  • <On-Premises-Server-ID>: The ID of the on-premises server you want to replicate.
  • <Timestamp>: The timestamp at which you want to start replicating changes.
  1. Perform Testing and Cutover:
    After the replication job is completed and you have verified the newly created EC2 instances, you can proceed with testing. AWS MGN provides tools for testing and cutover. When you’re ready for cutover, use the AWS CLI to create new EC2 instances based on the updated Amazon Machine Images (AMIs) from the replicated VMs:
   aws ec2 run-instances \
     --image-id <Updated-AMI-ID> \
     --instance-type <Instance-Type> \
     --subnet-id <Subnet-ID> \
     --key-name <Key-Pair-Name>
  • <Updated-AMI-ID>: The ID of the updated AMI.
  • <Instance-Type>: The desired EC2 instance type.
  • <Subnet-ID>: The ID of the AWS VPC subnet.
  • <Key-Pair-Name>: The name of the SSH key pair for authentication.

By following these steps and using the AWS CLI commands, you can migrate your virtual machines to AWS while meeting the company’s requirements for minimal downtime, data migration, and minimal operational overhead. The AWS Migration Hub and MGN provide monitoring and management capabilities to help ensure a smooth migration process.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top