Skip to content

EC2 instance not restarting

0

Hello an EC2 instance stopped responding to API calls (it is an api server), we were unable to login to the instance using SSH + key, using the AWS console connect, we tried to restart/stop/force stop and the instance is stuck in "stopping" and would not respond to any additional commands.

asked 2 years ago296 views

2 Answers
0

I understand you're facing a challenging situation with your EC2 instance. When an instance is unresponsive and stuck in the "stopping" state, there are a few steps you can take:

  1. Try using the AWS CLI to force stop the instance. The command would be:

    aws ec2 stop-instances --instance-ids your-instance-id --force

    This CLI command can sometimes be more effective than using the console.

  2. If the force stop doesn't work after a few minutes, the next step is to seek direct assistance from AWS. You have two options:

    a. Post a request for help on AWS re:Post, including your instance ID and describing the steps you've already taken.

    b. If you have an AWS support plan, create a technical support case in the AWS Support Center for faster, more tailored assistance.

  3. While waiting for a response, consider creating a replacement instance as a temporary solution:

    • Create an Amazon Machine Image (AMI) from the stuck instance.
    • Launch a new instance using this AMI.
    • Update your DNS or load balancer settings to point to the new instance.
  4. Be aware that if the instance remains stuck for several hours, Amazon EC2 may eventually treat it as a stuck instance and forcibly terminate it. However, this is not guaranteed and can take a considerable amount of time.

  5. For future reference, it's important to investigate why the instance is not stopping properly to prevent similar issues. This could be related to processes running on the instance, instance store volumes, or other factors that AWS support can help identify.

Remember, while your instance is in the 'stopping' state, you are not being charged for its usage. However, given that it's an API server, pursuing immediate assistance from AWS support is advisable to minimize downtime.

Sources
What do we do when an instance won't reboot or even force stop? | AWS re:Post
Troubleshoot Amazon EC2 instance stop issues - Amazon Elastic Compute Cloud
My instance not stopping and it is stuck since more than 20 mins now. URGENT PLEASE HELP | AWS re:Post
My Ec2 instance stops completely and does not stop. | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

0

When an instance is stuck stopping for a while (> 20 mins) you can issue a CLI command with the --force parameter to stop it:

aws ec2 stop-instances --instance-ids <instance-id> --force

Just bear in mind, that this option may result in the file-systems not flushing their caches to disk, before stopping, so be sure to check file-system integrity after you restart the instance.

AWS
EXPERT

answered 2 years ago

EXPERT

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