tenant is required for quota-update but not for quota-show

Bug #1313935 reported by Corey Bryant on 2014-04-28
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Cinder
Medium
Kasey Alusi
OpenStack Compute (nova)
Medium
Ankur Gupta
nova (Ubuntu)
Medium
Unassigned

Bug Description

Tenant is a required positional parameter on quota-update but is optional on quota-show. And when --tenant is not specified on quota-show it doesn't return valid limits for the user.

$ nova quota-show --user demo
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
...
+-----------------------------+-------+

$ nova quota-update --user demo --instances 9 # tenant is required
usage: nova quota-update [--user <user-id>] [--instances <instances>]
                         [--cores <cores>] [--ram <ram>]
                         [--floating-ips <floating-ips>]
                         [--fixed-ips <fixed-ips>]
                         [--metadata-items <metadata-items>]
                         [--injected-files <injected-files>]
                         [--injected-file-content-bytes <injected-file-content-bytes>]
                         [--injected-file-path-bytes <injected-file-path-bytes>]
                         [--key-pairs <key-pairs>]
                         [--security-groups <security-groups>]
                         [--security-group-rules <security-group-rules>]
                         [--force]
                         <tenant-id>
error: too few arguments
Try 'nova help quota-update' for more information.

$ nova quota-update --user demo --instances 9 demo

$ nova quota-show --user demo # should return instances=9 or should fail because tenant is required
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
...
+-----------------------------+-------+

$ nova quota-show --user demo --tenant demo # returns the correct value
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 9 |
...
+-----------------------------+-------+

Thang Pham (thang-pham) on 2014-04-28
Changed in nova:
assignee: nobody → Thang Pham (thang-pham)
Thang Pham (thang-pham) wrote :

The problem is nova quota-update uses value of <tenant-id> to save the quota in the database. If you use "demo" as the tenant-id, nova will use project_id="demo" when setting the project_user_quotas table. If you use a <uuid> as the tenant-id, nova will use project_id=<uuid> when setting the project_user_quotas table. You can see this by logging into MySQL (or whatever DB you are using) and querying the project_user_quotas table (e.g. select project_id,resource,hard_limit from project_user_quotas).

In order to obtain the correct values, you have to pass the correct <tenant-id> in nova quota-show. The solution to this bug is to: translate the tenant name into its <uuid> before saving it into the DB or querying from the database.

Thang Pham (thang-pham) wrote :

Another solution is: check that the <tenant-id> is actually a valid uuid.

Thang Pham (thang-pham) on 2014-04-30
Changed in nova:
importance: Undecided → Medium
Thang Pham (thang-pham) on 2014-04-30
Changed in nova:
status: New → In Progress
Thang Pham (thang-pham) on 2014-05-02
Changed in cinder:
assignee: nobody → Thang Pham (thang-pham)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nova (Ubuntu):
status: New → Confirmed
James Page (james-page) on 2014-08-01
Changed in nova (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged

Change abandoned by Joe Gordon (<email address hidden>) on branch: master
Review: https://review.openstack.org/91866
Reason: Is this still active? Nothing has happened in a few months marking as abandoned. Feel free to bring it back.

Change abandoned by Thang Pham (<email address hidden>) on branch: master
Review: https://review.openstack.org/91866
Reason: Abandoning this patch, so a new patch can be spun up with updated code.

Joe Gordon (jogo) on 2014-11-19
Changed in nova:
status: In Progress → New
assignee: Thang Pham (thang-pham) → nobody
Mike Perez (thingee) on 2014-11-24
Changed in cinder:
milestone: none → kilo-1
status: New → Triaged
importance: Undecided → Medium
Changed in nova:
assignee: nobody → Kanchan Gupta (kanchan-gupta1)
Changed in nova:
assignee: Kanchan Gupta (kanchan-gupta1) → nobody
melanie witt (melwitt) on 2014-12-05
Changed in nova:
status: New → Triaged
Mike Perez (thingee) on 2014-12-09
tags: added: low-hanging-fruit
Changed in cinder:
assignee: Thang Pham (thang-pham) → nobody
milestone: kilo-1 → kilo-2
Anton Arefiev (aarefiev) wrote :

Cinder quota-show and quota-update have only positional arg <tenant_id>.

Changed in cinder:
status: Triaged → Incomplete
Mike Perez (thingee) on 2015-01-20
Changed in cinder:
milestone: kilo-2 → none
Changed in nova:
assignee: nobody → Ankur Gupta (ankur-gupta-v)
Changed in cinder:
assignee: nobody → Kasey Alusi (kasey-alusi)
status: Incomplete → Confirmed
Changed in cinder:
status: Confirmed → Incomplete
Joe Gordon (jogo) on 2015-03-11
tags: added: quotas
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints