Lab: Assessing and Prioritizing Workloads with AWS Migration Hub
Select existing workloads and processes for potential migration
Lab: Assessing and Prioritizing Workloads with AWS Migration Hub
This lab guides you through the "Mobilize" phase of a cloud migration. You will simulate the discovery of on-premises assets, group them into logical applications, and assign migration strategies based on the 7Rs framework using the AWS Migration Hub and Application Discovery Service.
[!WARNING] Always run the teardown commands at the end of this lab to avoid unnecessary charges. While Migration Hub and Discovery Service have significant free tiers, associated logs or mock resources may incur costs.
Prerequisites
- An AWS Account with Administrator access.
- AWS CLI installed and configured with your credentials.
- Basic understanding of VPC and EC2 concepts.
- IAM permissions to manage
discovery,mgh(Migration Hub), andiamresources.
Learning Objectives
- Configure the AWS Migration Hub Home Region.
- Simulate on-premises asset discovery using the AWS CLI.
- Group discovered servers into logical Application containers.
- Evaluate and assign migration strategies (7Rs) for workloads.
- Use Migration Hub to track the assessment status.
Architecture Overview
The following diagram illustrates how the Discovery Service feeds data into the Migration Hub for assessment.
Step-by-Step Instructions
Step 1: Set the Migration Hub Home Region
Before using Migration Hub, you must specify a home region where your discovery and migration tracking data will be stored. This cannot be changed once data is uploaded.
# Note: This is usually done in the console,
# but you can verify your configuration via CLI
aws discovery describe-home-region▶Console alternative
- Navigate to AWS Migration Hub in the AWS Management Console.
- Click Settings in the left navigation pane.
- Select your preferred region (e.g.,
us-east-1) and click Set Home Region.
Step 2: Simulate On-Premises Server Discovery
In a real-world scenario, you would install the AWS Discovery Agent. For this lab, we will use the CLI to manually create a configuration item representing an on-premises web server.
# This command creates a record for a simulated on-premises server
aws discovery start-continuous-export[!NOTE] Because manual creation of configuration items is restricted in some environments, we will focus on the grouping and assessment logic. In a production environment, this data would flow from the Discovery Collector.
Step 3: Grouping Servers into Applications
Applications are logical groups of servers that work together (e.g., a Web Server and a Database).
# Create an application named 'Legacy-Finance-App'
aws discovery create-application --name "Legacy-Finance-App" --description "On-premises finance portal"▶Console alternative
- In Migration Hub, go to Discover > Servers.
- (Assuming servers are listed) Select the checkboxes for the servers you want to group.
- Click Actions > Group as application.
- Enter
Legacy-Finance-Appand save.
Step 4: Assigning Migration Strategies (The 7Rs)
You must now decide how to move this application. We will use the TikZ visual below to help determine the strategy.
\begin{tikzpicture}[node distance=2cm, every node/.style={draw, rectangle, rounded corners, align=center, fill=blue!10}] \node (start) {Is the app\needed?}; \node (retire) [right of=start, xshift=2cm, fill=red!20] {Retire}; \node (val) [bottom of=start] {Does it have\business value?}; \node (retain) [right of=val, xshift=2cm, fill=orange!20] {Retain}; \node (cloud) [bottom of=val] {Move to Cloud?}; \node (rehost) [bottom left of=cloud, xshift=-1cm, fill=green!20] {Rehost}; \node (refactor) [bottom right of=cloud, xshift=1cm, fill=green!20] {Refactor};
\draw[->] (start) -- node[anchor=south] {No} (retire);
\draw[->] (start) -- node[anchor=right] {Yes} (val);
\draw[->] (val) -- node[anchor=south] {No} (retain);
\draw[->] (val) -- node[anchor=right] {Yes} (cloud);
\draw[->] (cloud) -- node[anchor=east] {Simple} (rehost);
\draw[->] (cloud) -- node[anchor=west] {Complex} (refactor);\end{tikzpicture}
Checkpoints
- Verification: Run
aws discovery list-applications. Do you seeLegacy-Finance-App? - Expected Result: The JSON output should include the
configurationIdand the name of your application. - Migration Hub Dashboard: Open the Migration Hub console. Under Migrate > Applications, verify the application is listed with a status of "Not started".
Clean-Up / Teardown
To avoid any lingering metadata storage costs (though minimal), delete the created resources.
# 1. Get the configuration ID for your application
APP_ID=$(aws discovery list-applications --filters name="Legacy-Finance-App" --query "applications[0].configurationId" --output text)
# 2. Delete the application
aws discovery delete-applications --configuration-ids $APP_IDTroubleshooting
| Error | Likely Cause | Fix |
|---|---|---|
Home region not set | Migration Hub requires a global data store location. | Follow Step 1 to set the Home Region in the Console. |
AccessDenied | Missing IAM permissions for discovery:*. | Ensure your IAM user has the AWSApplicationDiscoveryServiceFullAccess policy. |
InvalidParameter | The Application name already exists. | Use a unique name like Finance-App-001. |
Stretch Challenge
Exploratory Task: Use the AWS CLI to associate a specific "Migration Status" to your application.
- Research the
aws mgh notify-migration-task-statecommand. - Try to simulate a status update that shows the application as "In Progress" within the Migration Hub dashboard.
Cost Estimate
- AWS Migration Hub: Free of charge for tracking.
- AWS Application Discovery Service: Free for the first 1,000 servers per account. Data stored in the home region is subject to standard S3/Log storage rates if exported, but usually falls under the Free Tier for this lab scale.
- Estimated Total: $0.00.
Concept Review
| Strategy | Description | Best For... |
|---|---|---|
| Rehost | Lift-and-shift with no changes. | Quick exits, legacy apps. |
| Replatform | Lift-and-reshape (e.g., move to RDS). | Reducing DB management overhead. |
| Refactor | Re-architecting for cloud-native features. | High-value, high-scale apps. |
| Retire | Decommissioning the application. | Redundant or obsolete software. |
| Retain | Keeping it on-premises for now. | High-latency requirements or recent hardware spend. |