Is Shutting Down a Spot Amazon EC2 Instance Clean?
Not sure if this is supposed to be on SuperUser or here, but here goes:
Q. If my spot instance is automatically terminated due to my max bid being exceeded, is it a clean shutdown -- as if a user clicked Start>>Shutdown ? Or is it a hard shutdown -- as if someone just yanked out the power cord?
I realize that in most cases the volumes on a terminated spot instance are deleted immediately, making my question moot. But in this particular case, I have the "delete volume on terminate" flag set to false so as to retain the root volume; I may want to reuse that volume and bind it to another instance in the future. Thus my concern regarding whether or not the forced shutdown is "clean." A clean shutdown would reduce or eliminate the possibility of data corruption on the root volume.
UPDATE (08/11/2013): I already marked a response as the answer but now I'm not sure it's correct. I just received a contradictory response from someone on the Amazon forum:
The instance will be shutdown gracefully and then the volumes with "Delete on Termination" set as false will be detached.
So, I'm still uncertain what the actual answer is. Anyone want to go for a tiebreaker on this one?
Q. If my spot instance is automatically terminated due to my max bid being exceeded, is it a clean shutdown -- as if a user clicked Start>>Shutdown ? Or is it a hard shutdown -- as if someone just yanked out the power cord?
It might be a clean shutdown, but it also might be a hard shutdown. Amazon's wording implies they try to make it clean but don't make any promises.
Check this out: http://aws.amazon.com/ec2/spot-instances/#6
The highlights are this:
Because Spot Instances can be terminated without warning, it is important to build your applications in a way that allows you to make progress even if your application is interrupted.
And more importantly, this:
While we attempt to cleanly terminate your instances, your application should be prepared to deal with an immediate shutdown.