create backup from in-use volume destroy quota value

Bug #1670636 reported by int32bit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
lihaijing

Bug Description

Currently if we create a backup from a in-use volume, we will create a temp volume first, this volume is created directly from DB, and skip quota compute[1]:

[1] https://github.com/openstack/cinder/blob/master/cinder/volume/driver.py#L1430-L1459

But when we finish creating backup and to cleanup temp volume, we call volume-api to delete temp volume and will release its quota we don't compute before[2]

[2] https://github.com/openstack/cinder/blob/master/cinder/backup/manager.py#L304-L315

As result, creating hot-backup will reduce user's volume in-use quota value.

Revision history for this message
int32bit (int32bit) wrote :

IMO, we need commit quota before create temp volume to keep quota consistence.

Changed in cinder:
assignee: nobody → int32bit (int32bit)
Revision history for this message
int32bit (int32bit) wrote :

But even if user's volume quota is full, we should allow user to create backup, so user's volume quota may be larger than max limit before cleanup temp volume.

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: int32bit (int32bit) → nobody
lihaijing (lihaijing)
Changed in cinder:
assignee: nobody → lihaijing (lihaijing)
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/535167

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

Reviewed: https://review.openstack.org/535167
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c755e29126dc990f000097064937c5d9676cb3cc
Submitter: Zuul
Branch: master

commit c755e29126dc990f000097064937c5d9676cb3cc
Author: lihaijing <email address hidden>
Date: Thu Jan 18 13:14:45 2018 +0800

    Fix cinder quota-usage error

    When backing up a snapshot or 'in-use' volume,
    cinder creates a temp volume from the snapshot
    or 'in-use' volume, then backup the temp volume.
    The temp volume doesn't use the volume-quota,
    but deleting the temp volume when finishing
    backup will minus quota. This process leads to
    a wrong quota-usage. So add admin volume metadata
    when creating the temporary volume and then use
    that data to detect temporary volume. Then skip
    handling quota when deleting the temp volume.

    Change-Id: If100a678cf9062c4078f850d8edc001b6b0705f4
    Closes-Bug: #1670636

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0rc1

This issue was fixed in the openstack/cinder 12.0.0.0rc1 release candidate.

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/579691

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/pike)

Reviewed: https://review.openstack.org/579691
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=f8212217e9ebc16876e5dda815cc7db0900ff83b
Submitter: Zuul
Branch: stable/pike

commit f8212217e9ebc16876e5dda815cc7db0900ff83b
Author: lihaijing <email address hidden>
Date: Thu Jan 18 13:14:45 2018 +0800

    Fix cinder quota-usage error

    When backing up a snapshot or 'in-use' volume,
    cinder creates a temp volume from the snapshot
    or 'in-use' volume, then backup the temp volume.
    The temp volume doesn't use the volume-quota,
    but deleting the temp volume when finishing
    backup will minus quota. This process leads to
    a wrong quota-usage. So add admin volume metadata
    when creating the temporary volume and then use
    that data to detect temporary volume. Then skip
    handling quota when deleting the temp volume.

    Change-Id: If100a678cf9062c4078f850d8edc001b6b0705f4
    Closes-Bug: #1670636
    (cherry picked from commit c755e29126dc990f000097064937c5d9676cb3cc)
    Conflicts:
     cinder/tests/unit/utils.py

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 11.2.0

This issue was fixed in the openstack/cinder 11.2.0 release.

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.