- Newest
- Most votes
- Most comments
The issue you're experiencing with the SSM Agent failing to restart after a Patch Manager reboot on Amazon Linux 2022 is a known problem that can occur in certain situations. Here are some potential causes and solutions to address this issue:
-
IAM Role Permissions: Ensure that the IAM role associated with your EC2 instance has the necessary permissions to interact with Systems Manager. The role should have the "AmazonSSMManagedInstanceCore" managed policy attached or equivalent permissions.
-
Instance Metadata Service (IMDS) Access: Verify that the EC2 instance has access to the Instance Metadata Service. This is crucial for retrieving temporary credentials to authenticate with AWS services.
-
Security Group and VPC Configuration: Check that your instance's security group and VPC allow HTTPS (port 443) outbound traffic to the required Systems Manager endpoints: ssm.region.amazonaws.com, ec2messages.region.amazonaws.com, and ssmmessages.region.amazonaws.com.
-
VPC Endpoints: If your VPC doesn't have internet access, ensure you have the necessary VPC endpoints set up for Systems Manager.
-
SSM Agent Configuration: Verify that the SSM Agent is properly configured and set to start automatically on boot. You may need to manually restart the SSM Agent after the reboot or configure it to start automatically.
-
Network Connectivity: Ensure there are no network issues preventing the SSM Agent from communicating with the Systems Manager service after reboot.
-
OS-level Changes: Check if any OS-level changes during patching might be affecting the SSM Agent's ability to start automatically.
To resolve this issue:
- Manually restart the SSM Agent after reboot if it doesn't start automatically.
- Configure the SSM Agent to start automatically on boot using systemd or the appropriate init system for Amazon Linux 2022.
- Review and update the IAM role permissions, security group rules, and network configurations as needed.
- Consider implementing a custom script or user data that checks and restarts the SSM Agent if it's not running after a reboot.
If the problem persists after trying these solutions, you may need to open a support ticket with AWS for further assistance, as there could be underlying issues specific to your environment or the Amazon Linux 2022 configuration.
Sources
statuscheckfailed_instance still unreachable after reboot and shutdown restart | AWS re:Post
Why my instance stop working? | AWS re:Post
SSM Agent is not online. The SSM Agent was unable to connect to a Systems Manager endpoint to register itself with the service. | AWS re:Post
Hello.
Is it possible to manually restart SSM Agent?
Do any errors occur when restarting?
Please enable debug mode and check the logs listed in the document below.
https://repost.aws/knowledge-center/ssm-agent-logs
https://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent-logs.html
Relevant content
- asked 7 months ago
- asked 3 years ago
- AWS OFFICIALUpdated 8 months ago
