

# Configuring launch settings in AWS Elastic Disaster Recovery
<a name="launching-target-servers"></a>

Launch settings determine how your drill and recovery instances are launched in AWS. They are composed of DRS launch settings and EC2 launch template, allowing you to fully customize your drill and recovery instances by configuring key metrics, such as the subnet within which the instance will be launched, the instance type to be used, license transfers, replication status, and a variety of other settings. AWS Elastic Disaster Recovery ensures that your drill and recovery instances constantly abide by the latest AWS security, instance, and other updates by utilizing EC2 launch templates. EC2 launch templates always use the latest EC2 instance and technology. EC2 launch templates integrate with AWS Elastic Disaster Recovery in order to give you full control over every single setting within your drill and recovery instance.

## Preparing for drill and recovery instance launch
<a name="launch-preparation"></a>

Prior to launching your instances, make sure that your environment is set up properly to ensure successful launches. Check the following prior to continuing: 
+ Prepare your subnets for launch – Plan which subnets you will use to launch your drill and recovery instances. You will use these subnets in your EC2 launch template when you configure launch settings. 
+ Create security groups within the subnets – Create the security groups you want to use within your prepared subnets. You will set these security groups in your EC2 launch template when you configure launch settings. 

**Note**  
If you want to run a proof of concept, you can skip this step. AWS Elastic Disaster Recovery will automatically use the default subnet and security groups. Ensure that you have not deleted your default subnet. 

**Important**  
When launching a drill, recovery, or an in-AWS failback, you can launch up to 100 source servers in a single operation. Additional source servers can be launched in subsequent operations.

## Launch settings
<a name="launch-settings"></a>

Launch settings are a set of instructions that are comprised of two sections: DRS launch settings and the EC2 launch template, that determine how a drill or recovery instance is launched for each source server in AWS. 

Launch settings, including the EC2 launch template, are automatically created each time you add a source server to AWS Elastic Disaster Recovery. 



You can modify the launch settings at any time, including before the source server has completed its initial sync. 

**Note**  
Any changes made to the launch settings only affect newly launched drill and recovery instances.
For many customers, there is no need to modify the DRS launch settings or the EC2 launch template in order to launch drill or recovery instances. 

You can change launch settings for a single server or for multiple servers in the AWS DRS console. This allows you to make changes to multiple servers at once. You can also modify launch settings for multiple servers via the AWS Elastic Disaster Recovery API.

To access the launch settings of a specific source server, go to the **Source servers** page and click the server's hostname. In the individual server view navigate to the **Launch settings** tab. 

You can also access the launch settings of a single server by selecting a single source server on the **Source servers** page and choosing **Actions > Edit DRS launch settings** or **Actions > Edit EC2 launch template**.



The **Launch settings** tab is divided into two sections:
+ DRS launch settings
+ EC2 launch template

Learn more about Amazon EC2 launch templates in [Amazon EC2 User Guide](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html).

# DRS launch settings
<a name="launch-general-settings"></a>

The **DRS launch settings** section allows you to control server-specific settings. 

To edit these settings for a single server, take the following steps: 

1. Go to the **Source servers** page.

1. Select a source server to update.

1. Under the **Actions** menu, select **Edit DRS launch settings** and you will be navigated to the **Edit DRS launch template** page within the AWS DRS console.

1. Change the settings according to your preferences.

1. Click **Save settings**.

Alternatively:
+ Go to the **Source servers** page.
+ Select a specific source server.
+ Go to the **Launch settings** tab.
+ Click **Edit** in the DRS launch settings section.

## DRS launch settings parameters
<a name="server-launch-settings-parameters"></a>

The DRS launch settings include the following parameters:
+  **Instance type right-sizing –** choose whether to allow AWS Elastic Disaster Recovery to launch a drill, recovery, or failback instance type that best matches the hardware configuration of the source server. If you activate this feature, any modification you make to the instance type in the EC2 launch template will be overwritten by the service.
+ 
  + If you select the **Active (basic)** option, AWS Elastic Disaster Recovery will launch an AWS instance type that best matches the OS, CPU, and RAM of your source server. AWS Elastic Disaster Recovery will launch a new instance type after every change of configuration on the source server (for example, added/removed disks, added/removed RAM). Instance types are only chosen from the C5 family.
  + If you select the **Active (in-aws)** option, AWS Elastic Disaster Recovery will periodically update the EC2 launch template based on the hardware configuration of the EC2 instance source server.
  + If you select **Inactive**, AWS Elastic Disaster Recovery will launch the AWS instance type as configured in your EC2 launch template. Select this option if you want to determine the instance type that will be launched in AWS for all your drill or recovery servers.
