Skip to content

EC2 Instance stuck in stopping

0

Hi everyone currently new to ec2 set ups. I was following a simple demo to start a server using ec2: https://aws.amazon.com/blogs/gametech/cost-optimize-your-minecraft-java-ec2-server/ While cleaning up the resources to avoid incurring more costs I see that the instance is stuck in stopping. I've tried forcing it to stop but no luck. Is there a way to stop the container?

asked a month ago100 views

3 Answers
0
Accepted Answer

You don't need to stop it. The demo's cleanup step is to terminate the instance, and you can terminate it even while it's stuck in "stopping."

  1. In the EC2 console, select the instance, then choose Instance state → Terminate (delete) instance. Termination removes the instance and, by default, its root volume.
  2. Release the Elastic IP under EC2 → Elastic IPs → Actions → Release Elastic IP addresses. An unattached Elastic IP keeps costing money even after the instance is gone.
  3. If you created the /mc/ram or /mc/shutdowntimer parameters, delete them in Systems Manager → Parameter Store.

A few notes:

  • There's no container to stop. This setup runs Minecraft directly on the instance as systemd services. Terminating the instance removes all of it.
  • You aren't charged compute time for a stopping instance. EC2 bills instance usage while it's running, and the stopping state doesn't count unless you chose hibernate. Attached EBS volumes and the Elastic IP do keep billing, which is why steps 1 and 2 matter.
  • If termination also gets stuck, wait about 30 minutes. AWS usually clears stuck instances on its own. If it's still there after that, open an account and billing case, which is free on every support plan, with the instance ID, and AWS can remove it.

After cleanup, check Billing → Bills over the next day or two to confirm nothing else is still running, such as leftover EBS volumes or snapshots.

EXPERT

answered a month ago

EXPERT

reviewed a month ago

  • Thank you! I Just tried it and it did show up the state as terminated. I will keep an eye on the billing.

0

When an EC2 instance gets stuck in the stopping state, it's typically due to an underlying hardware issue with the host computer. Here's how you can resolve this:

First, try force stopping the instance through the EC2 console:

  1. Navigate to the EC2 console and select your stuck instance
  2. Choose Instance state, then Force stop instance
  3. Optionally, you can select the Skip OS shutdown checkbox to bypass the graceful shutdown
  4. Confirm the force stop

The force stop method first attempts a standard stop, and if the instance remains stuck, it will forcibly shut down the instance and transition it to the stopped state.

If force stopping through the console doesn't work, you can also try using the AWS CLI to force stop the instance.

Important note: While force stopping may result in some data loss or corruption (since it bypasses normal shutdown procedures), the good news is that you won't be charged for instance usage while it's in the stopping state or any state other than running.

If force stopping continues to fail after multiple attempts, you can reach out for help on AWS re:Post or create a technical support case through the AWS Support Center at https://console.aws.amazon.com/support/.

As a last resort, if the instance remains stuck, you can create a replacement instance by taking an Amazon Machine Image (AMI) from the stuck instance and launching a new instance from that AMI.
Sources
Troubleshoot Amazon EC2 instance stop issues - Amazon Elastic Compute Cloud
Methods for stopping an instance - Amazon Elastic Compute Cloud

answered a month ago

0

If an EBS-backed EC2 instance remains in the stopping state, AWS provides a Force stop operation specifically for this scenario. You can use: aws ec2 stop-instances
--instance-ids <your ID>
--force

The force-stop operation first attempts the normal shutdown and then forcibly stops the instance if it remains stuck. However, force stopping can potentially cause filesystem corruption or loss of in-flight I/O because the graceful OS shutdown may not complete. After the instance is stopped, it is therefore recommended to perform the appropriate filesystem checks before relying on it again. If the instance still hasn't stopped after approximately 10 minutes, AWS recommends opening a re:Post question or an AWS Support case and providing the instance ID and the troubleshooting steps already performed. Also, an EC2 instance in stopping is not charged for instance usage; EBS storage charges continue while the volumes remain.

answered a month 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.