nova/nova/virt
Lee Yarwood ec43a1348d libvirt: Avoid using os-brick encryptors when device_path isn't provided
When disconnecting an encrypted volume the Libvirt driver uses the
presence of a Libvirt secret associated with the volume to determine if
the new style native QEMU LUKS decryption or original decryption method
using os-brick encrytors is used.

While this works well in most deployments some issues have been observed
in Kolla based environments where the Libvirt secrets are not fully
persisted between host reboots or container upgrades. This can lead to
_detach_encryptor attempting to build an encryptor which will fail if
the associated connection_info for the volume does not contain a
device_path, such as in the case for encrypted rbd volumes.

This change adds a simple conditional to _detach_encryptor to ensure we
return when device_path is not present in connection_info and native
QEMU LUKS decryption is available. This handles the specific use
case where we are certain that the encrypted volume was never decrypted
using the os-brick encryptors, as these require a local block device on
the compute host and have thus never supported rbd.

It is still safe to build an encryptor and call detach_volume when a
device_path is present however as change I9f52f89b8466d036 made such
calls idempotent within os-brick.

Change-Id: Id670f13a7f197e71c77dc91276fc2fba2fc5f314
Closes-bug: #1821696
(cherry picked from commit 56ca4d32dd)
(cherry picked from commit c6432ac021)
(cherry picked from commit 2c6e59e835)
2019-04-30 09:27:57 +01:00
..
disk libvirt: Reduce calls to qemu-img during update_available_resource 2018-09-19 12:32:57 +03:00
hyperv hyper-v: Logs tips on PortBindingFailed 2018-03-07 17:00:02 +00:00
image libvirt: virtuozzo instance resize support 2016-06-28 22:13:49 +03:00
ironic Don't emit warning when ironic properties are zero 2019-02-22 14:46:12 +00:00
libvirt libvirt: Avoid using os-brick encryptors when device_path isn't provided 2019-04-30 09:27:57 +01:00
powervm Stringify instance UUID 2018-05-10 09:56:32 -05:00
vmwareapi VMware: fix TypeError while get console log 2018-08-13 11:54:42 +00:00
xenapi xenapi: handle InstanceNotFound in detach_interface() 2018-04-26 11:18:20 +00:00
__init__.py Declare nova.virt namespace 2016-04-28 15:01:44 +00:00
arch.py Added ability to configure default architecture for ImagePropertiesFilter 2018-05-15 12:28:43 +00:00
block_device.py block_device: Rollback volumes to in-use on DeviceDetachFailed 2018-08-10 16:38:18 +01:00
configdrive.py Cleanup mount / umount and associated rmdir calls 2017-10-18 17:52:58 +11:00
driver.py Fix NoneType error in _notify_volume_usage_detach 2018-11-01 16:36:41 -04:00
event.py
fake.py Do not persist RequestSpec.ignore_hosts 2019-04-02 11:07:52 -04:00
firewall.py Merge "Remove translation of log messages" 2017-06-20 21:16:49 +00:00
hardware.py [Stable Only] hardware: Handle races during pinning 2019-03-27 12:29:05 +00:00
imagecache.py Rename ImageCacheManager._list_base_images to _scan_base_images 2016-05-26 14:45:42 +01:00
images.py libvirt: handle DiskNotFound during update_available_resource 2018-05-31 10:48:58 +01:00
interfaces.template
netutils.py provide interface-scoped nameserver information 2017-07-19 21:08:59 -04:00
osinfo.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
storage_users.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
virtapi.py Remove unused provider firewall rules functionality in nova 2016-02-01 15:50:04 +01:00