Openstackclient return wrong quota information

Bug #1479981 reported by Hao Chen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Undecided
Rui Zang
python-openstackclient
New
Undecided
Rui Zang

Bug Description

I try to update the quota port limitations for my project, neutronclient works well and I can get the right result using neutronclient. But when we run ```openstack quota show admin``` we found the quota port limitation doesn't changed. Here are the testing process:

layton-pistachio:/opt/openstack # neutron --insecure --os-project-id d3a77adc69004a6bbfe233cf7f08fdc1 --os-project-domain-name default --os-user-domain-name default quota-update --port 160

+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | 50 |
| health_monitor | -1 |
| member | -1 |
| network | 10 |
| pool | 10 |
| port | 160 |
| router | 10 |
| security_group | 10 |
| security_group_rule | 100 |
| subnet | 10 |
| vip | 10 |
+---------------------+-------+
layton-pistachio:/opt/openstack # neutron --insecure --os-project-id d3a77adc69004a6bbfe233cf7f08fdc1 --os-project-domain-name default --os-user-domain-name default quota-show
+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | 50 |
| health_monitor | -1 |
| member | -1 |
| network | 10 |
| pool | 10 |
| port | 160 |
| router | 10 |
| security_group | 10 |
| security_group_rule | 100 |
| subnet | 10 |
| vip | 10 |
+---------------------+-------+
layton-pistachio:/opt/openstack # openstack quota show admin
+----------------------+-------+
| Field | Value |
+----------------------+-------+
| backup_gigabytes | 1000 |
| backups | 10 |
| cores | 20 |
| fixed-ips | -1 |
| floating-ips | 50 |
| gigabytes | 1000 |
| health_monitor | -1 |
| injected-file-size | 10240 |
| injected-files | 5 |
| injected-path-size | 255 |
| instances | 10 |
| key-pairs | 100 |
| member | -1 |
| network | 10 |
| pool | 10 |
| port | 50 |
| project | admin |
| properties | 128 |
| ram | 51200 |
| router | 10 |
| secgroup-rules | 100 |
| secgroups | 10 |
| server_group_members | 10 |
| server_groups | 10 |
| snapshots | 10 |
| subnet | 10 |
| vip | 10 |
| volumes | 10 |
+----------------------+-------+

layton-pistachio:/opt/openstack # openstack project list
+----------------------------------+---------+
| ID | Name |
+----------------------------------+---------+
| 1c30e840b3d1447ea3820d99cc38cd33 | service |
| 55d10960d5f7447990e69ebf481ac97d | demo |
| d3a77adc69004a6bbfe233cf7f08fdc1 | admin |
+----------------------------------+---------+

I checked the neutron database and the quota information was right:

MariaDB [neutron]> select * from quotas;
+--------------------------------------+----------------------------------+----------+-------+
| id | tenant_id | resource | limit |
+--------------------------------------+----------------------------------+----------+-------+
| 1c5586f5-7c71-4666-9162-bf29bcaa511d | d3a77adc69004a6bbfe233cf7f08fdc1 | port | 160 |
+--------------------------------------+----------------------------------+----------+-------+
1 row in set (0.00 sec)

Hao Chen (chenh1987)
description: updated
description: updated
description: updated
Revision history for this message
Terry Howe (thowe-g) wrote :

Sounds like a duplicate of https://review.openstack.org/#/c/203312/

Dolph Mathews (dolph)
no longer affects: keystone
Revision history for this message
Hao Chen (chenh1987) wrote :

This is not the same issue as bug #1420104. There are two main differents:

1. Quota set can't change the port limitations. In fact ```openstack quota set``` command can only change nova quota limitation, it can only be done by using neutronclient.
see the reference here: https://wiki.openstack.org/wiki/OpenStackClient/Commands#Quota_3

2. the quota-update command ran successfully we didn't get any error message like bug #1420104.

Revision history for this message
Rui Zang (rui-zang) wrote :

