Cinders new attach API doesn't allow novas live-migrate cheat

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

Bug Description

Currently the new cinder attachment_create method only allows creating attachments for volumes that are in available or downloading state. We intend to allow multiple attachments when multi-attach is ready to land and then manage everything off of attachment-id's, but for now we're not enabling that.

The problem is that Nova does a little trick when it performs things like live-migration and it actually sets up two attachments at the same time. So we need to provide some way for Nova to be able to create another attachment record even though the volume status is still "in-use". There's a number of things that can be done here like a new "migrating" status etc, but for now the best option might be to just check if the attachment is for the same instance-uuid and if it is, allow the creation of the new record.

Revision history for this message
Ildiko Vancsa (ildiko-vancsa) wrote :

The instance-uuid check was suggested from the Nova side as well: https://github.com/openstack/nova-specs/blob/master/specs/pike/approved/cinder-new-attach-apis.rst

We might end up with too many flags if we would go down that path, so I think experimenting with the instance-uuid direction should be good.

Changed in cinder:
status: New → Confirmed
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/469252

Changed in cinder:
assignee: nobody → John Griffith (john-griffith)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/469252
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=220dafc65cdffaefa867380a476aa7fcd55268c4
Submitter: Jenkins
Branch: master

commit 220dafc65cdffaefa867380a476aa7fcd55268c4
Author: John Griffith <email address hidden>
Date: Tue May 30 21:08:20 2017 +0000

    Add an instance-uuid check on attachment_reserve

    Currently the new cinder attachment_create method only allows creating
    attachments for volumes that are in available or downloading state. We
    intend to allow multiple attachments when multi-attach is ready to
    land and then manage everything off of attachment-id's, but for now
    we're not enabling that.

    In order to allow Nova to continue to do things like live-migration
    which is really a special case of multi-attach we'll add an instance
    uuid check that allows this flow to continue until we fully turn on
    multi-attach.

    Just check on the _attachment_reserve, if there's an instance_uuid
    specified, and it matches the existing attachments ignore the status
    check failure.

    Change-Id: I507d7a552c713b097cbcee1598757f53d70f0b4d
    Closes-Bug: #1694530

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

This issue was fixed in the openstack/cinder 11.0.0.0b2 development milestone.

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

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

commit 6eba403ba020292806d0ec35edc7964eaa8e8eaf
Author: zhangyang <email address hidden>
Date: Fri Jan 25 18:11:17 2019 +0800

    Create volume attachments status check.

    Currently the new cinder attachment_create method allows volumes in
    all status to be performed for single attachment. This may cause
    problems if volume-attach operation is taken on volumes in creating
    status.
    In order to avoid these problems, we should only allow volumes
    in 'in-use', 'reserved' status to check whether this attachment
    creation is a override operation for a same instance.

    Related-bug: #1694530
    Change-Id: Ie59f609d38290147a67a936c61e0164fe278da99
    Closes-Bug: #1813267

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.