AWS Builder Center
Day one after cutover: the baseline MGN leaves out

Day one after cutover: the baseline MGN leaves out

One Systems Manager Automation document that makes a server MGN lands operable: SSM Agent, CloudWatch agent, five alarms, patch tag. 45 min to 6.

Cloud Architect - AWS migrations, disaster recovery and VMware security hardening

Day one after cutover: the baseline MGN leaves out

What this article covers

This is what I do to a server in the first hour after AWS Transform MGN launches its cutover instance, written up as a Systems Manager document you run once per server or attach as a State Manager association for the whole estate. It comes from a rehost of 52 on-premises servers to AWS for a financial institution, 31 with the MGN agent and 15 agentless through vCenter.
Every migration guide stops at "cutover complete". This one starts there.
The service is AWS Transform MGN, called AWS Application Migration Service until June 2026. I call it MGN.
Terms I use:
  • Cutover instance. The final EC2 instance MGN launches from the replicated disks when you mark a server for cutover.
  • Post-launch action. An SSM document MGN runs on the instance after launch, if you turned post-launch actions on in the template.
  • Managed node. An instance the SSM Agent has registered with Systems Manager, so Run Command, State Manager and Patch Manager can reach it.
  • Baseline. The minimum set of agent, metrics, alarms and tags a server must have before I call it in production.
The estate this comes from:
Item
Value
Servers tracked
52
Replicated with the MGN agent
31
Replicated agentless through vCenter
15
Servers in the first two waves that launched with no SSM Agent reporting
9 of 14
Minutes per server to reach the baseline by hand, waves 1 and 2
about 45
Minutes per server after the document, waves 3 onwards
6, none of them a person's
- decision diagram, dark background. Title "Day one baseline". Start: Cutover instance running. Step

MGN moves the disks. It does not make the server operable. Five minutes after cutover you have a machine that boots, and nothing that tells you when it stops.

The state of a server five minutes after cutover

A cutover instance, five minutes in, if you did nothing but launch it:
  • EC2 status checks: 2/2, if the boot repairs from the last article held.
  • CloudWatch: CPU, network and disk I/O from the hypervisor. No memory. No disk free space. No process state.
  • Systems Manager: no managed node, unless MGN installed the agent as a post-launch action and the instance profile allows it to register.
  • Alarms: none.
  • Tags: whatever the launch template carried. Usually  Name  and nothing else.
  • Patch Manager: the server is in no patch group, so the next maintenance window skips it.
Operations teams inherit this and find out about it at the first incident. The baseline below is how we stopped that.

Step 1: get the server under Systems Manager

MGN can install the SSM Agent for you. Turn it on in Settings, Post-launch template: the first toggle installs the agent and allows actions on launched servers, and the deployment option should be test and cutover instances, so the test launch proves the path before cutover.
Installation is not registration. The agent registers only if the instance profile carries  AmazonSSMManagedInstanceCore  and the instance can reach the  ssm ,  ssmmessages  and  ec2messages  endpoints, through a NAT gateway or VPC interface endpoints. In the first two waves, 9 of 14 servers never showed up as managed nodes. Six had no instance profile at all, because the MGN launch template had been left at its default and the default carries none. Three had the profile and sat in a private subnet with no NAT and no interface endpoints. Not one was an agent problem. We spent the first afternoon blaming the agent.
Check from outside the instance:
aws ssm describe-instance-information \
--filters "Key=tag:MigrationWave,Values=wave-03" \
--query "InstanceInformationList[].{id:InstanceId,ping:PingStatus,agent:AgentVersion,os:PlatformName}" \
--output table
Every instance in the wave must appear with  PingStatus  =  Online . An instance missing from the list has not registered; an instance showing  ConnectionLost  registered once and then lost its route.

Step 2: the CloudWatch agent, with memory and disk

The hypervisor metrics do not include memory or free disk space. Both come from the CloudWatch agent, and both are what the rightsizing and capacity work later depends on.
Install and configure it through Systems Manager so you never RDP for this:
aws ssm send-command \
--document-name AWS-ConfigureAWSPackage \
--targets "Key=tag:MigrationWave,Values=wave-03" \
--parameters '{"action":["Install"],"name":["AmazonCloudWatchAgent"]}'
Then push the configuration from Parameter Store:
aws ssm send-command \
--document-name AmazonCloudWatch-ManageAgent \
--targets "Key=tag:MigrationWave,Values=wave-03" \
--parameters '{"action":["configure"],"mode":["ec2"],"optionalConfigurationSource":["ssm"],"optionalConfigurationLocation":["/baseline/cwagent/windows"],"optionalRestart":["yes"]}'
The Windows configuration in  /baseline/cwagent/windows  collects three counters and nothing more:
{
"metrics": {
"namespace": "CWAgent",
"append_dimensions": {"InstanceId": "${aws:InstanceId}"},
"metrics_collected": {
"Memory": {"measurement": ["% Committed Bytes In Use"], "metrics_collection_interval": 60},
"LogicalDisk": {"measurement": ["% Free Space"], "resources": ["*"], "metrics_collection_interval": 60},
"Processor": {"measurement": ["% Processor Time"], "resources": ["_Total"], "metrics_collection_interval": 60}
}
}
}
Within three minutes,  CWAgent  must show  Memory % Committed Bytes In Use  for the instance. If it does not, read  C:\ProgramData\Amazon\AmazonCloudWatchAgent\Logs\amazon-cloudwatch-agent.log  through Run Command, not RDP.

