attachment_reserve shouldn't change status of in-use volumes

Bug #1717564 reported by John Griffith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
John Griffith

Bug Description

There are a number of places on the Nova side where we need to do things with volume connections like remove an attachment and immediately reserve a new one. This introduces a protential race where bad things can happen. To deal with that, we actually want to to create a new attachment to do a reserve, BEFORE we delete the current attachment.

The problem is that the new Attachment code currently will toggle the volume status and attach status such that you will then not be able to remove the attachment in the future, and it also makes things such that the true state of the volume is not reflected properly.

We should either allow delete of reserved volume.status or we should not set reserved on a volume that's still in use. The second option here seems like it would be a better fit for when we do multi-attach so we should probably fix it that way.

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

Changed in cinder:
assignee: nobody → John Griffith (john-griffith)
status: New → In Progress
Revision history for this message
John Griffith (john-griffith) wrote :

Note that the root of the problem here is in the attachmend_delete as opposed to the create. We handle reserve of in-use pretty well already as long as the Instance UUID matches.

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

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

commit 64612cdbfbd21f6aa5a532b4caf42af7187014eb
Author: j-griffith <email address hidden>
Date: Fri Sep 15 11:21:47 2017 -0600

    Check for outstanding attachments during reserve

    There are a number of places on the Nova side where we need to do things
    with volume connections like remove an attachment and immediately
    reserve a new one. This introduces a potential race where bad things
    can happen. To deal with that, we actually want to to create a new
    attachment to do a reserve, BEFORE we delete the current attachment.

    The problem is that the new Attachment code currently will toggle the
    volume status and attach status such that you will then not be able to
    remove the attachment in the future, and it also makes things such that
    the true state of the volume is not reflected properly.

    This patch adds a check on reserve for additional attachments and if
    there are attachments for a volume that have the volume as in-use we
    don't clear that status during the new reserve call.

    Change-Id: I8062897bd3d4fe20de9a5660eac6fec856cc3c1e
    Closes-Bug: #1717564

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.0b1

This issue was fixed in the openstack/cinder 12.0.0.0b1 development milestone.

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.