I had a use case where I was switching to using spot instances for my application instead of on demand instances. According to my requirement i should be able to stop that instance and restart it just the way we do it for on demand ec2-instances. In the aws console, i only found the option to reboot or terminate my instance and hovering over the stop option said "Spot instance cannot be stopped". Is there a workaround to allow stopping the instance or is it not possible as of now?
3 Answers
[Original: September 2018]
You yourself cannot stop a spot instance.
You can, however, specify that the interruption behavior for a spot instance is "stop" (instead of "terminate"). When an interruption event happens, your instance will be shut down and its state will be saved. When capacity is next available with your price/time requirements, AWS will restart your instance.
This feature is available for persistent Spot requests and Spot Fleets with the “maintain” fleet option enabled. You will not be charged for instance usage while your instance is stopped.
[Updated: February 2020]
Per announcement on Jan 13, 2020:
You can now stop your Amazon EC2 Spot Instances backed by Amazon EBS and start them at will, instead of relying on the “Stop” interruption behavior to stop your Spot Instances when interrupted. Earlier, you could only terminate your Spot Instances but now you can stop your Spot Instances and start them from the user initiated stop state provided Spot capacity is available within your maximum price requirements.

- 71,565
- 16
- 115
- 122
-
7Don't forget the storage costs while instances are in the stopped state. – John Hanley Sep 06 '18 at 12:29
-
2@kush , the one who updated the latest announcement, thanks for the update. I checked everywhere, everywhere it says that it is achievable now, but no where I found any guide to achieve that. It will be great if you include steps and config to achieve the same. – Rakmo Apr 10 '20 at 20:02
As of Jan 13, 2020, you can now do this: https://aws.amazon.com/about-aws/whats-new/2020/01/amazon-ec2-spot-instances-stopped-started-similar-to-on-demand-instances/

- 4,784
- 4
- 26
- 33
You cant STOP/START Spot instance as similar to On-demand. below Link has enough info.,
"You can't stop and start an Amazon EBS-backed instance if it is a Spot Instance (only the Spot service can stop and start a Spot Instance), but you can reboot or terminate a Spot Instance)"
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html

- 11
- 2
-
in that link, it says "You can stop, start, reboot, or terminate an Amazon EBS-backed instance". But in the really I can't stop my spot instances, it always says "An On-Demand Instance specified in an EC2 Fleet or Spot Fleet cannot be interrupted." – aborilov Jul 06 '20 at 12:55