volume quota is not released on delete

Bug #1049459 reported by clayg
This bug report is a duplicate of:  Bug #1048158: lack the quota commit of reservation. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Committed
Undecided
Rongze Zhu

Bug Description

So i dropped my default quota_volumes down to 1 to show this example of the problem on a clean devstack.

clayg@cfsyn28:~$ cinder create 1
clayg@cfsyn28:~$ cinder list
+--------------------------------------+-----------+--------------+------+-------------+-------------+
| ID | Status | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+-------------+
| e2cd05e9-847a-4257-b13e-886d5991ce8e | available | None | 1 | None | |
+--------------------------------------+-----------+--------------+------+-------------+-------------+
clayg@cfsyn28:~$ cinder create 1
ERROR: VolumeLimitExceeded: Maximum number of volumes allowed (1) exceeded (HTTP 413) (Request-ID: req-8c70a243-dd89-4c47-9e9d-093b7efa3c1d)
clayg@cfsyn28:~$ cinder delete e2cd05e9-847a-4257-b13e-886d5991ce8e
clayg@cfsyn28:~$ cinder list
+--------------------------------------+----------+--------------+------+-------------+-------------+
| ID | Status | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+----------+--------------+------+-------------+-------------+
| e2cd05e9-847a-4257-b13e-886d5991ce8e | deleting | None | 1 | None | |
+--------------------------------------+----------+--------------+------+-------------+-------------+
clayg@cfsyn28:~$ cinder list

clayg@cfsyn28:~$ cinder create 1
ERROR: VolumeLimitExceeded: Maximum number of volumes allowed (1) exceeded (HTTP 413) (Request-ID: req-2b6673f0-f724-4963-b4d2-627e37c4f538)

I think something like making a reservation for a negative value in volume.api.delete would get things moving in the right direction:

reservations = QUOTAS.reserve(context, volumes=-1, gigabytes=-size)

also, it'd be nice of there was something like 'nova-manage project quota list' but for the cinder db, or maybe an admin api extension would be better? Maybe I just missed something. Is it easy to disable quota all together? I didn't see anything like cinder.quota.NullQuotaDriver.

Revision history for this message
clayg (clay-gerrard) wrote :
Revision history for this message
Rongze Zhu (zrzhit) wrote :

Hi clayg, I think this bug is the same as https://bugs.launchpad.net/cinder/+bug/1048158 .

Revision history for this message
clayg (clay-gerrard) wrote :

ah, yes, missed that one. As long as you also do the needful on delete as well. You have any work in progress?

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

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

Changed in cinder:
assignee: nobody → Rongze Zhu (zrzhit)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/12852
Committed: http://github.com/openstack/cinder/commit/a955730b569be6f1132cbd254d8f21828c54d2f2
Submitter: Jenkins
Branch: master

commit a955730b569be6f1132cbd254d8f21828c54d2f2
Author: Rongze Zhu <email address hidden>
Date: Wed Sep 12 07:10:53 2012 +0000

    Add volume quota in volume/api.py and olume/manager.py

    Fixes bug #1048158

    volume.api.API.create() call QUOTAS.reserve(), then
    volume.manager.VolumeManager.create_volume call QUOTAS.commit().
    volume.manager.VolumeManager.delete_volume call QUOTAS.reserve() and
    QUOTAS.commit().

    It also fixes bug #1049459.

    Change-Id: I764aeec83cce93595fbe9aa00205a7d8c9e13c35

Changed in cinder:
status: In Progress → Fix Committed
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.