Error message when quota exceeded is incorrect and confusing

Bug #998199 reported by Gabe Westmaas
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Pádraig Brady

Bug Description

Right now when quota is exceeded (for any reason - RAM, instance count, CPU count, etc) you will get a message that says:
OverLimit: Quota exceeded: already used 1 of 1 instances.

Or more accurately, the two numbers will always be the same and will have the value of the maximum number of instances requested.

This is the case no matter how many instances are allowed by the quota.

Correct behavior should be:
assuming 1 2GB server requested, 50 instances allowed, 50GB of ram allowed, 50 instances used and 48GB of RAM used:
OverLimit: Quota exceeded: already used 50 of 50 instances.

and assuming 1 2GB server requested, 50 instances allowed, 50GB of ram allowed, 49 instances used and 49GB of RAM used:
Something different, I'm not sure what

Revision history for this message
Mohammed Naser (mnaser) wrote :

I believe that when you're getting that error, it is being raised by the following:

https://github.com/openstack/nova/blob/master/nova/compute/api.py#L187

I think that the issue is that you have your instance quota limit set to 1 instance, therefore you're hitting the instance check and failing it and it never even gets to the other memory and disk checks, because it just stops at the instance

https://github.com/openstack/nova/blob/master/nova/compute/api.py#L351

Let me know if you do not have your quota set at 1 instance.

Revision history for this message
Gabe Westmaas (westmaas) wrote :

Sadly that is not the case :)

Sorry, I should have said this in my original bug report, but I believe the combination of these two lines is the problem:
https://github.com/openstack/nova/blob/master/nova/compute/api.py#L196
https://github.com/openstack/nova/blob/master/nova/compute/api.py#L203

Basically the "maxcount" is being used as the quota count and the current server count, but that is actually the number of servers requested. So, for example, if it was a single api call that requested 4 servers, it would have said that I had used 4 out of 4 instances, assuming I was over quota.

The quota check itself is valid, its just the error message that is incorrect.

Alex Meade (alex-meade)
Changed in nova:
status: New → In Progress
assignee: nobody → Alex Meade (alex-meade)
importance: Undecided → Medium
Alex Meade (alex-meade)
Changed in nova:
status: In Progress → Confirmed
assignee: Alex Meade (alex-meade) → nobody
Changed in nova:
assignee: nobody → Pádraig Brady (p-draigbrady)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/8179
Committed: http://github.com/openstack/nova/commit/84969afb3bfd467a2f48cf030a325c1a2fcd13ca
Submitter: Jenkins
Branch: master

commit 84969afb3bfd467a2f48cf030a325c1a2fcd13ca
Author: Pádraig Brady <email address hidden>
Date: Tue Jun 5 14:33:43 2012 +0100

    fix the instance quota overlimit message

    This addresses two closely related bugs.

    Bug: 998199
    Fix the "used" and "total" counts
    in the returned diagnostic.

    Bug: 902218
    Itemize instance quota items exceeded,
    in the returned diagnostic.

    Change-Id: Iff7781a7fb53545d44c2b4ec0ca6d65114723c8d

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-2 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.