Working with EC2 launch templates - Application Migration Service

Working with EC2 launch templates

Selecting the default template

Application Migration Service uses the version of the Launch template that is marked as default.

In order to select the default launch template, on the Modify template (Create new version) page, under the Launch template name and version description category, open the Source template menu and choose the EC2 launch template you want to use as the default template from the dropdown menu.

Every time you modify the Launch template, a new version of the launch template is created. You will be notified that the Launch template has been modified and that a new version (version number) has been created. Make sure to take note of the version number and the Launch template ID so that you could easily identify your launch template and version.

Note

It's a good practice to delete versions of the Launch template that you no longer need.

To set the new version fo your launch template as the default, navigate back to the main EC2 > Launch Templates page. Choose your launch template by selecting the toggle to the left of the Launch template ID. Open the Actions menu and choose Set default version.

Select the Template version from the drop-down menu and then choose Set as default version.

The EC2 Console will confirm the version change.

Launch template cleanup and fixing

Application Migration Service runs a mechanism every hour to ensure that the settings selected are correct. This mechanism can fix issues such as an incorrect instance type, but it cannot fix other settings and augmentations. Ensure that you follow the instructions in the following sections and do not change or edit any fields that should not be changed.

If you encounter any issues with the launch template, you can negate all of your changes and fix all issues rapidly by choosing the original default launch template that was first automatically created by Application Migration Service upon Agent installation.

Launch template key considerations

There are several key considerations when configuring your EC2 launch template. Review these key considerations as well as the full launch settings before creating your launch template.

  1. Instance Type - Ensure that you select an instance type that matches the hardware requirements of your source server. Application Migration Service always utilizes the instance type that is set on the EC2 launch template unless the Instance right-sizing feature is enabled.

    Note

    If you change your instance type and do not disable to the Instance right-sizing feature, then Application Migration Service will use the instance type determined by the Instance Right-Sizing feature and not the instance type you chose in the EC2 launch template. Application Migration Service verifies the instance type once per hour, as a result, if you did not disable the Instance right-sizing feature, the first time instance launch may still utilize the instance type you set in the EC2 launch template, but any subsequent launches will utilize the right-sizing instance.

  2. Subnet - You can select an existing Subnet or create a new subnet.

    Note

    Customers that do not have a default VPC must modify the EC2 Launch Template and explicitly define the subnet in which to launch. Failure to do so will result in errors when launching Test or Cutover instances.

  3. Private IP - If you enable the Copy Private IP feature, then do not add your own IP to the EC2 launch template.

  4. Private IP and Subnet- Each subnet contains a CIDR block of IP ranges. If you enable the Copy Private IP feature, then ensure that this IP is included in the CIDR block range. Otherwise, instance launch will fail.

  5. Private IP and ENI - Ensure that you disable the Copy Private IP feature if you wish to define an ENI to use on the EC2 launch template.

  6. Network interfaces - The EC2 launch template only supports two network interfaces. If you require more than two network interfaces, you will need to define them after the Test or Cutover instance has been launched. This can be done through a postboot script.

    If you wish to use an Elastic IP, you must create an ENI to specify the IP and then edit the Network interfaces to use the ENI. Learn more about working with Amazon Elastic Inference in this Developer Guide article.

  7. Networking platform - Application Migration Service only supports Virtual PRivate Cloud (VPC). EC2-Classic is NOT supported. Do NOT add any Security groups under the network platform.

  8. Custom device name - Do not alter this field. Application Migration Service uses the device name as defined on the source server in order to map disks on the test or cutover instance. You can use this field to identify your disks.

  9. Disks - You cannot add disks to the EC2 launch template. Any disks that are added that do not exist on the source machine will be ignored by Application Migration Service.

  10. Launch template name - Do not alter this field. Application Migration Service automatically names this field.

  11. System tag - Do not alter this field. Application Migration Service automatically adds system tags that match the EC2 launch template to the specific source server. You can recognize which source server the launch template is matched with by the ID field.

  12. Automatic cleanup - Application Migration Service deletes the EC2 launch template and launch configuration for machines that have been disconnected from Application Migration Service or machines for which the Cutover has been finalized 90 minutes after disconnect or cutover finalization. This aids in ensuring that your account does not surpass the AWS 5000 EC2 launch template limit.

  13. Volumes - Do not remove a volume from the EC2 launch template. If you remove a volume, MGN will launch the instance with the default values for the volume.

    Note

    If you wish to set a KMS key, you should do so through the EBS Encryption section of the Replication Settings within the Application Migration Service Console.

Full launch template setting review

