-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for spot instance #51
Comments
@EmilVarona I hadn't planned on it, but I'd have nothing against it. The main problem is that I don't have access to an AWS account with any spot instances - we don't use them at all. So I'd either need someone to cut a pull request for this, or else I'd need someone to:
-Jason |
Thanks for considering this Jason. I can give it a shot but my time it limited and my coding skilz, well, a bit less than adequate. I'll reach out to you directly for questions. Cheers, |
Emil, Ok. If you can handle helping me figure out my question (#1 above) about the limits we'd need to check and how to calculate them, and you're willing to help test the code by installing off of a branch, I can probably give it a shot. |
It looks like they've added more spot instance limits; the docs now say that there are spot request limits per instance-type and per region. There's a spot bid price limit, which doesn't say whether it's per instance type, region, or global (the fact that it's just a multiplier times the on-demand price suggests that the multiplier might be global). They also list 5 new spot fleet limits, some of which sound like they're per region, and some sound like they're per-fleet. My employer uses a lot of spot instances, I could probably run test code for you if you're interested. |
@jleader Thanks for updating this. Can you confirm if http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-limits.html lists all of the spot limits? This is going to be a bit difficult for me to develop, since we don't use any spot limits. But I can probably take a crack at a branch of awslimitchecker that tries to get spot usage, which you could install and tell me if it works right. If we can figure out - or find any public documentation confirming - exactly how the limits are calculated, that would be great. If not, I can try to reach out to a few personal contacts at AWS, but I can't use my employer's support for my F/OSS work. If anyone else ( @EmilVarona ? ) would be willing to test the branch and see if the usage and limits seem right, it would be greatly appreciated. I'm really busy this week, but I can try to get something started in the next few days. |
I just wanted to comment that on the "Limits" page of the EC2 Console for my employer's two accounts, as well as my two personal accounts, the only spot-related limit listed is the one "Spot instance requests". It also appears that Trusted Advisor doesn't yet include anything spot-related. |
…d solely on API docs) with LOTS of debugging for others to test with
@jleader @EmilVarona I've pushed up some initial code for spot instances and fleets in the issue51 branch. You can install this in a new virtualenv with:
And run (for just EC2) with:
Note that this requires new IAM permissions, You should get a bunch of debug output, which includes information about each spot instance and fleet. I'll remove that before this is merged, but thought it might help with testing. I've implemented (once again, just going by the API) the following limits:
I've assumed that |
It wrote the following to stderr:
Here's the stdout after grep'ing for "spot":
|
Hmm... so the first two ("does not yet support spot instances" and "NOT counting spot instance [...] state=cancelled") are expected. If you don't have any spot fleet requests, then all of the fleet limits being 0 or (no data) makes sense. However, "Counting spot instance request sir-X state=active" doesn't make sense with the output of "EC2/Max spot instance requests per region 0". I ran the code myself, replacing the describe_spot_instance_requests API call with a test fixture API response, and I'm seeing the results I expect... so I'm not terribly sure what's going on here. I pushed up two commits , c36b2db and 20b9b7f, that add a bit more explicit debugging. I checked all 20 of my employer's AWS accounts, and confirmed we don't have any spot instance requests. Sometime in the next few days I'm going to try opening some spot instance requests on my personal account with unrealistically-low bid prices (which should keep them from running in the short term), test this myself, and then cancel them. |
@jleader I hacked together a script (admittedly including some things specific to my test account) that creates instance and fleet requests at half of the current market price and a ValidFrom of 2 weeks in the future, so they should never run. As far as I can tell, everything looks to be working correctly. Could you pull down the latest commits on that branch and run again with the added debug code? I can't seem to find anything that would cause the discrepancy you're seeing. |
…d solely on API docs) with LOTS of debugging for others to test with
@jleader @EmilVarona Thanks to some anonymous assistance, I've been able to get access to an account that makes use of spot instances and fleets and test this, and will be able to release experimental support soon. Still TBD (need advice on #1):
|
#51 - Experimental Spot Instance Support
Ok, I've merged the experimental PR for this. It will be present in the next release. |
I'm reopening this as (1) it's not yet merged, and (2) I've had some private discussion with someone via email trying to figure out exactly how the limits work (his experience with spot instances indicates that the limit is on instances, not requests). I've opened a thread on the AWS forum asking for clarification about spot limits. Some research:
|
@EmilVarona @jleader sorry for the delay; this is now released in 0.5.1 and live on PyPI |
Just came across this useful tool. Can you please tell me if you plan to add support for reporting on spot instances when running
awslimitchecker -u
? Most of our instances are spot and this would help very much. Thanks for considering this.The text was updated successfully, but these errors were encountered: