Comment 5 for bug 1741476

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

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

commit e69a6a5e0626177c70ed0eafa3be6a45fbfb3f05
Author: John Griffith <email address hidden>
Date: Wed Jan 10 14:24:11 2018 -0700

    Fix readonly mode for new attachment API calls

    The introduction of the new attachment API's doesn't
    know how to deal with RO volumes that don't use the
    connector to set their values.

    One of the ways to do RO volumes in cinder is to set
    a parameter in the admin_metadata of the volume. If
    this is set, we expect the connector to have a matching
    mode setting in it's parameters. During finalizing of
    an attachment this values are compared and if they don't
    match the attach fails.

    The New attachment calls from the Nova side don't set
    this information; and honestly using the connector for
    this isn't such a great idea anyway. To address this
    change in behavior/bug however we'll default to the
    settings of the volume admin_metadata.

    When an attachment is created, we'll check the volumes
    admin_metadata and set the attach_mode of the attach
    object to ro if required. Additionally, when the
    attachment-completion is performed in the manager, we'll
    use the attach_mode setting of the attachment object to
    override and force any settings in the connector.

    This seems like a better option than forcing Nova to check
    and set based on the metadata, and there's no real value
    in having an extra lever or requirement during attach that
    can go wrong. There's no case where seting the admin_metadata
    to Read Only on a volume and attaching it any other way than
    'ro' is valid, so just use the metdata directly.

    Going forward we deprecate the use of admin_metadata for
    Read Only settings and replace it with an attachment-create
    option.

    Closes-Bug: # 1741476

    Change-Id: Id0aea58f7091c78fcd38a47e475384807f1c04c7