- Newest
- Most votes
- Most comments
This is a common issue that can occur with EC2 instances. Even though the EC2 dashboard shows the instance as running with all status checks passed, the inability to connect via SSH and the failure of reboot commands suggest that the instance might be in a hung state. Here are some steps you can take to troubleshoot and potentially resolve the issue:
-
First, try to force stop the instance using the AWS CLI or AWS CloudShell if you haven't already. The command would be:
aws ec2 stop-instances --instance-ids your-instance-id --force
Wait a few minutes after issuing this command to see if the instance stops.
-
If the force stop doesn't work, you may need to take more advanced steps:
a. Stop the instance from the EC2 console, detach the root volume, and attach it to another healthy instance. b. Mount the detached volume on the healthy instance and inspect system logs for any errors. Look in the /var/log/ directory of the mounted volume. c. If you identify any problematic services, you can disable them. d. After making any necessary changes, detach the volume from the healthy instance and reattach it to the original instance.
-
If the problem persists, consider creating an AMI from the stuck instance using the create-image command with the --no-reboot option. Then, launch a new instance from this AMI.
-
As a last resort, if you're unable to resolve the issue, you may need to create a new instance from the most recent AMI or snapshot of your instance before the problem occurred.
Remember, while your instance is in this state, you are not being charged for its usage. However, it's advisable to work on resolving this quickly to minimize downtime.
If these steps don't resolve your issue, you may need to reach out to AWS Support for more specialized assistance.
Sources
Instance failed and won't reboot | AWS re:Post
Troubleshoot Amazon EC2 instance stop issues - Amazon Elastic Compute Cloud
To be able to ssh, you need to check the security groups and make sure inbound port 22 is allowed from your IP address. You can also add an IAM role (instance profile) that allows you to SSM into the server if you require access to it. The reboot option does not always change the launch time. Instead of reboot, you can try stop and then start the instance, this will change the underlying host and restart the instance. It will also have an updated launch time.
Relevant content
asked a year ago