Step 3: five alarms, created from a template

The same five for every server. Thresholds are deliberately loose; a migrated server's normal is unknown for the first two weeks, and a page at 3am for a threshold nobody chose is how alarms get muted.
Alarm
Metric
Threshold
Period
Status check
 AWS/EC2 StatusCheckFailed 
> 0
2 of 2 x 1 min
CPU sustained
 AWS/EC2 CPUUtilization 
> 90%
3 of 3 x 5 min
Memory
 CWAgent Memory % Committed Bytes In Use 
> 90%
3 of 3 x 5 min
Disk free
 CWAgent LogicalDisk % Free Space 
< 10%
2 of 2 x 5 min
Agent heartbeat
 CWAgent Memory % Committed Bytes In Use 
missing data for 10 min
treat missing as ALARM
The fifth alarm matters most. It is the only one that fires when the agent itself dies, and a dead agent makes the other three silent.
Create them with one CloudFormation stack per server, parameterised by instance ID, deployed from the baseline document. The template is in the repo linked at the end.

Step 4: the tags that make the server manageable

Three tags, applied by the document, not by hand:
  •  Patch Group  = the patch baseline this OS and environment uses. Without it, Patch Manager uses the default baseline, or skips the server if your maintenance window targets by tag.
  •  Backup  = the AWS Backup plan tag. A rehosted server has no backup until this exists.
  •  MigrationWave  = the wave it came in. Every command above targets by this tag, and so does the audit later.
Confirm all three in one call:
aws ec2 describe-instances --filters "Name=tag:MigrationWave,Values=wave-03" \
--query "Reservations[].Instances[].{id:InstanceId,patch:Tags[?Key=='Patch Group']|[0].Value,backup:Tags[?Key=='Backup']|[0].Value}" \
--output table
No cell may be empty.

The document that does all four

One SSM Automation document,  Baseline-PostCutover , with four steps that map to the four sections above. Attach it as a State Manager association targeted by the  MigrationWave  tag, on a schedule of once per day, and every new cutover instance picks it up without anyone remembering to run it.
schemaVersion: '0.3'
parameters:
InstanceId: {type: String}
PatchGroup: {type: String}
mainSteps:
- name: WaitForSsm
action: aws:waitForAwsResourceProperty
inputs: {Service: ssm, Api: DescribeInstanceInformation, PropertySelector: "$.InstanceInformationList[0].PingStatus", DesiredValues: [Online],
Filters: [{Key: InstanceIds, Values: ["{{ InstanceId }}"]}]}
- name: InstallCwAgent
action: aws:runCommand
inputs: {DocumentName: AWS-ConfigureAWSPackage, InstanceIds: ["{{ InstanceId }}"], Parameters: {action: Install, name: AmazonCloudWatchAgent}}
- name: ConfigureCwAgent
action: aws:runCommand
inputs: {DocumentName: AmazonCloudWatch-ManageAgent, InstanceIds: ["{{ InstanceId }}"],
Parameters: {action: configure, mode: ec2, optionalConfigurationSource: ssm, optionalConfigurationLocation: /baseline/cwagent/windows, optionalRestart: "yes"}}
- name: Alarms
action: aws:createStack
inputs: {StackName: "baseline-alarms-{{ InstanceId }}", TemplateURL: "https://s3.me-central-1.amazonaws.com/<your-bucket>/baseline-alarms.yaml",
Parameters: [{ParameterKey: InstanceId, ParameterValue: "{{ InstanceId }}"}]}
- name: Tags
action: aws:createTags
inputs: {ResourceType: EC2, ResourceIds: ["{{ InstanceId }}"], Tags: [{Key: "Patch Group", Value: "{{ PatchGroup }}"}]}
The first step is the one people leave out. Every later step fails if the agent is not online yet, and the failure reads like a permissions problem.
What to know before you do it:  aws:createStack  needs the Automation role to have CloudFormation and CloudWatch permissions, not just SSM. Scope it to stacks named  baseline-alarms-* .

What it changed

By hand, across the first two waves, the four steps took about 45 minutes per server and were done by whoever was awake after the cutover window. Two servers were missed entirely and found by the patch compliance report three weeks later. With the association, from wave 3, a server reached the baseline about six minutes after it registered with Systems Manager, and the first time a person touched it was to read its alarms.
The number that mattered to the customer was different: zero servers in the later waves reached a maintenance window without a patch group.

What the runbook needs to say

  • Cutover complete is a replication state. In production is an operations state. They are different checkboxes.
  • The SSM Agent is installed by MGN and registered by your instance profile and network. Check both before you blame the agent.
  • Memory and disk free space come only from the CloudWatch agent. Install it on day one or you will have no data when the rightsizing conversation starts.
  • The heartbeat alarm is the one that catches a dead agent. Treat missing data as ALARM.
  • Tags drive patching, backup and audit. Apply them by document, never by hand.
If your post-cutover checklist has a step that is not in the four above, I would like to know what it is.
P.S. If you take one line from this: create the agent heartbeat alarm. Every other alarm depends on it and nobody creates it.

References

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article