nova/nova/virt/libvirt
Matt Riedemann fb4184f1e6 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 <tadas@ring.lt>

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 f2d27f6a8a)
2017-06-12 09:16:49 -04:00
..
storage Merge "Fix decoding of encryption key passed to dmcrypt" into stable/ocata 2017-05-23 23:31:32 +00:00
volume libvirt: handle missing rbd_secret_uuid from old connection info 2017-06-12 09:16:49 -04:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py Merge "Fix root_device_name for Xen" 2017-01-31 18:56:46 +00:00
compat.py Replace deprecated LOG.warn with LOG.warning 2016-03-15 11:57:56 +00:00
config.py libvirt: Use the mirror element to detect job completion 2017-01-25 11:35:47 +00:00
designer.py libvirt: conditionally set script path for ethernet vif types 2017-03-21 15:09:28 -04:00
driver.py Use VIR_DOMAIN_BLOCK_REBASE_COPY_DEV when rebasing 2017-06-08 01:00:05 +00:00
firewall.py libvirt: ignore conflict when defining network filters 2016-09-22 13:53:38 -04:00
guest.py Use VIR_DOMAIN_BLOCK_REBASE_COPY_DEV when rebasing 2017-06-08 01:00:05 +00:00
host.py [py35] Fixes to get rally scenarios working 2017-01-13 15:44:00 +00:00
imagebackend.py get_model method missing for Ploop image 2017-03-20 17:59:10 +00:00
imagecache.py Port libvirt test_imagecache to Python 3 2016-11-23 19:51:42 +08:00
instancejobtracker.py Replace deprecated LOG.warn with LOG.warning 2016-03-15 11:57:56 +00:00
migration.py Change exponential function to linear 2017-01-26 15:24:20 +00:00
utils.py Merge "libvirt: workaround findmnt behaviour change" 2017-02-03 13:37:23 +00:00
vif.py Use six.text_type() when logging Instance object 2017-05-22 10:57:28 +00:00