Skip to content

Unable to reboot EC2 Instance

0

Web Console indicates EC2 instance is running (Status 2/2 checks passed), but unable to connect via ssh (no response to ssh from command line) and selected Reboot from Web Console Instance State options and other reboot links does not reboot instance. Launch time indicated remains the same as last reboot two weeks ago.

asked a year ago384 views

2 Answers
0

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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

answered a year ago

EXPERT

reviewed a year ago

0

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.

EXPERT

answered a year ago

EXPERT

reviewed a year 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.