- Newest
- Most votes
- Most comments
The instance may have Auto Recovery set to true. The link shows how to disable this.
I've been able to recreate this behavior on both Ubuntu 20 and 22. Though, I can not recreate it consistently. Seems to happen more often on t2.small vs t3.small. Also, seems to happen more often the first time I issue the sudo shutdown -h now
command. But after that first failure, it works as expected. All of this was independent of the Auto Recovery setting. Recommendation at this point is to use the stop-instances API for consistent behavior. See: Instance Scheduler
@kentrad thanks!
There is still some mystery to it, because I re-verified that on Ubuntu 20 auto recovery didn't need to be adjusted.
Not sure what's possible and what's not possible but the ideal behavior would be that a manual shutdown by issuing the shutdown
command would stop the instance, and a crash would auto recover. However, if aws can't distinguish the difference between those two conditions, then maybe it has no choice but to reboot both of them.
The behavior recently changed so mostly likely connected the age of the instance (when it was created) than the Ubuntu version. https://aws.amazon.com/about-aws/whats-new/2022/03/amazon-ec2-default-automatic-recovery/
You could also use the Instance Scheduler instead of an internal cron. https://aws.amazon.com/solutions/implementations/instance-scheduler-on-aws/
Relevant content
- asked 4 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
Although this idea "The behavior recently changed so mostly likely connected the age of the instance" sounds very plausible and more believable, I have just retested another time, and the results are as follows. A new ubuntu 20 instance can be shutdown from the command line. A new ubuntu 22 instance gets auto restarted.
Interesting. I'll give it a try today.