Quota limit gets reduced even if volume creation is failed.

Bug #1678024 reported by Saurabh jangir
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Opinion
Undecided
Unassigned

Bug Description

If request for new volume results in error status, cinder does not clear quota consumed for new volume and count this in quota limit.
before creating volume limits were:
[root@controller ~(keystone_admin)]# cinder absolute-limits
+--------------------------+-------+
| Name | Value |
+--------------------------+-------+
| maxTotalBackupGigabytes | 1000 |
| maxTotalBackups | 10 |
| maxTotalSnapshots | 10 |
| maxTotalVolumeGigabytes | 1000 |
| maxTotalVolumes | 10 |
| totalBackupGigabytesUsed | 2 |
| totalBackupsUsed | 1 |
| totalGigabytesUsed | 9 |
| totalSnapshotsUsed | 2 |
| totalVolumesUsed | 5 |
+--------------------------+-------+

[root@controller ~(keystone_admin)]# cinder show 1955b6a9-a56e-4e4e-b2e6-a9fcd91007e8
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2017-03-31T09:20:49.000000 |
| description | None |
| encrypted | False |
| id | 1955b6a9-a56e-4e4e-b2e6-a9fcd91007e8 |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | test2 |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | 8c9b125ddfb64bbe89aa0c9229f3209a |
| replication_status | disabled |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | error |
| updated_at | 2017-03-31T09:24:16.000000 |
| user_id | 94edd5c88daf4bec84f4f8a3e8efcdd3 |
| volume_type | iscsi |
+--------------------------------+--------------------------------------+

[root@controller ~(keystone_admin)]# cinder absolute-limits
+--------------------------+-------+
| Name | Value |
+--------------------------+-------+
| maxTotalBackupGigabytes | 1000 |
| maxTotalBackups | 10 |
| maxTotalSnapshots | 10 |
| maxTotalVolumeGigabytes | 1000 |
| maxTotalVolumes | 10 |
| totalBackupGigabytesUsed | 2 |
| totalBackupsUsed | 1 |
| totalGigabytesUsed | 10 |
| totalSnapshotsUsed | 2 |
| totalVolumesUsed | 6 |
+--------------------------+-------+

As seen from the above output, volume creation failed and totalVolumeUsed is increased by the size of failed volume.

Tags: cinder
Changed in cinder:
status: New → Confirmed
tags: added: cinder
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

An error volume is still a volume. IMO, it should be counted by quota.
Quota is a db record resource, so it is only related to db change. It doesn't care about the driver's status.

If error volumes is out of quota control, it means that users could create as many error volume as they can, don't you think it's a db accident?

even worse, users can first create an available volume and attach it to a vm, then set it's status to error. Then this volume will be out of quota limit but can still be used.

So why do you think the error volume should not be counted?

Revision history for this message
Saurabh jangir (sjopenstack) wrote :

You made some good points.I got your point.
Could you please explain one things to me.

I am talking about the case when a volume goes to error state while creating it(This process actually logs a message "Volume created successfully" in log file. ref- https://bugs.launchpad.net/cinder/+bug/1678034 ).
  >>An error volume is still a volume. IMO, it should be counted by quota.
  >>Quota is a db record resource, so it is only related to db change. It doesn't care about the driver's
  >>status.
You mean it's just a database table which is changed. No actual disk space is allocated to error state volume ?
If I create a volume of 512 GB and it went to error state while creating it. Will this volume be blocking 512 GB disk space ??

Revision history for this message
lucky (luckysingh) wrote :

yes wangxiyuan is right, error volume must occupy some quota. however, in such cases a notification must be send to admin regarding such volumes which are in error state. so that necessary action can be taken.

Sushma Gunda (sushma05)
Changed in cinder:
assignee: nobody → Sushma Gunda (sushma05)
status: Confirmed → In Progress
Revision history for this message
Gorka Eguileor (gorka) wrote :

A volume going into error should still be counted for quota usage in may cases.

Example when cloning:
- Driver requests backend to clone volume
- Driver starts polling to confirm volume cloning has completed
- Polling fails due to network issues with the backend
- Volume goes into error

Example from create volume from image:
- Volume is created
- Error downloading glance image
- Volume goes into error

The only case where we know that it isn't using disk space is if it fails on scheduling. In that case we could make it not be accounted for, but it could introduce a security risk, since once there is a problem creating volumes due to scheduling a user may create millions of volumes and create problems in our DB.

Changed in cinder:
status: In Progress → Opinion
Sushma Gunda (sushma05)
Changed in cinder:
assignee: Sushma Gunda (sushma05) → nobody
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.