Quotas should not be updated to a value lower than current usage

Bug #1304234 reported by shihanzhang on 2014-04-08
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
Low
wanghao

Bug Description

Cinder/Neutron now doesn't check the existing reousrces when user lower the quota sets.

It will bring some confusion to end user.

Simple steps to test:

Step1: Create 3 volumes successfully and the quota limit for volume is 10(default).

Step2: Update the quota set, lower the volume limit to 1. The update operation will be successfully too.

Step3: Create one more volume and get failed since "Maximum number of volumes allowed (1) exceeded".

I knew we have discussed this 'bug' and I understood guys' point about this feature.
But undeniably, I also has received some complains from end users, they feel confusion why the existing resources more than the limits of quota but they can't create any resources any more. So,this maybe is inappropriate as 'bug fix', just want to optimize this API.

Changed in neutron:
assignee: nobody → shihanzhang (shihanzhang)
Changed in cinder:
assignee: nobody → shihanzhang (shihanzhang)
Mike Perez (thingee) wrote :

Can you please be more descriptive on how you're updating the quota?

Changed in cinder:
status: New → Incomplete
shihanzhang (shihanzhang) wrote :

for example:
#cinder quota-show 8d7c1f20e13b4268af85649a4dac5edc
+-----------+-------+
| Property | Value |
+-----------+-------+
| gigabytes | 1000 |
| snapshots | 10 |
| volumes | 10 |
+-----------+-------+
#cinder quota-update --volumes 8 8d7c1f20e13b4268af85649a4dac5edc
+-----------+-------+
| Property | Value |
+-----------+-------+
| gigabytes | 1000 |
| snapshots | 10 |
| volumes | 8 |
+-----------+-------+
so update the value of quota from large to small, it should failed

Mike Perez (thingee) wrote :

I still don't follow, sorry. Behavior seems to be the same in nova: http://paste.openstack.org/show/75807

shihanzhang (shihanzhang) wrote :

Hi, Mike, I think you don't get my meaning, in your example, if you already have 10 VMs, then you update the quota of instance to 9, nova will failed

Huang Zhiteng (zhiteng-huang) wrote :

Zhang Shihan, if you are saying that Nova doesn't allow updating quota to a level that is lower than quota usage, you should be specific in the bug. Please update the bug report.

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

Changed in neutron:
status: New → In Progress

Hi, Zhiteng Huang, I think it is reasonable in nova, forgive me this question does not make clear, I mean if you have 10 VM in nova and the quota of instance is 20, then you update the quota of instance to 9, nova will tell you shouldn't do this!

Mike Perez (thingee) wrote :

shihanzhang, thanks for the clarification. This now makes more sense.

Changed in cinder:
status: Incomplete → Triaged
importance: Undecided → Low
ling-yun (zengyunling) on 2014-04-16
Changed in cinder:
assignee: shihanzhang (shihanzhang) → ling-yun (zengyunling)

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

Changed in cinder:
status: Triaged → In Progress

I don't know if I see this as a bug. There's a use case in my opinion that a provider or private admin may want to adjust a users quota to a lower level even if it is below what they're currently using. The idea here is that an admin shouldn't be limited to what the user is actually using at the time.

Also, the idea is they may have "N" objects now, but as they delete those objects, we still want to ensure they stay at a new lower quota etc.

Not sure I'm explaining this well, but I don't view this as a bug.

Changed in cinder:
status: In Progress → Invalid
Changed in cinder:
status: Invalid → In Progress
Cory Stone (corystone) wrote :

This is certainly not a bug. Why would you restrict the admin's ability to set quotas?

Bo Lin (linb) wrote :

Hi Cory, one case is like #7 describes: If you have 10 VM in nova and the quota of instance is 20, then you update the quota of instance to 9, nova will tell you shouldn't do this!

Huang Zhiteng (zhiteng-huang) wrote :

I'm sick and tired of people telling me that Nova does this Nova does that and we should do that as well in Cinder. That doesn't necessarily make it a sound reason to do anything.

In a case when admin really want to set the quota for a user, whose quota was 20 instances and already spawned 10, to 5. How could you do that in Nova? Step 1: setting quota to 10, and then setup a script monitor # of instance for that specific user to send yourself a notification. Step 2, cross-finger and wait for the user to shutdown one or more of his/her instances so that you can lower his/her quota even more (hopefully that user didn't boot new instance before you can change the quota). Step 3, iterate step 1 and 2 until you can actually reduce quota to 5?

Mike Perez (thingee) wrote :

I also agree with John, Cory and Winston. Berlin, perhaps bring this up to the mailing list to get the users' opinion on this.

summary: - the problem of updating quota
+ Quotas should not be updated to a value lower than current usage

Change abandoned by Huang Zhiteng (<email address hidden>) on branch: master
Review: https://review.openstack.org/87871

wanghao (wanghao749) on 2015-07-10
Changed in cinder:
assignee: ling-yun (zengyunling) → wanghao (wanghao749)
wanghao (wanghao749) on 2015-07-10
description: updated

Reviewed: https://review.openstack.org/197938
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=b2abe32ed02649dd2e21fbc945e8863798419450
Submitter: Jenkins
Branch: master

commit b2abe32ed02649dd2e21fbc945e8863798419450
Author: wanghao <email address hidden>
Date: Thu Jul 2 17:41:17 2015 +0800

    Validate value when user update quota

    Cinder currently doesn't check the existing resource
    when user lowers the quota sets. It should have an optional
    action that doesn't allow to update the quota of resources
    lower than current usage.

    This patch adds code to validate the update value of quota and
    ensure the value can't be lower than existing resource.

    APIImpact
    Add an optional boolean argument 'skip_validation' with default value True.
    {
      "quota_set": {xxxx},
      "skip_validation": 'True'/'False'
    }
    If skip_validation=False and the update value is lower than existing resource,
    API will return 400 Bad Request.

    Change-Id: I24428ce53e5d10e77235f372bb6d0b70ea672412
    Closes-Bug: #1304234

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2015-09-03
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-10-15
Changed in cinder:
milestone: liberty-3 → 7.0.0
no longer affects: neutron
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers