Cannot set quota for volume type

Bug #1907750 reported by haobing1
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Low
zhuyuhao

Bug Description

Steps to reproduce:

1. create a volume type named lvm
root@openstack-ThinkPad-T450:/etc/cinder# cinder type-create lvm
+--------------------------------------+------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| 777d4020-69fb-41d5-b5d1-92dd33946bae | lvm | - | True |
+--------------------------------------+------+-------------+-----------+

2. Set lvm type quota for admin project
root@openstack-ThinkPad-T450:/etc/cinder# cinder quota-update f4c0e72bf7934ab8933f4273295e8fe8 --volumes 5 --snapshots 5 --gigabytes 10 --volume-type lvm

+----------------------+-------+
| Property | Value |
+----------------------+-------+
| backup_gigabytes | 1000 |
| backups | 10 |
| gigabytes | 1000 |
| gigabytes_lvm | 10 |
| groups | 10 |
| per_volume_gigabytes | -1 |
| snapshots | 10 |
| snapshots_lvm | 5 |
| volumes | 10 |
| volumes_lvm | 5 |
+----------------------+-------+

3. delete this lvm type
root@openstack-ThinkPad-T450:/etc/cinder# cinder type-delete lvm
Request to delete volume type lvm has been accepted.

4. create a volume type named LVM
root@openstack-ThinkPad-T450:/etc/cinder# cinder type-create LVM
+--------------------------------------+------+-------------+-----------+
| ID | Name | Description | Is_Public |
+--------------------------------------+------+-------------+-----------+
| 085437cd-8b57-44e1-997f-175668a822ab | LVM | - | True |
+--------------------------------------+------+-------------+-----------+

5. I cannot set the quota of LVM type for the admin project
root@openstack-ThinkPad-T450:/etc/cinder# cinder quota-update f4c0e72bf7934ab8933f4273295e8fe8 --volumes 5 --snapshots 5 --gigabytes 10 --volume-type LVM
+----------------------+-------+
| Property | Value |
+----------------------+-------+
| backup_gigabytes | 1000 |
| backups | 10 |
| gigabytes | 1000 |
| gigabytes_LVM | -1 |
| groups | 10 |
| per_volume_gigabytes | -1 |
| snapshots | 10 |
| snapshots_LVM | -1 |
| volumes | 10 |
| volumes_LVM | -1 |
+----------------------+-------+

root@openstack-ThinkPad-T450:/etc/cinder# cinder quota-show f4c0e72bf7934ab8933f4273295e8fe8
+----------------------+-------+
| Property | Value |
+----------------------+-------+
| backup_gigabytes | 1000 |
| backups | 10 |
| gigabytes | 1000 |
| gigabytes_LVM | -1 |
| groups | 10 |
| per_volume_gigabytes | -1 |
| snapshots | 10 |
| snapshots_LVM | -1 |
| volumes | 10 |
| volumes_LVM | -1 |
+----------------------+-------+

Revision history for this message
michael-mcaleer (mmcaleer) wrote :

Hi,

Is this behaviour isolated to scenarios where the second volume-type name is explicitly all upper-case variation of first volume-type name?

Can you set quotas for a volume-type where the name is not LVM after you have deleted the first volume-type?

Changed in cinder:
status: New → Triaged
importance: Undecided → Low
tags: added: quotas volume-type
Revision history for this message
haobing1 (haobing1) wrote :

Hi, michael-mcaleer

Yes,the second volume-type name is explicitly all upper-case variation of first volume-type name.
The type of other names can be set quota.

I think that when deleting a volume type, we can also delete the quota associated with the type.
Do you think this is reasonable?

haobing1 (haobing1)
Changed in cinder:
assignee: nobody → haobing1 (haobing1)
haobing1 (haobing1)
Changed in cinder:
assignee: haobing1 (haobing1) → nobody
Changed in cinder:
assignee: nobody → wanghongtao (hongtao.wang)
information type: Public → Public Security
Revision history for this message
Jeremy Stanley (fungi) wrote :

When switching the bug report type to security, it's customary to explain why you believe this represents an exploitable vulnerability. It's not immediately apparent to me how a malicious actor would take advantage of this bug. I'm setting it back to a normal public report type for now, but feel free to switch it to public security again if you're inclined to include a comment explaining your concerns so a vulnerability manager can evaluate whether this report warrants wide publication of a security advisory.

information type: Public Security → Public
Revision history for this message
wanghongtao (hongtao.wang) wrote :

The type Should be public,thank you。
@Jeremy Stanley

information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
haobing1 (haobing1) wrote :
Changed in cinder:
status: Triaged → In Progress
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :

Thanks Hongtao Wang for working on this. Looks like the fix to this problem is deleting quotas when deleting volume type. Related quotas include quota_usage, quota_class and quota tables.

haobing1 (haobing1)
Changed in cinder:
assignee: wanghongtao (hongtao.wang) → nobody
assignee: nobody → haobing1 (haobing1)
zhuyuhao (zhuyuhao)
Changed in cinder:
assignee: haobing1 (haobing1) → zhuyuhao (zhuyuhao)
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.