Skip to content
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

EC2 instances usage should only count 'running' instances #101

Closed
pdecat opened this issue Nov 30, 2015 · 2 comments
Closed

EC2 instances usage should only count 'running' instances #101

pdecat opened this issue Nov 30, 2015 · 2 comments
Labels
Milestone

Comments

@pdecat
Copy link

pdecat commented Nov 30, 2015

Hi,

I believe the Running On-Demand EC2 instances AWS service limits only count EC2 instances in the running state.

I could not find any explicit statements on that subject in the AWS documentation but I have got the case where my instances count is above the service limit:

# awslimitchecker --list-limits | grep "Running On-Demand EC2 instances"
EC2/Running On-Demand EC2 instances                    200 (API)

# awslimitchecker --show-usage | grep "Running On-Demand EC2 instances"
EC2/Running On-Demand EC2 instances                    207

Filtering on the instance state, I currently have:

  • 170 running instances
  • 22 stopped instances
  • 11 terminated instances
@jantman
Copy link
Owner

jantman commented Nov 30, 2015

@pdecat You're right, sorry. I've missed that this whole time (I guess because none of my employers leave many stopped instances around). The relevant code is https://github.com/jantman/awslimitchecker/blob/master/awslimitchecker/services/ec2.py#L83

I'll try to get a fix for this tonight or tomorrow. Thanks for taking the time to make me aware of this!

@jantman
Copy link
Owner

jantman commented Dec 1, 2015

@pdecat I'm not sure how I missed this, but the code that I referenced above handles reserved instances; it explicitly queries all active reservations (by AZ and instance type) and subtracts that from the on-demand instances. It does not, however, ignore instances in the "stopped" or "terminated" instance state.

I've got a fix for this and will be making a bugfix release shortly.

@jantman jantman added the bug label Dec 1, 2015
@jantman jantman added this to the 0.2.1 milestone Dec 1, 2015
@jantman jantman closed this as completed in c2249ec Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants