Multi-Region Migration using AWS Application Migration Service
AWS Architecture BlogMulti-Region Migration using AWS Application Migration Serviceby Shreya Pathak and Medha Shree | on16 FEB 2022| inAmazon EC2,Amazon Elastic Block Store (Amazon EBS),Amazon VPC,Architecture,AWS Application Migration Service,AWS Identity and Access Management (IAM)|Permalink|ShareAWS customers are in various stages of their cloud journey. Frequently, enterprises begin that journey by rehosting (lift-and-shift migrating) their on-premises workloads into AWS, and runningAmazon Elastic Compute Cloud (Amazon EC2)instances. You can rehost usingAWS Application Migration Service (MGN), a cloud-native migration tool.You may need to relocate instances and workloads to a Region that is closer in proximity to one of your offices or data centers. Or you may have a resilience requirement to balance your workloads across multiple Regions. This rehosting migration pattern with AWS MGN can also be used to migrate Amazon EC2-hosted workloads from one AWS Region to another.In this blog post, we will show you how to configure AWS MGN for migrating your workloads from one AWS Region to another.Overview of AWS MGN migrationAWS MGN, an AWS native service, minimizes time-intensive, error-prone, manual processes by automatically converting your source servers from physical, virtual, or cloud infrastructure to run natively on AWS. It reduces overall migration costs, such as investment in multiple migration solutions, specialized cloud development, or application-specific skills. With AWS MGN, you can migrate your applications from physical infrastructure, VMware vSphere, Microsoft Hyper-V, Amazon EC2, andAmazon Virtual Private Cloud (Amazon VPC)to AWS.To migrate to AWS, install the AWS MGN Replication Agent on your source servers and define replication settings in the AWS MGN console, shown in Figure 1. Replication servers receive data from an agent running on source servers, and write this data to theAmazon Elastic Block Store (EBS)volumes. Your replicated data is compressed and encrypted in transit and at rest using EBS encryption.AWS MGN keeps your source servers up to date on AWS using nearly continuous, block-level data replication. It uses your defined launch settings to launch instances when you conduct non-disruptive tests or perform a cutover. After confirming that your launched instances are operating properly on AWS, you can decommission your source servers.Figure 1. MGN service architectureSteps for migration with AWS MGNThis tutorial assumes that you already have your source AWS Region set up with Amazon EC2-hosted workloads running and a target AWS Region defined.Migrating Amazon EC2 workload across AWS Regions include the following steps:Create the Replication Settings template. These settings are used to create and manage your staging area subnet with lightweight Amazon EC2 instances. These instances act as replication servers used to replicate data between your source servers and AWS.Install the AWS Replication Agent on your source instances to add them to the AWS MGN console.Configure the launch settings for each source server. These are a set of instructions that determine how a Test or Cutover instance will be launched for each source server on AWS.Initiate the test/cutover to the target Region.PrerequisitesFollowing are the prerequisites:AWS Identity and Access Management (IAM)user with required credentials, as defined in theAWS MGN documentationA staging area subnet created in the target Region, as defined in theAWS MGN documentationA VPC and subnet in the target Region where target instances will be launchedSecurity groups that will be attached to migrated instancesNetwork preparations in both Regions as defined in theAWS MGN documentationSetting up AWS MGN for multi-Region migrationThis section will guide you through AWS MGN configuration setup for multi-Region migration.Log into yourAWS account, select the target AWS Region, and complete the prerequisites. Then you are ready to configure AWS MGN:1.      ChooseGet startedon theAWS MGN landing page.2.      Create the Replication Settings template (see Figure 2):Select Staging area subnet for Replication ServerChoose Replication Server instance type(By default, AWS MGN uses t3.small instance type)Choose default or customAmazon EBS encryptionEnable ‘Always use the Application Migration Service security group’Add custom Replication resources tagsSelectCreate TemplatebuttonFigure 2. Replication Settings template creation3.Add source serversto AWS MGN:SelectAdd Serversfollowing Source Servers (AWS MGN > Source Servers)Enter OS, Replication Preferences, IAM Access Key and Secret Access Key ID of the IAM user created following Prerequisites. This does not expose your Secret Access Key ID in any requestCopy the installation command and run on your source server for agent installationAfter successful agent installation, the source server is listed on the Source Servers page. Data replication begins after completion of the Initial Sync steps.4.      Monitor the Initial Sync status (shown in Figure 3):Source server name > Migration Dashboard > Data Replication Status(Refer to theSource Servers page documentationfor more details)After 100% initial data replication confirm:Migration Lifecycle = Ready for testingNext step = Launch test instanceFigure 3. Monitoring initial replication status5.      ConfigureLaunch Settingsfor each server:Source servers page > Select source serverNavigate to theLaunch settingstab (see Figure 4.)For this tutorial we won’t adjust theGeneral launch settings. We will modify theEC2 Launch TemplateinsteadClick on EC2 Launch Template > About modifying EC2 Launch Templates > ModifyFigure 4. Modifying EC2 Launch Template6.Provide valuesfor Launch Template:AMI: Recents tab > Don’t include in launch templateInstance Type: Can be kept same as source server or changed as per expected workloadKey pair (login): Create new or use existing if already created in the Target AWS RegionNetwork Settings > Subnet: Subnet for launching Test instanceAdvanced network configuration:Security Groups: For access to the test and final cutover instancesConfigure Storage: Size – Do not change or edit this fieldVolume type: Select any volume type (io1 is default)Review details and clickCreate Template Versionunder the Summary section on right side of the console7.      Every time you modify the Launch template, a new version is created. Set the launch template that you want to use with MGN as the default (shown in Figure 5):Navigate toAmazon EC2 dashboard>Launch TemplatespageSelect the Launch template IDOpen the Actions menu and chooseSet default versionand select the latest Launch template createdFigure 5. Setting up your Launch template as the default8.      Launch a test instance and perform a Test prior to Cutover to identify potential problems and solve them before the actual Cutover takes place:Go to theSource Serverspage (see Figure 6)Select source server > OpenTest and CutovermenuUnder Testing, chooseLaunch test instancesLaunch test instances for X servers >LaunchChooseView job detailson the ‘Launch Job Created’ dialog box to view the specific Job details for the test launch in theLaunch HistorytabFigure 6. Launching test instances9.      Validate launch of test instance (shown in Figure 7) by confirming:Alerts column = LaunchedMigration lifecycle column = Test in progressNext step column = Complete testing and mark as ‘Ready for cutover’Figure 7. Validating launch of test instances10.  SSH/ RDP into Test instance (view from EC2 console) and validate connectivity. Perform acceptance tests for your application as required.Revert the testif you encounter any issues.11.  Terminate Test instances after successful testing:Go toSource serverspageSelect source server > OpenTest and CutovermenuUnder Testing, chooseMark as “Ready for cutover”Mark X servers as “Ready for cutover” >Yes, terminate launched instances (recommended)>Continue12.  Validate the status of termination job and cutover readiness:Migration Lifecycle = Ready for cutoverNext step = Launch cutover instance13.  Perform the final cutover at a set date and time:Go toSource serverspage (see Figure 8)Select source server > OpenTest and CutovermenuUnder Cutover, chooseLaunch cutover instancesLaunch cutover instances for X >LaunchFigure 8. Performing final Cutover by launching Cutover instances14.  Monitor the indicators to validate the success of the launch of your Cutover instance (shown in Figure 9):Alerts column = LaunchedMigration lifecycle column = Cutover in progressData replication status = HealthyNext step column = Finalize cutoverFigure 9. Indicators for successful launch of Cutover instances15.  Test Cutover Instance:Navigate to Amazon EC2 console >Instances (running)Select Cutover instanceSSH/ RDP into your Cutover instance to confirm that it functions correctlyValidate connectivity and perform acceptance tests for your applicationRevert Cutoverif any issues16.  Finalize the cutover after successful validation:Navigate to AWS MGN console >Source serverspageSelect source server > OpenTest and CutovermenuUnder Cutover, chooseFinalize CutoverFinalize cutover for X servers >Finalize17.  At this point, if your cutover is successful:Migration lifecycle column = Cutover complete,Data replication status column = DisconnectedNext step column = Mark as archivedThe cutover is now complete and that the migration has been performed successfully. Data replication has also stopped and all replicated data will now be discarded.Cleaning upArchive your source serversthat have launched Cutover instances to clean up your Source Servers page-Navigate toSource Serverspage (see Figure 10)Select source server > OpenActionsChooseMark as archivedArchive X server >ArchiveFigure 10. Mark source servers as archived that are cutoverConclusionIn this post, we demonstrated how AWS MGN simplifies, expedites, and reduces the cost of migrating Amazon EC2-hosted workloads from one AWS Region to another. It integrates withAWS Migration Hub, enabling you to organize your servers into applications. You can track the progress of all your MGN at the server and app level, even as you move servers into multiple AWS Regions. Choose aMigration Hub Home Regionfor MGN to work with the Migration Hub.Here are the AWS MGNsupported AWS Regions. If your preferred AWS Region isn’t currently supported or you cannot install agents on your source servers, consider usingCloudEndure MigrationorAWS Server Migration Servicerespectively. CloudEndure Migration will be discontinued in all AWS Regions on December 30, 2022. Refer toCloudEndure Migration EOLfor more information.Note:Use of AWS MGN is free for 90 days but you will incur charges for any AWS infrastructure that is provisioned during migration and after cutover. For more information, refer to thepricing page.Thanks for reading this blog post! If you have any comments or questions, feel free to put them in the comments section.Shreya PathakShreya Pathak is a Solutions Architect at AWS with over five years of experience working alongside small to enterprise businesses. Currently, she spends the majority of her time helping SMBs of India overcome their technical and strategic challenges and innovate through cloud technologies. A strong believer in the power of cloud, she enjoys staying on top of fast-moving trends in the field. Shreya finds inspiration from her colleagues and the LinkedIn community.Medha ShreeMedha Shree is a Solutions Architect at Amazon Web Services India Private Limited. She specialises in Migrations and Modern application design, enjoys helping customers from all industries. When not working, Medha loves playing badminton and exploring new places.
AWS customers are in various stages of their cloud journey. Frequently, enterprises begin that journey by rehosting (lift-and-shift migrating) their on-premises workloads into AWS, and running Amazon Elastic Compute Cloud (Amazon EC2) instances. You can rehost using AWS Application Migration Service (MGN), a cloud-native migration tool. You may need to relocate instances and workloads to […]
Shreya Pathak
Amazon EC2 Amazon Elastic Block Store (Amazon EBS) Amazon VPC Architecture AWS Application Migration Service AWS Identity and Access Management (IAM)