**Important**  
The AWS instance type selected by AWS Elastic Disaster Recovery when this feature is activated will overwrite the instance type defined in your EC2 launch template.
Hardware changes and the resulting AWS instance type change may take up to 90 minutes to be processed by AWS Elastic Disaster Recovery. 

  The right-sizing instance type selected by AWS Elastic Disaster Recovery will be featured on the **Server details** tab.
+  **Start instance upon launching –** Choose whether you want to start your drill and recovery instances automatically upon launch or whether you want to launch them in a stopped state. 

  If you choose **No**, you will have to start the drill or recovery AWS instance manually from the EC2 Console.
+  **Copy Private IP –** Choose whether you want AWS Elastic Disaster Recovery to ensure that the private IP used by the drill or recovery instance matches the private IP used by the source server. AWS Elastic Disaster Recovery will monitor the source server on an hourly basis to identify the private IP and will use the private IP of the primary network interface. 

  The **No** option is chosen by default. Choose **No** if you do not want the private IP of the drill or recovery instance to match that of the source machine.

  Choose **Yes** if you want to use a private IP. The IP will be shown in brackets next to the option. 
  + If you choose **Yes**, ensure that the IP range of the subnet you set in the EC2 launch template includes the private IP address.
  + If the both the source server and the drill or recovery instance share the same subnet though a VPN, then the source private IP is already in use, and the **Copy private IP** option should not be used. 
  + Removing a private IP from a specific server's settings does not remove it from the launch template.

   **Copy private IP** will be deactivated if you set a value for **Launch into instance ID**, as this setting cannot affect an already launched instance. 
+ ** Transfer server tags –** Choose whether you want AWS Elastic Disaster Recovery to transfer any user-configured custom tags from your source servers onto your drill or recovery instance. These tags are attached to all source servers, all launched drill and recovery instances, and all of the ephemeral resources that are created on your AWS Account during the normal operation of AWS Elastic Disaster Recovery. Transfer server tags only copies tags associated with the source servers in the AWS Elastic Disaster Recovery console, and does not copy the EC2 source server tags (in case of AWS to AWS disaster recovery implementation). 

  These resources include:
  + EC2 instances
  + Conversion groups
  + Security groups
  + EBS volumes
  + Snapshots
**Note**  
AWS Elastic Disaster Recovery automatically adds system tags to all resources.
Tags that are added on the EC2 launch template will take precedence over tags that are transferred directly from the source server. 

  You can always add tags from the Amazon EC2 console as described in [this Amazon EC2 article](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources)%5C). 

   **Transfer server tags** is deactivated if you set a value for **Launch into instance ID**, because this setting cannot affect an already launched instance. 
+  **Launch into instance ID** - Configure an existing instance ID to launch into, instead of creating a new instance. This field allows to select an EC2 instance from the list of EC2 instances available in this region. The EC2 instance to launch into must have a tag with key *AWSDRS* and value *AllowLaunchingIntoThisInstance* to appear in the list, and it must be stopped prior to launching into it. When this value is set, the **Transfer server tags** and **Copy private IP** settings will be deactivated, as they cannot apply to an already launched instance. 
**Note**  
 For the instance to appear and perform as a recovery instance in DRS and allow to run post-launch actions on it, it needs to have an instance profile that includes the policies **AWSElasticDisasterRecoveryRecoveryInstancePolicy** and **AmazonSSMManagedInstanceCore**. The role **AWSElasticDisasterRecoveryRecoveryInstanceWithLaunchActionsRole**, installed from the Default post-launch actions settings page if not already present, contains these policies and can be used as an instance profile. 

   The launch into an instance will fail if the following pre-requisites are not met:

  1. The instance to launch into must have the required tag with key *AWSDRS* and value *AllowLaunchingIntoThisInstance*. 

  1. The instance to launch into has been stopped.

  1. The instance to launch into must have the same operating systems platform (Linux or Windows) as that of the server it is protecting. 

  1. If the instance to launch into is a Linux it must have the BIOS boot mode, and if Windows it must have the same boot mode as that of the server it is protecting.

  1. The instance to launch into must have the x86\$164 architecture, HVM virtualization and an EBS root device.

  1.  **OS licensing** can only be **Bring Your Own License (BYOL)** if the instance’s platform is Linux or if the instance’s **tenancy** is **dedicated host**. 

  1.  **Transfer server tags** and **Copy private IP** must be deactivated (this is done automatically when **Launch into instance ID** is set via the console). 
