nova/nova/virt/libvirt/volume
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
..
__init__.py libvirt: move volume/remotefs/quobyte modules under volume subdir 2015-07-28 17:46:05 -07:00
aoe.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
disco.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
fibrechannel.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
fs.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
glusterfs.py Config options: centralize glusterfs libvirt options (9) 2016-05-06 08:29:51 +00:00
gpfs.py libvirt: convert GPFS volume driver to LibvirtBaseFileSystemVolumeDriver 2015-08-10 09:34:39 +00:00
hgst.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
iscsi.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
iser.py Config options: centralize iser libvirt options (11) 2016-05-06 08:30:17 +00:00
net.py libvirt: handle missing rbd_secret_uuid from old connection info 2017-06-12 09:16:49 -04:00
nfs.py Config options: centralize volume nfs libvirt options (13) 2016-05-06 08:30:41 +00:00
quobyte.py libvirt: Stop misusing NovaException 2016-12-15 12:42:30 +00:00
remotefs.py Properly quote IPv6 address in RsyncDriver 2016-08-01 14:56:37 +03:00
scaleio.py libvirt: Pass Host instead of Driver to volume drivers 2016-11-01 16:41:08 +00:00
scality.py libvirt: Stop misusing NovaException 2016-12-15 12:42:30 +00:00
smbfs.py Config options: centralize smbfs libvirt options (16) 2016-05-12 09:26:17 +00:00
volume.py Merge "[2/3]Replace six.iteritems() with .items()" 2017-01-21 06:55:52 +00:00
vzstorage.py libvirt: Stop misusing NovaException 2016-12-15 12:42:30 +00:00