Find out what EC2 Spot Instances are currently available #7021
Unanswered
RomanJobRunr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on trying to launch EC2 spot instances automatically from Java, I have a list of instance types and I am trying to launch a spot instance among those.
Currently it's possible that the spot instance type that I choose to try and launch is currently not available, so my request could either get CLOSED, FAILED or have a status containing "capacity-not-available". The way that I am currently doing this is looping over my list of instances and I'm checking for those statuses manually and if one of those happens then I try for the next instance type.
I want to know if there is a better way of doing this last part, is there a way for me to find out which spot instance type has capacity available at the moment without trying to create it first? Preferably not using any APIs that are severely rate limited.
A sample similar to what I am doing is below:
And a section of the monitoring method:
Beta Was this translation helpful? Give feedback.
All reactions