snippetModerate
How to check AWS spot pricing automatically?
Viewed 0 times
pricingspotautomaticallyawshowcheck
Problem
I've been thinking about a Jenkins job to check the pricing for the agent boxes we spin up; every so often the price spikes and it'll be an hour or two before anyone notices that no new agents are coming up, and then we have to go in manually and check the spot price and adjust accordingly, or switch zones, etc.
My first instinct was that the best route is to have an hourly Jenkins job that runs a
Anyone set up something similar? How'd you do it?
My first instinct was that the best route is to have an hourly Jenkins job that runs a
aws ec2 describe-spot-instance-requests and checks for failed requests (and then slacks us on a failure). But I'm wondering if there's a cleaner method that involves actually comparing hard prices (and could therefore tell us exactly what's off, and by how much), rather than looking at successful/failed requests. Anyone set up something similar? How'd you do it?
Solution
Spotted an open source tool called autospotting that just might help with this:
Once enabled on an existing on-demand AutoScaling group, it launches an EC2 spot instance that is cheaper, at least as large and configured identically to your current on-demand instances. As soon as the new instance is ready, it is added to the group and an on-demand instance is detached from the group and terminated.
We have this in our to-do pipeline, will be able to add more context once we finish that.
Update:
Another tool that was recently demo'ed in a conference was mapbox/spotswap
This works slightly differently. It monitors a normal ASG with either On-Demand or Reserved instances and then, if scale arises, bids and provisions spot instances of similar compute level on a separate ASG.
Once enabled on an existing on-demand AutoScaling group, it launches an EC2 spot instance that is cheaper, at least as large and configured identically to your current on-demand instances. As soon as the new instance is ready, it is added to the group and an on-demand instance is detached from the group and terminated.
We have this in our to-do pipeline, will be able to add more context once we finish that.
Update:
Another tool that was recently demo'ed in a conference was mapbox/spotswap
This works slightly differently. It monitors a normal ASG with either On-Demand or Reserved instances and then, if scale arises, bids and provisions spot instances of similar compute level on a separate ASG.
Context
StackExchange DevOps Q#927, answer score: 15
Revisions (0)
No revisions yet.