+  **OS licensing –** Choose whether you want to Bring Your Own Licenses (BYOL) from the source server into the drill or recovery instance. 

  The **Use default** option will use the default licensing mechanism for your operating system. 

  Choose **BYOL** if:
  + You are migrating a Linux server. All Linux licenses are BYOL by default. Any RHEL, SUSE, or Debian licenses will be transferred in their current form to the recovered instance. Make sure that the terms of your licenses allow this license transfer. 
  + You want to BYOL your Windows licenses. This will set up a dedicated host through which all the licenses from the Windows source server will be automatically transferred to the drill or recovery instance.
**Important**  
If you activate BYOL licensing for Windows, you have to change the **Placement.tenancy** type in the EC2 launch template to **Host**. Otherwise, instance launch will fail.
**Note**  
Windows Desktop Editions require BYOL – [note the specific restrictions for AWS Provided Licenses](https://aws.amazon.com/windows/faq/#buy-win-cl).
If you are using Windows Servers datacenter: Azure addition, [note the specified restrictions for BYOL](https://www.microsoft.com/licensing/terms/productoffering/WindowsServerStandardDatacenterEssentials/EAEAS#UseRights).

# EC2 launch template
<a name="ec2-launch"></a>

AWS Elastic Disaster Recovery (AWS DRS) utilizes EC2 launch templates to launch drill and recovery EC2 instances for each source server. You can edit those templates for each source server directly from the AWS DRS console.

The EC2 launch template is created automatically for each source server that is added to AWS DRS upon the installation of the AWS Replication Agent.

![\[EC2 launch template configuration with subnet, instance type, and advanced settings options.\]](http://docs.aws.amazon.com/drs/latest/userguide/images/ec2launchtemplate.png)


**Topics**
+ [

## EC2 launch template parameters
](#server-ec2-launch-template-parameters)
+ [

## EC2 template considerations
](#ec2-considerations)

**Note**  
In most use cases, the EC2 launch template does not need to be edited.
You cannot use the same template for multiple servers.
Many EC2 launch template parameters can be changed, but some may not be used by the AWS DRS launch process and some may interfere with the AWS Elastic Disaster Recovery launch process.
You must set the EC2 launch template you want to use with AWS DRS as the **default** launch template. 

 To edit the EC2 template for a single server, take the following steps:

1. Go to the **Source servers** page.

1. Select a source servers to update.

1. Under the **Actions** menu, select **Edit EC2 launch settings** and you will be navigated to the **Edit EC2 launch template** page within the AWS DRS console.

1. Change the settings according to your preferences.

1. Click **Save settings**.

Alternatively:
+ Go to the **Source servers** page.
+ Select a specific source server.
+ Go to the **Launch settings** tab.
+ Click **Edit** in the EC2 launch template section.

## EC2 launch template parameters
<a name="server-ec2-launch-template-parameters"></a>

AWS Elastic Disaster Recovery (AWS DRS) EC2 launch settings are divided into basic and advanced settings.

The basic settings include:
+ **Subnet –** When you specify a subnet, this field defines where the instance will be launched. When selecting a subnet, only the default network interface will be updated. If you do not include a subnet, the launched instance will use the Region’s default subnet located in the default VPC.
**Note**  
If you have a default VPC, you 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 drill or recovery instances. 
For cross-AZ recovery, ensure that the staging area subnet and the subnets that you configure your recovery instances to launch in are not in the same AZ as your source EC2 instances.
If you have multiple on-premises servers that represent the same resources you can use different AZs for recovery instances to increase resiliency.
+  **Security groups –** The selected security groups to assign to the instance, applied to the subnet selected for the default network interface. If no security group is selected, there is no default value and no group will be used. Security groups can only be selected if a subnet is included.
+  **Instance type –** The default instance type to use when launching. If instance type right-sizing is active, the system will disregard this setting. If no instance type is included, a default value will be used. You can either select an instance type, or you can specify instance attributes and let Amazon EC2 identify the instance types with those attributes.

 **Instance type attributes: ** 
+  **Number of vCPUs:** Enter the minimum and maximum number of vCPUs for your compute requirements. To indicate no limits, mark the no minimum or no maximum checkboxes, or leave them blank. 
+  **Amount of memory (MiB):** Enter the minimum and maximum amount of memory, in MiB, for your compute requirements. To indicate no limits, mark the no minimum or no maximum checkboxes or leave the fields blank. 
+  Expand **Optional instance type attributes**: Select an attribute from the **Choose attribute** dropdown and press **Add attribute** to express your compute requirements in more detail. For information about each attribute, see [InstanceRequirementsRequest](https://docs.aws.amazon.com//AWSEC2/latest/APIReference/API_InstanceRequirementsRequest.html) in the *Amazon EC2 API Reference*. 
+  **Preview matching instance types:** You can preview the instance types that match the specified attributes. To exclude instance types, you can select the instance types you want to exclude from the previewed list of instance types, but only if you did not allow instance types, as you can either exclude or allow instance types but not both. 

 See more about these attributes here: [How attribute-based instance type selection works](https://docs.aws.amazon.com//AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-abs-how-it-works). EC2 will use fleets to launch your instances, and will apply price protection to ensure the fleet does not pick expensive instance types for you. DRS uses the default protection settings, so we will protect against selecting instance types that are 20% more expensive than the lowest cost instance type. To learn more about price protection using fleets, visit: [Price Protection](https://docs.aws.amazon.com//AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-abs-price-protection). 

 To learn more about using instance type attributes in DRS, visit [Flexible Instance Types](https://docs.aws.amazon.com//drs/latest/userguide/flexible-instance-types.html). 

Advanced settings include additional parameters that add specific features to the EC2 template. If you choose not to include these parameters in the template, the specific capabilities will not be added. 

The advanced settings include:
+ **IAM instance profile –** Attach a specific profile to the instance that will be launched. Make sure the instance profile has the AWSElasticDisasterRecoveryRecoveryInstancePolicy IAM policy attached in addition to any other policy.
+ **Auto assign public IP –** Automatically assign a public IP to the launched instance.
+ **Termination protection –** Protect the launched instance from accidental termination using the EC2 console.
+  **Tenancy –** Set tenancy information, such as dedicated host needed in conjunction with setting BYOL for Windows servers and Windows Home.
+ **Capacity reservation –** Apply reservation consideration to the launched instances.
+ **Key pair –** Associate a key pair with launched instances that are based on EC2 instances.

**Note**  
AWS DRS only supports major EC2 template parameters. If you want to change values that are not supported by this feature, you can still do so by editing the EC2 launch template via the Amazon EC2 console:  
Create a new EC2 template version with the required changes.
Mark it as default.

**Important**  
Every time you modify an EC2 launch template on the Amazon EC2 console, a new version is created. AWS DRS uses the version that is marked as the default. if you prefer to use the EC2 launch template you just modified, make sure to mark it as the default. Changes made through the AWS DRS console are automatically set as the default version.

 **EC2 launch template tags –** In addition to the basic and advanced settings, you can also add up to 50 tags. These will be transferred to your drill and recovery 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 DRS Console or tags manually added to the server. 

Learn more about EC2 launch template settings and configuration options in [this EC2 article](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html).

## EC2 template considerations
<a name="ec2-considerations"></a>

**Revert to previous version –** The right-sizing mechanism can fix issues such as an incorrect instance type, but other issues may still occur. If you encounter any issues with the launch template, you can quickly address them by choosing the original default launch template that was created by AWS DRS when the agent was installed. Alternatively, you can edit the relevant fields from the AWS DRS console.

**Important**  
If you decide to create the EC2 template from the Amazon EC2 console, be sure not to change or edit the following fields:  
RAM disk ID
Kernel
Nitro Enclave
Metadata accessible
These fields must remain unchanged for AWS Elastic Disaster Recovery to function properly.

# Flexible Instance Types
<a name="flexible-instance-types"></a>

AWS Elastic Disaster Recovery (AWS DRS) uses EC2 Launch Templates to define how each source server will be launched as an EC2 instance. For each source server, you can define an EC2 instance type that will be used to launch, if **Instance-type right-sizing** is not activated. However, you might want to be flexible with the instance type definitions as this can help in certain situations, such as reducing the risk of not finding enough resources to support recovery which results in an **Insufficient Capacity Error (ICE)**. 

## How it works
<a name="flexible-instance-types-how-it-works"></a>

Using attribute based instance type selection allows you to specify attributes to define a set of instance types that can be used to launch an EC2 instance for the source server. These instance types will only include those that are offered in the AWS Region and Availability Zone specified by the subnet in your launch template. To learn more about attribute based instance type selection, visit: [ How attribute-based instance type selection works](https://docs.aws.amazon.com//AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-abs-how-it-works). 

DRS will use EC2 fleets to launch instances using the attribute settings defined in the EC2 launch template. This will apply price protection to ensure the fleet picks the most cost effective instance types for you. We use the default protection settings, so we will protect against selecting instance types that are 20% more expensive than the lowest cost instance type. To learn more about price protection using fleets, visit: [ Price protection](https://docs.aws.amazon.com//AWSEC2/latest/UserGuide/ec2-fleet-attribute-based-instance-type-selection.html#ec2fleet-abs-price-protection). 

When launching an instance, EC2 fleets will attempt to launch an instance type listed in **Preview matching instance types**. It will start from the lowest cost instance type. If an instance type has run out of capacity in the current AWS Region and Availability Zone, EC2 fleets will attempt to launch with another instance type from the list. It is expected each attempt will take up to a few minutes, so if most of the instance types are not available, it could have an impact on your [ Recovery Time Objective (RTO)](https://docs.aws.amazon.com//drs/latest/userguide/What-is-RTO.html). 

A large and diverse list of possible instance types listed in *Preview matching instance types* increases the chances of finding an available instance type.

## How to use
<a name="flexible-instance-types-attribute-selection"></a>

To use this setting, you can modify the **Default launch settings** (editing the **Default EC2 launch template**) or the **Launch settings** of one or more source servers, and edit the **EC2 launch template**. 

Modifying the default launch template settings will only apply to servers added after the change. Modifying the settings of existing source servers will apply to the next launch of those servers. 

 In the **Instance type** section of the page, select **Specify instance type attributes**. 

## Attribute selection
<a name="flexible-instance-types-attribute-selection"></a>

 These are the attributes that you can set: 
+  **Number of vCPUs:** Enter the minimum and maximum number of vCPUs for your compute requirements. To indicate no limits, mark the no minimum or no maximum checkboxes. 
+  **Amount of memory (MiB):** Enter the minimum and maximum amount of memory, in MiB, for your compute requirements. To indicate no limits, mark the no minimum or no maximum checkboxes. 
+  Expand **Additional instance type attributes** and choose **Add attribute** to express your compute requirements in more detail. For information about each attribute, see [InstanceRequirementsRequest](https://docs.aws.amazon.com//AWSEC2/latest/APIReference/API_InstanceRequirementsRequest.html) in the Amazon EC2 API Reference. For example, you can set **Allowed instance types** to include additional specific instance types, or alternatively, you can use **Excluded instance types** to exclude specific instance types out of the resulting instance types. Note that allowed and excluded instance types cannot be specified together. You can also exclude instance types by selecting instance types from the **Preview matching instance types** and clicking the **Exclude selected instance types**. 
+  **Preview matching instance types:** You can preview the instance types that match the specified attributes. To exclude instance types, you can select the instance types you want to exclude from the previewed list of instance types, but only if you did not allow instance types, as you can either exclude or allow instance types but not both. You can exclude instance types by selecting instance types from the **Preview matching instance types** and clicking the **Exclude selected instance types**. If this list is empty, try to expand the attribute values to allow more options. 

 You can use **Allowed instance types** to add most of the supported instance types to the **Preview matching instance types** list. This way you can create a limited set of instance types, which may be useful in situations where you are constrained by the instance type options you can use, and can only use a small list of those. 

**Note**  
 Adding burstable instance types, such as t2 or t3, to the allow attribute will not affect the list in **Preview matching instance types**. However, if you select a burstable instance type and update the **EC2 launch template** on the EC2 console by selecting *Burstable performance support* from the **Attribute** dropdown, setting the **Attribute value** to *Include* (or *Required*), and set the new template version as a default, these instance types will affect the preview list. 

**Note**  
 You can define attributes directly on the EC2 launch template. If you have defined an attribute that is not supported on the DRS console, that attribute will still affect the list of instance types in **Preview matching instance types**, even if the DRS console will not display it. 

**Note**  
 Note: Flexible instance types cannot be used if **instance type right-right sizing** is active, or if the subnet selected for launch is on an AWS Outpost rack. 