Incorrect Cinder quota usage shown via CLI/API after Quota Settings Changed

Bug #1410034 reported by Bruce Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Gorka Eguileor

Bug Description

Reproduce steps:
 1.Update nova quota settings.
    cinder quota-update --volumes vaule TENANT_ID
    cinder quota-update --gigabytes 100 TENANT_ID
   cinder quota-update --snapshots 30 TENANT_ID
 2.Delete the quota settings and the quota should back to the default.
   cinder quota-delete --tenant TENANT_ID

 3.Query nova quota usage
   cinder absolute-limits --tenant tenant_ID
  the usage of volume show "0", it is not correct.

The issue is observed on Havana & icehouse.

Bruce Xu (yunyoxu)
description: updated
Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

Exactly what 'delete quotas for a tenant' means is not clearly defined, but I think setting them to zero meets one definition.

Putting them to defaults is somewhat counter intuitive - if you delete somebody's quota and they have quota afterwards (might even be *more* quota than before the delete if the defaults are higher than the override) I'd say that was unexpected.

Might be better to add a separate command to give somebody back default quota(s)?

Changed in cinder:
status: New → Opinion
Revision history for this message
Bruce Xu (yunyoxu) wrote :

The main problem is that, when we delete the quota settings, the value of total used volumes/gigabytes/snapshots show "0".
It is strange, since we do not delete any volumes on cinder and the volumes still in use.
The used resource should be not updated when we delete or update the quota.

Revision history for this message
Sergey Gotliv (sgotliv) wrote :

Behavior should be consistent across the Openstack. Nova folks on that launchpad[1] (comments 1 and 2) claim
that on Nova master running

nova quota-delete --tenant TENANT_ID

doesn't zero a quota. If its true, I would expect from Cinder to do the same.

[1] https://bugs.launchpad.net/nova/+bug/1410032

Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

@sgotliv Are you referencing the right bug there? Comments 1 and two are 'can't reproduce' and 'marking as invalid' followed by a reproducer, no comments there about what the 'correct behaviour should be.

@yunyoxu Resetting the usage record is definitely a bug.

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

If you delete set quotas for a user, I would expect things to fall back to the default.

Revision history for this message
Bruce Xu (yunyoxu) wrote :

yes, the quota will fall back to the default when delete the quotas. But the usage recording also reset to "0", that is not correct.
we expect reset the quotas to default and keep the usage as it is.

Revision history for this message
Wei T (nuaafe) wrote :
Gorka Eguileor (gorka)
Changed in cinder:
assignee: nobody → Gorka Eguileor (gorka)
status: Opinion → In Progress
Revision history for this message
Gorka Eguileor (gorka) wrote :

I've been looking into this and it is my understanding that this is a misconception in the implementation.
API clearly states for os-quota-sets delete: "Deletes quotas for a tenant so the quotas revert to default values"
It doesn't say anything about deleting usage or reservations which, as you guys mentioned, are being deleting right now.

If we want to have a way to clear/reset usage/reservations we should have a look into it, although I can't think right now of a good reason why we would need it. For now we should fix this.

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/162722

Revision history for this message
Gorka Eguileor (gorka) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit 0ee1ea83b90de8d342fa242e311f1680fef66a92
Author: Gorka Eguileor <email address hidden>
Date: Mon Mar 9 19:39:11 2015 +0100

    Preserve usage and reservations on quota deletion

    Current API deletes quota usage and reservations on quota limit
    deletion.

    According to API documentation what should only happen is that quotas
    limits revert to default values by deleting tenant/user limits.

    This patch fixes this issue.

    APIImpact: Delete on os-quota-sets will no longer remove usage and
               reservation quotas. Those quotas are handled by Cinder
               service.
    UpgradeImpact: There is no upgrade impact afaik.
    Closes-Bug: #1410034
    Change-Id: I9340b6f78623cfa5b505886ad75b8e4d3cd6131b

Changed in cinder:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/189588

Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/kilo)

Change abandoned by Gorka Eguileor (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/189588

Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-1 → 7.0.0
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.