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?

Matt
已提問 6 個月前檢視次數 290 次
1 個回答
0
已接受的答案

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
已回答 6 個月前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南