5

I just started getting familiar with EC2's Spot Requests and Spot Instances (1 day into it!). I understand that I can save some money doing a Spot Request to create a Spot Instance as opposed to creating an on-demand Instance.

What I don't understand is the correct way to "shut things down". If I want to make sure that I'm no longer charged, do I need to to cancel the Spot Request and terminate the Spot Instance?

I noticed that I could solely terminate the Spot Instance: what would this mean in terms of my Spot Request which exists without my instance?

2 Answers 2

3

Canceling spot requests is good if you have created a 'persistent' spot instance. If you try terminating a spot instance in the EC2 console when it's set as 'persistent', a new spot instance will spin up in its place in a few minutes.

However, if you cancel the spot request this will terminate the current spot instance and also prevent any future rebuilds of this instance. So this means you will not have another instance spin up when the first is terminated. To cancel the spot request, go to the panel on the left 'spot requests' and here you will see all the ones you have created. Search for your instance ID and you will find the associate spot request.

Yes, spot does save a lot of money compared to on-demand but this feature is a bit annoying as I didn't realize it for a while. I was terminating instances but didn't realize new instances were spinning up in their place.

EDIT When canceling spot requests now, it gives you the option if you would like to terminate the instance also

2

You can definitely cancel your spot instance requests via the Management Console and via the CLI. There appears to be a command to terminate the instance also.

See the following AWS docs as a reference:

AWS Docs - Cancel Spot Instance

As for terminating just the spot instance, I'm not sure but I think the, still active, spot request would spin up the instance once the spot price matches the request again.

** Edit **

Worth noting that if you terminate the spot instance within an instance hour then you pay for the full hour, even if you only used a few minutes of it.

3
  • 1
    Hmmm.... I just found " If you terminate your Spot Instance in the middle of an instance hour—be it the first or any subsequent hour—you are charged for your usage rounded to the nearest second." Source: docs.aws.amazon.com/AWSEC2/latest/UserGuide/….
    – Eric
    Oct 19, 2017 at 16:35
  • Pretty much - and if Amazon terminate it within that hour then you get the hour for free. Pretty cool.
    – mac
    Oct 19, 2017 at 17:13
  • 1
    Spot Instances are subject to per second billing: aws.amazon.com/ec2/pricing
    – Matt O.
    Dec 21, 2017 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.