Cinder quota reached, improve error message

Bug #1448672 reported by Tzach Shefi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Medium
Lin Yang

Bug Description

Description of problem: While testing cinder list command (APIv1) in my case happened to be with more than 1000 volumes had run into this error:

# for i in {1..500}; do cinder create 1;
>> done
>> ERROR: Request Entity Too Large (HTTP 413) (Request-ID:
>> req-df25ba27-f836-4f96-9c18-6c4defbea250)

Cinder "Volumes" quota was set at: 10000.
I had forgotten to update "Total Size of Volumes and Snapshots (GB)" quota which defaults to 1000GB, each of my volumes was 1Gb hence an error notice is/was due.

The bug refers to uninformative error message which should be improved to better hint at possible fix/reason. BTW same error happens if volumes count rather than volumes total size is reached.

Bug can be reproduced with less/smaller volumes, just set quota to lower settings.

Version-Release number of selected component (if applicable):
RHEl 7.1
python-cinderclient-1.1.1-1.el7ost.noarch
python-cinder-2014.2.3-1.el7ost.noarch
openstack-cinder-2014.2.3-1.el7ost.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Install setup, in my case configured CEPH as cinder backend, needed for thin provisioning of volumes, isn't a must or related to the bug and would probably happen with any Cinder backend driver.

2. Check both quota figures, number of volumes and total volume size.

3. Create cinder volumes such that you pass one of the quota limits.

4. Notice error message.

Actual results:
Getting error: >> ERROR: Request Entity Too Large (HTTP 413

Expected results:
A descriptive error would be more helpful something like: Error Cinder create failed due to volume/or size quota limit..
See below cinder api.logs sections indicate failure reason, why not return reasons to user?

Additional info:
Original logs are gone, I'd caused same error on another setup.

Cinder volume count quota exceeded:

2015-04-26 15:53:39.955 93965 WARNING cinder.volume.flows.api.create_volume [req-10239fa5-8e6f-4a3c-ab2a-2014a7a4a8ea tshefi 42b79aa6a2c649da9699eb172ee329ed - - -] Quota exceeded for 42b79aa6a2c649da9699eb172ee329ed, tried to create volume (6 volumes already consumed)
2015-04-26 15:53:39.956 93965 WARNING cinder.volume.api [req-10239fa5-8e6f-4a3c-ab2a-2014a7a4a8ea tshefi 42b79aa6a2c649da9699eb172ee329ed - - -] Task 'cinder.volume.flows.api.create_volume.QuotaReserveTask;volume:create' (0cd82366-b63f-4693-ba77-49b7f9b472ea) transitioned into state 'FAILURE'
2015-04-26 15:53:39.956 93965 TRACE cinder.volume.api Traceback (most recent call last):
2015-04-26 15:53:39.956 93965 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 34, in _execute_task
2015-04-26 15:53:39.956 93965 TRACE cinder.volume.api result = task.execute(**arguments)
2015-04-26 15:53:39.956 93965 TRACE cinder.volume.api File "/usr/lib/python2.7/site-packages/cinder/volume/flows/api/create_volume.py", line 598, in execute
2015-04-26 15:53:39.956 93965 TRACE cinder.volume.api raise exception.VolumeLimitExceeded(allowed=quotas['volumes'])
2015-04-26 15:53:39.956 93965 TRACE cinder.volume.api VolumeLimitExceeded: Maximum number of volumes allowed (6) exceeded

Cinder volume size quota exceeded:

[root@mac848f69fbc607 ~]# grep 63f9bbec53e5 -ir /var/log/cinder/*
/var/log/cinder/api.log:2015-04-26 15:57:08.025 9889 INFO cinder.api.openstack.wsgi [req-fdf400d6-4e9a-4523-ba8d-63f9bbec53e5 tshefi 42b79aa6a2c649da9699eb172ee329ed - - -] POST http://10.35.188.13:8776/v1/42b79aa6a2c649da9699eb172ee329ed/volumes
/var/log/cinder/api.log:2015-04-26 15:57:08.026 9889 INFO cinder.api.v1.volumes [req-fdf400d6-4e9a-4523-ba8d-63f9bbec53e5 tshefi 42b79aa6a2c649da9699eb172ee329ed - - -] Create volume of 10 GB
/var/log/cinder/api.log:2015-04-26 15:57:08.396 9889 WARNING cinder.volume.flows.api.create_volume [req-fdf400d6-4e9a-4523-ba8d-63f9bbec53e5 tshefi 42b79aa6a2c649da9699eb172ee329ed - - -] Quota exceeded for 42b79aa6a2c649da9699eb172ee329ed, tried to create 10G volume (6G of 10G already consumed)

Revision history for this message
John Griffith (john-griffith) wrote :

Ran into this the other day with Volumes as you pointed out, forgot to log a bug though. Haven't triaged yet, but def confirmed.

Changed in cinder:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Lin Yang (lin-a-yang) wrote :

It would return a VolumeLimitExceeded exception as api did, also include the already consumed quota.

Changed in cinder:
assignee: nobody → Lin Yang (lin-a-yang)
status: Confirmed → In Progress
Revision history for this message
Lin Yang (lin-a-yang) wrote :

The cinder internal VolumeLimitExceeded exception will be converted to webob. HTTPException 413 with explanation 'VolumeLimitExceeded: Maximum number of volumes allowed (10) exceeded'. Is it helpful to show this explanation when python-cinderclient receive HTTPException 413?

Revision history for this message
Mike Perez (thingee) wrote :

Yes, it's useful to give an explanation.

Revision history for this message
Lin Yang (lin-a-yang) wrote :

This should be fixed on python-cinderclient part to show an explanation when receive client exception.

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

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

Revision history for this message
Lin Yang (lin-a-yang) wrote :

The error message has been changed as below shows. Any comments?

$ cinder create 1
ERROR: VolumeLimitExceeded: Maximum number of volumes allowed (10) exceeded (HTTP 413) (Request-ID: req-76b9d656-d2f0-45fa-a1ae-ad182106fd0d)

Revision history for this message
Lin Yang (lin-a-yang) wrote :

This bug has been fixed by another commit 1431693 in python-cinderclinet in 1.2.0.

Changed in python-cinderclient:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-cinderclient (master)

Change abandoned by Lin Yang (<email address hidden>) on branch: master
Review: https://review.openstack.org/178946
Reason: This bug already has been fixed by anther commit de367556. Thanks everyone's review.

Changed in python-cinderclient:
milestone: none → 1.4.0
status: Fix Committed → Fix Released
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.