absolute limits API doesn't take user quotas into account

Bug #1337991 reported by Phil Day
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

The limits API always returns the per tenant limits and not any per-user limits that may exist.

https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/limits.py#L94-95

The call to get_project_quotas should be replaced with a call to get_user_quotas.

A similar problem exists in used_limits, as this reports overall tenant consumption and not the corresponding per user value.

I suspect this just got missed when per-user project quotas were introduced.

However if we do switch to showing the per user values for limits and used
it is possible that a user might see a different set of confusing values:

Project Quota = 10
User Quota = 5
User Usage = 1
Other User Usage = 9

If we show just the overall project usage and quota we get (used=10, quota=10) - which shows that the project quota is fully used.

However if we show just the user quotas we get (used=1, quota=5), which
suggests that there is capacity.

Conversely if:
Project Quota = 10
User Quota = 1
User Usage = 1
Other User Usage = 2

If we show just the overall project usage and quota we get (used=3, quota=10) - which shows that the project quota is not fully used.

However if we show just the user quotas we get (used=1, quota=1), which
suggests that this user doesn't have any available quota.

So maybe the limits API now needs to return both the project and user level limits.

Tags: api quotas
Revision history for this message
Thang Pham (thang-pham) wrote :
Changed in nova:
assignee: nobody → Thang Pham (thang-pham)
Phil Day (philip-day)
description: updated
Tracy Jones (tjones-i)
tags: added: api
Changed in nova:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Thang Pham (thang-pham) wrote :

I am looking into this and working on getting a patch out soon. Just to clarify - nova absolute-limits has the following options: nova absolute-limits [--tenant [<tenant>]] [--reserved]

Are you saying that "nova absolute-limits" should just return the user quotas, and "nova absolute-limits --tenant foobar" should return the project quotas? More specifically:

"nova absolute-limits" should call: QUOTAS.get_user_quotas(context, project_id, user_id)
"nova absolute-limits --tenant foobar" should call: QUOTAS.get_project_quotas(context, project_id)

Or are you saying that the list of limits returned should combine the results (which would require a nova-spec I think)? For example:
+-----------------------------+-------+----------------+
| Quota | Limit | Project Limit |
+-----------------------------+-------+----------------+
| instances | 10 | 20 |
| cores | 20 | 40 |
| ram | 51200 | 102400 |
...
+-----------------------------+-------+----------------+

Revision history for this message
Phil Day (philip-day) wrote :

Hi,

I did some more thinking about this - and I think that only presenting one set of limits at a time (user or project) will always be confusing to someone. So I think the only clean way to fix this is to provide both the user and project values in the same response - and that is an API change that probably would need a nova-spec.

Revision history for this message
Thang Pham (thang-pham) wrote :

Ok. I will craft up a nova-spec for this (have to wait until kilo opens up). It would be nice to include the tenant absolute-limits in the response and have the novaclient show two columns, e.g.

+-------------------------+-------+-------+
| Name | User-Value | Project-Value |
+-------------------------+-------+-------+
| maxServerMeta | 128 | 128 |
| maxPersonality | 1 | 5 |
...

Joe Gordon (jogo)
tags: added: quotas
Changed in nova:
assignee: Thang Pham (thang-pham) → nobody
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

This wishlist bug has been open a year without any activity. I'm going to move it to "Opinion / Wishlist", which is an easily-obtainable queue of older requests that have come on.

In case you want to work on that, consider writing a blueprints [1] and spec [2]. I'll recommend to read [3] if not yet done. The effort to implement the requested feature is then driven only by the blueprint (and spec).

References:
[1] https://blueprints.launchpad.net/nova/
[2] https://github.com/openstack/nova-specs
[3] https://wiki.openstack.org/wiki/Blueprints

Changed in nova:
status: Confirmed → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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