If you specific the tenant-id or project-id by the "--tenant-id" option, you will get the correct result.

stack@rzang-devstack-vm:~/work/devstack$ neutron quota-show --tenant-id test
+---------------------+-------+
| Field | Value |
| network | 10 |
| port | 50 |
| router | 10 |
| security_group | 10 |
| security_group_rule | 100 |
| subnet | 10 |
| subnetpool | -1 |
+---------------------+-------+
stack@rzang-devstack-vm:~/work/devstack$ neutron quota-update --tenant-id test --port 100
+---------------------+-------+
| Field | Value |
+---------------------+-------+
| floatingip | 50 |
| network | 10 |
| port | 100 |
| router | 10 |
| security_group | 10 |
| security_group_rule | 100 |
| subnet | 10 |
| subnetpool | -1 |
+---------------------+-------+
stack@rzang-devstack-vm:~/work/devstack$ openstack quota show test
get_network_quota
Namespace(columns=[], default=False, formatter='table', max_width=0, prefix='', project='test', quota_class=False, variables=[])
test
{u'subnet': 10, u'network': 10, u'floatingip': 50, u'subnetpool': -1, u'security_group_rule': 100, u'security_group': 10, u'router': 10, u'port': 100}
+-----------------------+-------+
| Field | Value |
+-----------------------+-------+
| backup_gigabytes | 1000 |
| backups | 10 |
| cores | 20 |
| fixed-ips | -1 |
| floating-ips | 50 |
| gigabytes | 1000 |
| gigabytes_lvmdriver-1 | -1 |
| injected-file-size | 10240 |
| injected-files | 5 |
| injected-path-size | 255 |
| instances | 10 |
| key-pairs | 100 |
| network | 10 |
| per_volume_gigabytes | -1 |
| port | 100 |
| project | test |
| properties | 128 |
| ram | 51200 |
| router | 10 |
| secgroup-rules | 100 |
| secgroups | 10 |
| server_group_members | 10 |
| server_groups | 10 |
| snapshots | 10 |
| snapshots_lvmdriver-1 | -1 |
| subnet | 10 |
| subnetpool | -1 |
| volumes | 10 |
| volumes_lvmdriver-1 | -1 |
+-----------------------+-------+
stack@rzang-devstack-vm:~/work/devstack$

I guess without the "-tenant-id" option, `neutron quota-update` just update the default value. I am looking into it.

Changed in neutron:
assignee: nobody → Rui Zang (rui-zang)
Changed in python-openstackclient:
assignee: nobody → Rui Zang (rui-zang)
Revision history for this message
Rui Zang (rui-zang) wrote :

The real problem is to show quota you should use the exact string that you specified as tenant-id when updating the quota.

In your case, you specified the tenant-id is UUID when you update the port quota

 --- layton-pistachio:/opt/openstack # neutron --insecure --os-project-id d3a77adc69004a6bbfe233cf7f08fdc1 --os-project-domain-name default --os-user-domain-name default quota-update --port 160

So you need to also use that UUID to get the quota instead of "admin" although in most of the cases they can be interchangeable.

Try ` openstack quota show d3a77adc69004a6bbfe233cf7f08fdc1`

Seems somewhere lacks the mapping between UUID and human readable names.

affects: neutron → python-neutronclient
Revision history for this message
Rui Zang (rui-zang) wrote :

 Root cause is that neutron lacks of tenant ID/name validation.

To retrieve the quota, you need to use the exact string as tenant ID at setting the quota.

A RFE (blueprint) is needed to address this.

BTW, tenant ID validation is proposed to Nova and the spec been accepted.

affects: python-neutronclient → neutron
Revision history for this message
Rui Zang (rui-zang) wrote :

This is a duplicate of Bug #1317515

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: New → In Progress
Revision history for this message
Steve Martinelli (stevemar) wrote :

original reporter says it's a dupe of 1317515

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Rui Zang (<email address hidden>) on branch: master
Review: https://review.openstack.org/211441

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.