API check for valid states to allow detaching from is wrong

Bug #1199922 reported by Duncan Thomas on 2013-07-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duncan Thomas

Bug Description

volume.api.check_detach currently does:
    if volume['status'] == "available":
        raise exception.ApiError(_("Volume is already detached"))
..and otehrwise allows the detach to proceed.

This means that if the volume is in attaching, then the detach proceeds. If the compute side detach does an eventlet yield, then the detach can happen while the attach is mid way through doing an attach, which can result in badness.

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

Changed in cinder:
status: New → In Progress

Reviewed: https://review.openstack.org/36522
Committed: http://github.com/openstack/cinder/commit/cfe8dc42254e6f808bec61f89ea4a43504704000
Submitter: Jenkins
Branch: master

commit cfe8dc42254e6f808bec61f89ea4a43504704000
Author: Duncan Thomas <email address hidden>
Date: Wed Jul 10 19:28:39 2013 +0100

    Change check-detach to reject more states

    Change check_detach is reject anything other than 'in-use', rather than
    just rejecting 'available'.

    Fixes bug #1199922

    Change-Id: I3180540ca7bb699a3494ca4eea1389ae8a117df0

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-07-17
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers