Working with EC2 launch templates - Application Migration Service

Working with EC2 launch templates

Selecting the default template

AWS MGN 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 drop-down 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 good practice to delete versions of the launch template that you no longer need.

To set the new version of your launch template as the default:

  1. Navigate back to the main EC2 > Launch templates page.

  2. Choose your launch template by selecting the toggle to the left of the Launch template ID.

  3. Open the Actions menu and choose Set default version.

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

The Amazon EC2 console will confirm the version change.

Launch template cleanup and fixing

AWS Application Migration Service (AWS MGN) 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. AWS Application Migration Service always utilizes the instance type that is set on the Amazon EC2 launch template unless the Instance right-sizing feature is activated.

    Note

    If you change your instance type and do not deactivate the instance right-sizing feature, then AWS 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 deactivate 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 use 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 use 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 – Make sure that you deactivate 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 post launch action.

    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 – AWS 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. AWS 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 AWS Application Migration Service.

  10. Launch template name – Do not alter this field. AWS 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 AWS 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 – For each EBS volume, the service uses the user-selected values. If no matching volume exists in the launch template, the service will the default value. If the launch template includes a volume that does not exist in the source server, the system will disregard the specific volume.

    If you delete the EC2 launch template, the service will create a new one with default values.

    Note

    If you wish to set a KMS key, you should do so through the EBS Encryption section of the replication settings within the AWS 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 AWS 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 AWS Application Migration Service. If the AMI is not configured properly (licensing, flags, and more), 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 AWS Application Migration Service.

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

  • Networking platform – Be sure to select Virtual Private Cloud (VPC). EC2-Classic is not supported.

  • Security groupsDo 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.

    Important

    Initial settings for EBS volumes are not derived from activity on the Source Server. Default values are chosen to give maximum performance on first launch.

    Each disk is composed of the following fields:

    • Storage type – Shows the default volume type (EBS). This cannot be changed.

    • Device nameDo 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.

    • SnapshotDo not change or edit this field. Snapshots should not be included in the launch template.

    • SizeDo not change or edit this field.

    • Volume type – You can select any volume type you want to use. AWS Application Migration Service automatically sets General Purpose SSD (gp3) as the default. You may want to change the volume type 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 EBS guidelines.

      • Provisioned IOPS SSD (io1) : 50 IOPS per GiB of storage

      • Provisioned IOPS SSD (io2) : 500 IOPS per GiB of storage

      • General Purpose SSD (gp3) : 500 IOPS per GiB of storage

      AWS Application Migration Service automatically provisions the maximum IOPS possible for the volume, based on the above ratio. This is to minimize the impact of the performance penalty when working with EBS volumes created from snapshots.

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

    • EncryptedDo not change or edit this field. This should not be included in the launch template.

    • KeyDo not change or edit this field. This should not be included in the launch template.

    • Add volumeDo 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, AWS 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 AWS MGN console or tags manually assigned to the server.

  • Network interfaces – The network interface is created by default based on your replication template. The network interface section is composed of the following fields:

    • Device indexDo not change or edit this field. The value should always 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.

      Note

      When selecting an pre-existing ENI, you must change the Auto-assign public IP value to Don't include in launch template for a successful target launch.

    • 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. AWS 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 AWS 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.

    • Elastic Fabric AdapterDo not change or edit this field.

    • Network card indexDo 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 post-launch action.

  • Advanced details – In this section, we will focus on the fields you should not change or edit in order to allow AWS 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.