Explain the difference between quantum quota-list and quota-show commands

Asked by Rajalakshmi Ganesan

Hi,

I am trying out the quantum commands for quota.

I observed that output for "quantum quota-show" and "quantum quota-list" is same.
I checked for the number of tenants present using "keystone tenant-list", and there are 5 tenants.

Following is the snapshot :

ubuntu@devstack1:~/sneha/tempest/tempest/api/network$ quantum quota-show
+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | 50 |
| network | 10 |
| port | 70 |
| router | 10 |
| security_group | 10 |
| security_group_rule | 100 |
| subnet | 10 |
+---------------------+-------+
ubuntu@devstack1:~/sneha/tempest/tempest/api/network$ quantum quota-list
+------------+---------+------+--------+----------------+---------------------+--------+----------------------------------+
| floatingip | network | port | router | security_group | security_group_rule | subnet | tenant_id |
+------------+---------+------+--------+----------------+---------------------+--------+----------------------------------+
| 50 | 10 | 70 | 10 | 10 | 100 | 10 | 70e75c24bd8b4f7884f073dd4510a9fa |
+------------+---------+------+--------+----------------+---------------------+--------+----------------------------------+

ubuntu@devstack1:~/sneha/tempest/tempest/api/network$ keystone tenant-list
+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| 70e75c24bd8b4f7884f073dd4510a9fa | admin | True |
| 538c09d56f0d4e22827b5da671f5dc99 | alt_demo | True |
| 6b7d64126a3c4b019cf35b8f8418b818 | demo | True |
| 33de0602d49440c7a5e8739b02b5558c | invisible_to_admin | True |
| 05b202439e334aaab73250ae393dff88 | service | True |
+----------------------------------+--------------------+---------+

I am unable to understand why is list command not displaying details for all the tenants?
Please, can anyone assist me?

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
yong sheng gong
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) said :
#1

Help page for quantum quota-list says:

ubuntu@devstack1:~/sneha/tempest/tempest/api/network$ quantum help quota-list
usage: quantum quota-list [-h] [-f {csv,table}] [-c COLUMN]
[--quote {all,minimal,none,nonnumeric}]
[--request-format {json,xml}]

List defined quotas of all tenants.

optional arguments:
-h, --help show this help message and exit
--request-format {json,xml}
the xml or json request format

output formatters:
output formatter options

-f {csv,table}, --format {csv,table}
the output format, defaults to table
-c COLUMN, --column COLUMN
specify the column(S)to include, can be repeated

CSV Formatter:
--quote {all,minimal,none,nonnumeric}
when to include quotes, defaults to nonnumeric
ubuntu@devstack1:~/sneha/tempest/tempest/api/network$

The description of quota-list command says that "List defined quotas of all tenants"
but the output is of only the admin tenant whose credentials are used for listing

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) said :
#3

Accidentally marked the status as "solved". Apologies for the spam.

Revision history for this message
yong sheng gong (gongysh) said :
#4

$ quantum quota-show -h
usage: quantum quota-show [-h] [-f {shell,table}] [-c COLUMN]
                          [--variable VARIABLE] [--prefix PREFIX]
                          [--request-format {json,xml}]
                          [--tenant-id tenant-id]

Show quotas of a given tenant

quota-show is used to show the 'quotas' of a given tenant, the quota-list is used to show the 'defined quotas' of tenants.

so quota-list will be empty if there are no tenants have defined quotas. i.e. quota-list does not list the quotas of tenants who does not have defined quotas.

quota-update is used to define quotas of a tenant if u want the tenant not to use default quotas.

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) said :
#5

Using Keystone, I am able to get list of all the tenants present.

ubuntu@devstack1:~/raj/wed/tempest/tempest/api$ keystone tenant-list
+----------------------------------+--------------------+---------+
| id | name | enabled |
+----------------------------------+--------------------+---------+
| 70e75c24bd8b4f7884f073dd4510a9fa | admin | True |
| 538c09d56f0d4e22827b5da671f5dc99 | alt_demo | True |
| 6b7d64126a3c4b019cf35b8f8418b818 | demo | True |
| 33de0602d49440c7a5e8739b02b5558c | invisible_to_admin | True |
| 05b202439e334aaab73250ae393dff88 | service | True |
+----------------------------------+--------------------+---------+

Now when I request for quota-show of tenant "demo"(6b7d64126a3c4b019cf35b8f8418b818), I am able to view the defined quotas.

ubuntu@devstack1:~/raj/wed/tempest/tempest/api$ quantum quota-show --tenant-id 6b7d64126a3c4b019cf35b8f8418b818
+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | 50 |
| network | 10 |
| port | 50 |
| router | 10 |
| security_group | 10 |
| security_group_rule | 100 |
| subnet | 10 |
+---------------------+-------+

But the quota values for the same tenant "demo" i.e 6b7d64126a3c4b019cf35b8f8418b818 thought they are defined, they are not appearing in the response of quota-list:

ubuntu@devstack1:~/raj/wed/tempest/tempest/api$ quantum quota-list
+------------+---------+------+--------+----------------+---------------------+--------+----------------------------------+
| floatingip | network | port | router | security_group | security_group_rule | subnet | tenant_id |
+------------+---------+------+--------+----------------+---------------------+--------+----------------------------------+
| 50 | 10 | 70 | 10 | 10 | 100 | 10 | 70e75c24bd8b4f7884f073dd4510a9fa |
+------------+---------+------+--------+----------------+---------------------+--------+----------------------------------+
ubuntu@devstack1:~/raj/wed/tempest/tempest/api$

Only the values of admin tenant user appear.

Revision history for this message
Best yong sheng gong (gongysh) said :
#6

it seems the quotas of demo are still default values.
These two commands can help:
quantum quota-update --tenant-id 6b7d64126a3c4b019cf35b8f8418b818 --port 70
quantum quota-list

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) said :
#7

Thanks yong sheng gong, that solved my question.