Comment 6 for bug 1687581

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/ocata)

Reviewed: https://review.openstack.org/472687
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fb4184f1e690901378a155573368a55ff9a8a779
Submitter: Jenkins
Branch: stable/ocata

commit fb4184f1e690901378a155573368a55ff9a8a779
Author: Matt Riedemann <email address hidden>
Date: Thu Jun 8 09:35:42 2017 -0400

    libvirt: handle missing rbd_secret_uuid from old connection info

    Change Idcbada705c1d38ac5fd7c600141c2de7020eae25 in Ocata
    started preferring Cinder connection info for getting RBD auth
    values since Nova needs to be using the same settings as Cinder
    for volume auth.

    However, that introduced a problem for guest connections made
    before that change, where the secret_uuid might not have been
    configured on the Cinder side and that's what is stored in the
    block_device_mappings.connection_info column and is what we're
    checking in _set_auth_config_rbd. Before Ocata this wasn't a
    problem because we'd use the Nova configuration values for the
    rbd_secret_uuid if set. But since Ocata it is a problem since
    we don't consult nova.conf if auth was enabled, but not completely
    configured, on the Cinder side.

    So this adds a fallback check to set the secret_uuid from
    nova.conf if it wasn't set in the connection_info via Cinder
    originally. A note is also added to caution about removing
    any fallback mechanism on the nova side - something we'd
    need to consider before we could likely drop this code.

    Co-Authored-By: Tadas Ustinavičius <email address hidden>

    NOTE(mriedem): The unit test is modified slightly to not
    pass an instance to the disconnect_volume method as that
    was only available starting in Pike: b66b7d4f9d

    Change-Id: I6fc7108817fcd9df4a342c9dabbf14ab7911d06a
    Closes-Bug: #1687581
    (cherry picked from commit f2d27f6a8afb62815fb6a885bd4f8ae4ed287fd3)