Introduction

An EC2 instance that is stuck in stopping has started the shutdown path but has not completed it cleanly. In practice this often means the guest OS is hung during shutdown, attached resources are not detaching normally, or the instance is unhealthy enough that AWS cannot complete the normal stop lifecycle promptly.

Symptoms

  • The instance stays in stopping much longer than normal
  • You cannot start or reboot the instance because the stop never completes
  • Attached volumes or ENIs remain tied to the instance
  • The issue often follows high I/O, kernel hangs, or forced process termination

Common Causes

  • The guest OS is hung while shutting down services or flushing storage
  • Attached EBS activity or filesystem issues slowed or blocked stop completion
  • Instance health was already degraded before the stop request
  • Shutdown scripts or lifecycle hooks never finished cleanly

Step-by-Step Fix

  1. 1.Check how long the instance has been stopping
  2. 2.Confirm this is a real hang and not just a slow stop under load.
bash
aws ec2 describe-instances --instance-ids i-1234567890abcdef0
  1. 1.Review console output and resource attachments
  2. 2.Look for guest shutdown hangs and verify what is still attached to the instance.
bash
aws ec2 get-console-output --instance-id i-1234567890abcdef0 --latest
aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=i-1234567890abcdef0
  1. 1.Use force stop only after checking the workload
  2. 2.Force stop is often the practical fix, but treat it like pulling power on the VM. Make sure you understand the data risk first.
bash
aws ec2 stop-instances --instance-ids i-1234567890abcdef0 --force
  1. 1.Validate the instance before starting it again
  2. 2.After the stop completes, review filesystem or application integrity before returning it to service.
bash
aws ec2 describe-instance-status --instance-ids i-1234567890abcdef0 --include-all-instances
aws ec2 start-instances --instance-ids i-1234567890abcdef0

Prevention

  • Avoid treating force stop as a routine recovery action
  • Monitor I/O pressure and shutdown duration on critical EC2 instances
  • Keep application shutdown hooks short and observable
  • Rehearse recovery for instances with stateful workloads before incidents happen