Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my AWS EC2 Instance terminates when stopped?

Everytime I stop my AWS EC2 instance, it terminates automatically with a few seconds. Additionally a new instance is created. Can anyone suggest why this would be happening?

like image 618
Vaishali Avatar asked Oct 05 '13 06:10

Vaishali


2 Answers

Because it is part of an Auto Scaling group.

According to AWS Support, it is normal behavior to Terminate an instance when you tell it to Stop if it is part of an Auto Scaling group. My Termination Protection was set to Stop but apparently it overrides this setting.

In order to Stop an instance that's part of a Auto Scaling group and NOT Terminate it, you must Detach it from the Auto Scaling group before stopping it: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/detach-instance-asg.html

I just went through this

like image 145
user4637795 Avatar answered Oct 23 '22 22:10

user4637795


You can choose the shutdown behavior of your EC2 instance when creating it.

Selecting some options will default and/or force you to termination on stop.

See EC2's documentation for more information.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html

like image 37
Thibault D. Avatar answered Oct 23 '22 22:10

Thibault D.