Replatform to EC2
The Cloud Migration Factory on AWS solution allows groups of EC2 instances to be launched automatically from configurations defined in its datastore; deploying EC2 instances with EBS volumes attached. This provides the ability to provision new EC2 instances, allowing Replatform through AWS CloudFormation, and Rehost of on-premise servers with AWS MGN within a single CMF user interface. Before you can use this functionality the datastore must contain the definition of the servers. Once this has been addressed the servers should be linked to a wave. When the decision is taken to launch the EC2 instances, the user can initiate the following actions against the wave:
-
EC2 Input Validation
-
EC2 Generate CF Template
-
EC2 Deployment
Prerequisites
Permissions to add the Replatform attribute access.
Initial configuration
Configuration of the new EC2 instances is performed through the creation of new server items using either the user interface or through the import of a CSV intake form containing the server items. These definitions are converted to AWS CloudFormation templates stored in an S3 bucket within the same AWS account that the AWS CMF instance is deployed.
User interface definition
When defining a server in the AWS Cloud Migration Factory datastore for use with the Replatform to EC2 functionality the server needs to be configured with a Migration Strategy of Replatform. Once Replatform is selected then the additional attributes required for this functionality will be shown on the screen. The following attributes are required to be populated for the functionality to work:
Required attributes
AMI Id - ID of the Amazon Machine Image used to launch the EC2 instance.
Availability Zone - AZ that the EC2 instance will be deployed to.
Root Volume Size - Size in GB of the root volume for the instance.
Instance Type - EC2 instance type to be used.
Security Group Ids - List of security groups assigned to the instance.
Subnet Ids - Subnet ID to assign this EC2 instance to.
Tenancy - Currently the only supported option for the Replatform to EC2 integration is Shared any other option will be replaced with Shared when the template is generated.
Optional Attributes
Enable Detailed Monitoring - Check to enable detailed monitoring.
Additional Volume Names - List of Additional EBS volume names. Each item in the list needs to map to the same line as the Size and Type lists.
Additional Volume Sizes - List of additional EBS volume sizes. Each item in the list needs to map to the same line as the Names and Type lists.
Additional Volume Types - List of additional EBS volume types. Each item in the list must map to the same line as the Names and Size lists, if not specified then defaults to gp2 for all volumes.
EBS KMS Key Id for Volume Encryption - If EBS volumes will be encrypted then specify the Key ID, Key ARN, Key Alias, or Alias ARN.
Enable EBS Optimized - Select to turn on EBS Optimized.
Root Volume Name - Select from the options provided, if not specified then the ID will be used.
Root Volume Type - Provide the EBS type of the volume to be created, if not specified then defaults to gp2.
Intake form definition
Intake forms can contain the details to create or update multiple types of record with the datastore in a single row of the csv file, this enables the import of related data. In the following example, the wave, application and server records will be created and related to each other automatically during the import.
Example: Intake form
Column name | Example data | Required | Notes |
---|---|---|---|
wave_name |
|
Yes |
|
app_name |
|
Yes |
|
aws_accountid |
|
Yes |
|
server_name |
|
Yes |
|
server_fqdn |
|
Yes |
|
server_os_family |
|
Yes |
|
server_os_version |
|
Yes |
|
server_tier |
|
No |
|
server_environment |
|
No |
|
subnet_IDs |
|
Yes |
|
securitygroup_ID |
|
Yes |
|
instanceType |
|
Yes |
|
iamRole |
|
No |
|
tenancy |
|
Yes |
|
r_type |
|
Yes |
|
root_vol_size |
|
Yes |
|
ami_id |
|
Yes |
|
availabilityzone |
|
Yes |
|
root_vol_type |
|
No |
|
add_vols_size |
|
No |
|
add_vols_type |
|
No |
|
ebs_optimized |
|
No |
|
ebs_kmskey_id |
|
No |
|
detailed_monitoring |
|
No |
|
root_vol_name |
|
No |
|
add_vols_name |
|
No |
To import the intake form, follow the same process as any other data imports into the Cloud Migration Factory on AWS solution.
Deployment actions
EC2 input validation
After defining the instance parameters, you must first run the wave action: Replatform>EC2>EC2 Input Validation. This action verifies that all the correct parameters have been provided for each server in order to create a valid CloudFormation template.
Note
This validation does not currently verify that the input parameters are valid, only that they are present in each server definition. You must verify the correct values before creating the template otherwise the deployment of the template will fail.
EC2 generate CloudFormation template
Once the definitions for all servers included in a wave have been verified the CloudFormation template can be generated. To do this, run the wave action: Replatform>EC2>EC2 Generate CF Template. This action creates a CloudFormation template for each application in the wave, where the servers in the application have a Migration Strategy of Replatform; any servers with other migration strategies defined will not be included in the template.
Once run, the templates for each application will be stored in the S3 bucket: -gfbuild-cftemplates , which was automatically created when the Cloud Migration Factory on AWS solution was deployed. The folder structure of this bucket is as follows:
-
[Target AWS Account ID]
-
[Wave Name]
-
CFN_Template_ \_ –0—yaml
-
Each time the generate action is run a new version of the template is stored in the S3 bucket. The S3 URIs for the templates will be provided in the notification, these templates can be reviewed or edited as required before deployment.
The CloudFormation templates generate the following CloudFormation resource types currently:
-
AWS::EC2::Instance
-
AWS::EC2::Volume
-
AWS::EC2::VolumeAttachment
EC2 deployment
Once you’re ready to deploy the new EC2 instances, you can initiate the EC2 Deployment action can be initiated through the wave action Replatform>EC2>EC2 Deployment. This action will use the latest version of the CloudFormation template for each application in the wave, and deploy these templates into the target accounts selected, through AWS CloudFormation.