4

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

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.

| improve this answer | |
  • 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 '17 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 '17 at 17:13
  • 1
    Spot Instances are subject to per second billing: aws.amazon.com/ec2/pricing – Matt O. Dec 21 '17 at 20:57
1

Cancelling spot requests is good if you have created a 'persistent' spot instance. If you try terminating a spot instance in the EC2 console when its 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 spot instance and also cancel any future rebuilds of this instance. So this means you will not have another instance spin up when the first spot 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. Click one and you can find the instance ID.

Yes, spot does save a lot of money compared to on-demand but this feature is a bit annoying as I didn't realise it for a while. So I was terminating instances but didn't realise new instances were spinning up in their place. Working on a lambda and cloudwatch event that will cancel the spot request once the instance is terminated

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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