This section reviews the entire EC2 launch template and identifies which fields should and should not be changed in order for the EC2 launch template to work with Application Migration Service. Editing or changing any fields that are marked as "do not edit" or "do not change" can cause Application Migration Service to not function.

  • Launch template name - This name is automatically generated when the template is first created upon Agent installation. The name cannot be changed.

  • Template version description - You can give the template any description you wish.

  • AMI - Customers do not typically choose a specific AMI to include in the launch template. If you edit the launch template to use an existing AMI, the contents of the AMI will not be used by Application Migration Service. If the AMI is not configured properly (licensing, flags, etc), then this may prevent the Test or Cutover instance launched from booting correctly or from being properly licensed.

  • Instance type - You can select any instance type you want. The launch template will show the instance type suggested by Application Migration Service.

  • Key pair (login) - Do NOT alter this field. Do not include a key pair with the launch template.

  • Networking platform - Ensure that you select Virtual Private Cloud (VPC). EC2-Classic is NOT supported.

  • Security groups - Do NOT add Security group here. This field should remain blank. You can add security groups later under Network interface.

  • Storage (volumes) - This section will show all of the disks that you chose to replicate from your source server upon AWS Replication Agent installation. Each disk is composed of the following fields:

    • Volume type - Shows the default volume type (EBS). This cannot be changed.

    • Device name - Do NOT change or edit this field. The device name shown here corresponds to the disk name on the source server. This field allows you to identify which disk is which.

    • Snapshot - Do NOT change or edit this field. Snapshots should not be included in the launch template.

    • Size - Do NOT change or edit this field.

    • Volume type - You can select any volume type you want to use. Application Migration Service automatically sets Provisioned IOPS SSD (io1) as the default. We recommend not changing the volume type for test instances, as the io1 volume ensures that tests are performed as quickly as possible. You may want to change the volume type for cutover in order to reduce costs. Ensure that you read the caveats in the EBS documentation.

    • IOPS - Set the number of I/O operations per second that the volume can support. You can select any number as long as it matches the guidelines. For Provisioned IOPS SSD volumes, you can provision up to 50 IOPS per GiB for io1, and 500 IOPS per Gib for io2. For General Purpose SSD volumes, baseline performance is 3 IOPS per GiB, with a minimum of 100 IOPS and a maximum of 16000 IOPS. General purpose SSD volumes under 1000 GiB can burst up to 3000 IOPS.

    • Delete on termination - Do NOT change or edit this field. This should not be included in the launch template.

    • Encrypted - Do NOT change or edit this field. This should not be included in the launch template.

    • Key - Do NOT change or edit this field. This should not be included in the launch template.

    • Add volume - Do NOT use this functionality. You cannot add volumes to the source server through the launch template.

    • Remove (volume) - Do NOT use this functionality. You cannot remove volumes from the source server through the launch template. If you do, MGN will automatically create a volume using the default volume settings.

  • Resource tags - You can add up to 50 tags. These will be transferred to your test and cutover instances. Note that these tags may interfere with other tags that have already been added to the source server. Launch template tags always take precedence over tags set in the MGN Console or tags manually assigned to the server.

  • Network interfaces - The network interface is created by default based on your Replication Settings Template. The network interface section is composed of the following fields:

    • Device index - Do NOT change or edit this field. The value should alwasys be "0".

    • Network interface - Use this option only if you want use a pre-existing ENI (Elastic Network Interface). The Launch Template will overwrite certain ENI settings. Use this if you want to add an Elastic IP. You will have to attach the Elastic IP to the ENI.

    • Description - Add an optional description for the network interface (if chosen).

    • Subnet - Choose the subnet. This is the subnet within which the network interface is located and the Test or Cutover instance will be launched. Application Migration Service selects the default VPC subnet by default (if one exists).

    • Auto-assign public IP - Choose whether you want the public IP to be auto-assigned.

    • Primary IP - Use this field if you wish to utilize a Private IP. The Private IP you set in the Copy private IP field in the MGN Launch Settings will be copied to this field.

    • Secondary IP - Define a secondary IP, if needed.

    • IPv6 IPs - Define IPv6 IPs, if needed.

    • Security groups - Choose a security group. If no security group is chosen, then the default VPC security group will be used by default.

    • Delete on termination - We suggest choosing "Yes". Choosing "No" will make this network interface a permanent ENI, which will accrue additional costs if not connected to a running instance.

    • Elastic Fabric Adapter - Do NOT change or edit this field.

    • Network card index - Do NOT change or edit this field.

    • Add network interface - Note that the EC2 launch template only supports two network interfaces. If you require more than two network interfaces, you will need to define them after the Test or Cutover instance has been launched. This can be done through a postboot script.

  • Advanced details - In this section, we will focus on the fields you should NOT change or edit in order to Application Migration Service to function properly. Do NOT change or edit any of the following fields:

    • RAM disk ID

    • Kernel

    • Nitro Enclave

    • Metadata accessible

Saving your EC2 launch template

Once you have finished editing your template, save it by choosing Create template version at the bottom of the template.