HiveBrain v1.2.0
Get Started
← Back to all entries
principleMinor

Cancel a Spot Request vs Terminate Spot Instance

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
terminatespotrequestcancelinstance

Problem

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?

Solution

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

Context

StackExchange DevOps Q#2352, answer score: 3

Revisions (0)

No revisions yet.