openstack limits show --absolute --project <project id> does not work correctly for volumes and security groups
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-openstackclient (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
openstack limits show --absolute --project <project id> does not work correctly for volumes and security groups
-------
if I source admin credential even if I use `openstack limits show --absolute --project <project id> ` it shows details for admin project for volumes and security groups.
OS_REGION_
OS_USER_
OS_IMAGE_
OS_PROJECT_
OS_IDENTITY_
OS_PASSWORD=xxxx
OS_AUTH_
PS1=${OS_
OS_AUTH_URL=http://
OS_USERNAME=admin
OS_VOLUME_
OS_NO_CACHE=True
OS_CLOUDNAME=
OS_PROJECT_
admin limits :
openstack limits show --absolute
None
+------
| Name | Value |
+------
| maxServerMeta | 128 |
| maxTotalInstances | 10 |
| maxPersonality | 5 |
| totalServerGrou
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 51200 |
| maxServerGroups | 10 |
| maxSecurityGrou
| maxTotalKeypairs | 100 |
| totalCoresUsed | 4 |
| totalRAMUsed | 4096 |
| maxSecurityGroups | 10 |
| totalFloatingIp
| totalInstancesUsed | 2 |
| maxServerGroupM
| maxTotalFloatingIps | 10 |
| totalSecurityGr
| maxTotalCores | 20 |
| totalSnapshotsUsed | 0 |
| maxTotalBackups | 10 |
| maxTotalVolumeG
| maxTotalSnapshots | 10 |
| maxTotalBackupG
| totalBackupGiga
| maxTotalVolumes | 10 |
| totalVolumesUsed | 3 |
| totalBackupsUsed | 0 |
| totalGigabytesUsed | 3 |
+------
test project limits :
(overcloud-
(overcloud-
OS_REGION_
OS_USER_
OS_IMAGE_
OS_PROJECT_
OS_IDENTITY_
OS_PASSWORD=xxxxxx
OS_AUTH_
PS1=${OS_
OS_AUTH_URL=http://
OS_USERNAME=
OS_VOLUME_
OS_NO_CACHE=True
OS_CLOUDNAME=
OS_PROJECT_
This works too :
(overcloud-
None
+------
| Name | Value |
+------
| maxServerMeta | 128 |
| maxTotalInstances | 10 |
| maxPersonality | 5 |
| totalServerGrou
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 51200 |
| maxServerGroups | 10 |
| maxSecurityGrou
| maxTotalKeypairs | 100 |
| totalCoresUsed | 2 |
| totalRAMUsed | 2048 |
| maxSecurityGroups | 10 |
| totalFloatingIp
| totalInstancesUsed | 1 |
| maxServerGroupM
| maxTotalFloatingIps | 10 |
| totalSecurityGr
| maxTotalCores | 20 |
| totalSnapshotsUsed | 0 |
| maxTotalBackups | 10 |
| maxTotalVolumeG
| maxTotalSnapshots | 10 |
| maxTotalBackupG
| totalBackupGiga
| maxTotalVolumes | 10 |
| totalVolumesUsed | 1 | <-- for this project(
| totalBackupsUsed | 0 |
| totalGigabytesUsed | 1 |
+------
But if I source admin credential and try to list details for specific project the details are incorrect
~~~
openstack limits show --project 2f50689300a948b
+------
| Name | Value |
+------
| maxServerMeta | 128 |
| maxTotalInstances | 10 |
| maxPersonality | 5 |
| totalServerGrou
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 51200 |
| maxServerGroups | 10 |
| maxSecurityGrou
| maxTotalKeypairs | 100 |
| totalCoresUsed | 4 |
| totalRAMUsed | 4096 |
| maxSecurityGroups | 10 |
| totalFloatingIp
| totalInstancesUsed | 2 |
| maxServerGroupM
| maxTotalFloatingIps | 10 |
| totalSecurityGr
| maxTotalCores | 20 |
| totalSnapshotsUsed | 0 |
| maxTotalBackups | 10 |
| maxTotalVolumeG
| maxTotalSnapshots | 10 |
| maxTotalBackupG
| totalBackupGiga
| maxTotalVolumes | 10 |
| totalVolumesUsed | 3 | < --- this is not for test-project but for admin
| totalBackupsUsed | 0 |
| totalGigabytesUsed | 3 |
+------
~~~
#source overcloud
openstack project list
+------
| ID | Name |
+------
| 046e24ef0bb8446
| 2f50689300a948b
| 34fb06df15fe46d
+------
If we use --debug, we can see openstackclient is sending api call to get admin project details (http://
~~~
REQ: curl -g -i -X GET http://
Starting new HTTP connection (1): 192.168.100.7
http://
RESP: [200] Date: Mon, 23 Dec 2019 07:23:38 GMT Server: Apache x-compute-
RESP BODY: {"limits": {"rate": [], "absolute": {"totalSnapshot
~~~
if we source that project's credential, it sends correct api call 'http://
~~~
GET call to compute for http://
REQ: curl -g -i -X GET http://
Starting new HTTP connection (1): 192.168.100.7
http://
RESP: [200] Date: Mon, 23 Dec 2019 07:27:53 GMT Server: Apache x-compute-
RESP BODY: {"limits": {"rate": [], "absolute": {"totalSnapshot
~~~
68 def take_action(self, parsed_args):
69 #pdb.set_trace()
70
71 compute_client = self.app.
72 volume_client = self.app.
73
74 project_id = None
75 if parsed_args.project is not None:
76 identity_client = self.app.
77 if parsed_args.domain is not None:
78 domain = identity_
79 parsed_args.domain)
80 project_id = utils.find_
81 parsed_
82 domain_
83 else:
84 project_id = utils.find_
85 parsed_
86 #print (project_id)
87
88 compute_limits = compute_
89 tenant_
90 volume_limits = volume_
The totalGigabytesUsed issue was already reported :
https:/ /bugs.launchpad .net/ubuntu/ +source/ python- openstackclient /+bug/1792880