yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #21196
[Bug 1240361] Re: v3/os-quota-sets/detail key_pairs, security_group_rules `in_use` value is wrong
** Changed in: nova
Status: In Progress => Invalid
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1240361
Title:
v3/os-quota-sets/detail key_pairs, security_group_rules `in_use` value
is wrong
Status in OpenStack Compute (Nova):
Invalid
Bug description:
A clean openstack environment. master branch, commit id:
6affe670672f4e2f9f55a750732c620693acd1ef.
In V3 there is a API named os-quota-sets/detail which report not only the hard_limit of quota, but also
report in_use of the quota. Most of the quota usage is correct, but in_use value of 'key_pairs' and
'security_group_rules' always if zero. The detail is below.
$ nova keypair-list
+------+-------------------------------------------------+
| Name | Fingerprint |
+------+-------------------------------------------------+
| 1 | 63:70:20:00:6c:31:0d:86:6a:51:7c:c4:fd:f0:49:b6 |
| 2 | 89:bc:fd:d9:68:41:9d:07:00:06:eb:cd:c9:5e:15:62 |
| 3 | f4:a0:6e:d5:fa:91:fc:27:db:c1:8f:5f:16:6e:5f:47 |
+------+-------------------------------------------------+
$ nova secgroup-list-rules a
+-------------+-----------+---------+-----------+--------------+
| IP Protocol | From Port | To Port | IP Range | Source Group |
+-------------+-----------+---------+-----------+--------------+
| tcp | 1 | 80 | 0.0.0.0/0 | |
| tcp | 80 | 81 | 0.0.0.0/0 | |
| tcp | 81 | 82 | 0.0.0.0/0 | |
| tcp | 83 | 84 | 0.0.0.0/0 | |
+-------------+-----------+---------+-----------+--------------+
$ curl http://openstack.org:8774/v3/os-quota-sets/5b36b3bff0f44d70ab45334a9985ae6a/detail .....
{
"quota_set": {
....
"key_pairs": {
"in_use": 0,
"limit": 3,
"reserved": 0
},
"security_group_rules": {
"in_use": 0,
"limit": 20,
"reserved": 0
},
.....
}
but when create more keypairs api will raise 413 (Quota exceeded, too many key pairs).
$ nova keypair-add 4
ERROR: Quota exceeded, too many key pairs. (HTTP 413) (Request-ID: req-7002664c-e0a4-4a51-bfd8-221950278707)
---------------
The reason is `key_pairs` and `security_group_rules` is CountableResource. They can't be reserved,
so quota_usages table does not contains their information. V3 /os-quota-set/detail api just report
the usage which is from nova.quota.get_project_quotas(), which come from database table quota_usages.
A quick workaround is make nova.quota.get_project_quotas()/ nova.quota.get_user_quotas() recognize
CountableResource and report the correct value of it.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1240361/+subscriptions