EC2 Automated upgrade failure: Windows 2012 to 2022

0

I've attempted to use the "AWSEC2-CloneInstanceAndUpgradeWindows" automation runbook to carry out the upgrade.

I had never used Systems Manager before, so I followed the steps in the documentation I had to run Quick Setup. This worked in most areas, although the association for "AWS-QuickSetup-SSMHostMgmt-ScanForPatches-kvszx" failed. (I don't know if this is relevant).

This created the role "AWSSystemsManagerDefaultEC2InstanceManagementRole" with the policy "AmazonSSMManagedEC2InstanceDefaultPolicy".

I have the following AWS Services on the server: AWS PV Drivers: v8.4.3 SSM Agent: v3.2.1705 EC2ConfigService: 4.9.5554.0

When I run the automation, I have specified the: Instance-id (selected from list) IAMInstanceProfile. = AWSSystemsManagerDefaultEC2InstanceManagementRole TargetWindowsVersion = 2022 SubnetID = value assigned to instance (The server can access Windows & Amazon website downloads normally)

Each time it runs, it fails during "serverUpgradeInstanceWithOriginalKeyPair" (Step 8 of "AWSEC2-CloneInstanceAndUpgradeWindows2019") with the error. "Value (AWSSystemsManagerDefaultEC2InstanceManagementRole) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 630736c3-9605-446c-94d6-5e6205f985cd; Proxy: null)"

Should I be entering a different value for IAMInstanceProfile, or do I need to give it more permissions?

On one occasion, I attempted to run automation while leaving "IAMInstanceProfile" blank. On that occasion, it timed out on "checkAfterWindowsUpgrade2019" (step 29 of "AWSEC2-CloneInstanceAndUpgradeWindows2019" ) which followed on from a success for "sleepForWindowUpgradeAndStart2022".

I'm guessing that I have missed a step somewhere, and need to add an extra permission or additional drivers.

Any help or suggestions gratefully received?

1 Answer
0
Accepted Answer

After a little more work, I was able to resolve this. In case it is useful for anyone else:

  1. I noted that the instance that I was cloning had an IAM Role associated with it. I believe this was stopping "AWSSystemsManagerDefaultEC2InstanceManagementRole" from being able to carry out the clone. I gave this IAM Role the "AmazonSSMManagedInstanceCore" policy and then used this role to carry out the automation.

  2. The timeout may have been caused by running the upgrade on a t2.small instance. I changed the instance type on the source instance to t2.large, and then ran automation. After this, I returned the source instance to t2.small.

Matt
answered 6 months ago
profile picture
EXPERT
reviewed 23 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions