简体   繁体   中英

Why EC2 instance is stopping again and again?

I can't keep my EC2 instance in running state. Whenever I start the instance it always changing back to "Stopped" state. I tried many ways like they mentioned in this official page here .

  1. Stopped and restarted the instance - didn't work
  2. Created an alternate image of the current instance and launched a new instance with that image and started it. - didn't work
  3. Finally, made a snapshot of current volume of stopped instance. Then created anew volume with that snapshot. Launched a new instance with a new AMI and stopped it. Then detached the root volume of new instance and attached the newly created volume as root volume. Then started the instance - didn't work though.

UPDATE: when I run below command to check the reason for the issue

aws ec2 describe-instances --instance-id MYINSTANCE --output json

it response with below issue

"StateReason": {
                    "Code": "Client.InstanceInitiatedShutdown",
                    "Message": "Client.InstanceInitiatedShutdown: Instance initiated shutdown"
                },

What am I missing here?

You can try below

  • Create another fresh instance and ensure its working fine
  • Remove storage from this instance and attach it to the affected instance
  • Start your affected instance now which is having new latest storage (make sure to remove old storage)

If it works then it means there is some issue in the storage drive only.


If the above does not work then there is also possible some hardware issue. you can try creating same instance in different region with the same image to see if it works in different region or not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM