limits with tenant parameter returns wrong maxTotal* values

Bug #1334278 reported by Belmiro Moreira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Thang Pham

Bug Description

When querying for the "absolute limits" of a specific tenant
the maxTotal* values reported aren't correct.

How to reproduce:
for example using devstack...

OS_TENANT_NAME=demo (11b2b129994844798c98f437d9809a9c)
OS_USERNAME=demo

$nova absolute-limits

+-------------------------+-------+
| Name | Value |
+-------------------------+-------+
| maxServerMeta | 128 |
| maxPersonality | 5 |
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 1000 |
| maxSecurityGroupRules | 20 |
| maxTotalKeypairs | 100 |
| totalRAMUsed | 128 |
| maxSecurityGroups | 10 |
| totalFloatingIpsUsed | 0 |
| totalInstancesUsed | 2 |
| totalSecurityGroupsUsed | 1 |
| maxTotalFloatingIps | 10 |
| maxTotalInstances | 10 | <-----------------------
| totalCoresUsed | 2 |
| maxTotalCores | 10 | <-----------------------
+-------------------------+-------+

OS_TENANT_NAME=admin (b0f08277004b43aab516ae7dbf36ff51)
OS_USERNAME=admin

$nova absolute-limits

+-------------------------+--------+
| Name | Value |
+-------------------------+--------+
| maxServerMeta | 128 |
| maxPersonality | 5 |
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 151200 |
| maxSecurityGroupRules | 20 |
| maxTotalKeypairs | 100 |
| totalRAMUsed | 1152 |
| maxSecurityGroups | 10 |
| totalFloatingIpsUsed | 0 |
| totalInstancesUsed | 18 |
| totalSecurityGroupsUsed | 1 |
| maxTotalFloatingIps | 10 |
| maxTotalInstances | 30 |
| totalCoresUsed | 18 |
| maxTotalCores | 30 |
+-------------------------+--------+

$nova absolute-limits --tenant 11b2b129994844798c98f437d9809a9c

+-------------------------+--------+
| Name | Value |
+-------------------------+--------+
| maxServerMeta | 128 |
| maxPersonality | 5 |
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 151200 |
| maxSecurityGroupRules | 20 |
| maxTotalKeypairs | 100 |
| totalRAMUsed | 128 |
| maxSecurityGroups | 10 |
| totalFloatingIpsUsed | 0 |
| totalInstancesUsed | 2 |
| totalSecurityGroupsUsed | 1 |
| maxTotalFloatingIps | 10 |
| maxTotalInstances | 30 | <-------------------
| totalCoresUsed | 2 |
| maxTotalCores | 30 | <-------------------
+-------------------------+--------+

note: arrows show the wrong values.
Seems that maxTotal* shows the values for the current tenant and not what is specified by "--tenant"
as expected.

tested in havana and icehouse-1

Tags: api
Thang Pham (thang-pham)
Changed in nova:
assignee: nobody → Thang Pham (thang-pham)
Tracy Jones (tjones-i)
tags: added: api
Changed in nova:
status: New → Confirmed
Thang Pham (thang-pham)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/103709

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/103709
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2e6b2404155156ca336dadeacc8874645ca07bfc
Submitter: Jenkins
Branch: master

commit 2e6b2404155156ca336dadeacc8874645ca07bfc
Author: Thang Pham <email address hidden>
Date: Mon Jun 30 23:17:35 2014 -0400

    API: Enable support for tenant option in nova absolute-limits

    When querying for the absolute limits of a specific tenant,
    the tenant option is ignored. There are no attempts to extract
    the tenant from the request. Instead, nova uses context.project_id
    as the project_id in QUOTAS.get_project_quotas. The following
    patch extracts the tenant_id from the request (if any) and passes
    that to QUOTAS.get_project_quotas to obtain the proper quota.

    Change-Id: If5f91de020ed8a40fa04fc001c7c4c92681f4ad1
    Closes-Bug: #1334278

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
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.