Cinder doesn't correctly handle OverQuota exception during volume transfer

Bug #1539459 reported by Pavel Abalikhin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Lisa Li

Bug Description

Cinder doesn't correctly handle OverQuota exception during volume transfer.

Steps to reproduce:

1. Create a volume.

2. Try to transfer it to a project which hasn't enough free quotas to accept this volume.

3. Result: volume transferred to donor project, quotas usages didn't change, 500 error.

Problem is here: https://github.com/openstack/cinder/blob/master/cinder/transfer/api.py#L187. 'overs' is a list of strings but this code tries to find a substring. 'except' part breaks and doesn't raise any exception.
It's example of right handling https://github.com/openstack/cinder/blob/master/cinder/volume/api.py#L752 and we should do the same thing here.

Also I thing it's a good idea to have one common function for quota handling and use it in all such places.

Revision history for this message
Pavel Abalikhin (anpavl) wrote :
Changed in cinder:
importance: Undecided → Medium
Lisa Li (lisali)
Changed in cinder:
assignee: nobody → Lisa Li (lisali)
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/281053

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/281053
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=b5aef3add5df286821de02a5417f07ac5f1101c4
Submitter: Jenkins
Branch: master

commit b5aef3add5df286821de02a5417f07ac5f1101c4
Author: LisaLi <email address hidden>
Date: Wed Feb 17 13:24:50 2016 +0800

    Handle OverQuota exception during volume transfer

    Cinder doesn't correctly handle OverQuota during volume
    transfer. It only checks quota volumes and gigabytes,
    and ignores quotas in volume type. As a result, when it
    exceeds volumes and gigabytes of a volume type, Cinder doesn't
    raise exception and allows accept move on.

    This patch is to check every over quota in overs and fixes the
    problem.

    Change-Id: I02ef576ecb3052724bc14a3bd2df842bec554e0d
    Closes-bug: #1539459

Changed in cinder:
status: In Progress → 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.