nova/nova/tests/unit/virt
Lee Yarwood 2c6e59e835 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)
2019-04-30 09:27:36 +01:00
..
disk Don't use private interface in oslo.service 2018-11-21 16:37:38 -05:00
hyperv hyperv: Cleans up live migration Planned VM 2018-09-14 11:49:17 -06:00
image
ironic Merge "pass endpoint interface to Ironic client" into stable/rocky 2019-03-21 15:59:11 +00:00
libvirt libvirt: Avoid using os-brick encryptors when device_path isn't provided 2019-04-30 09:27:36 +01:00
powervm Merge "Rename recreate to evacuate in driver signatures" 2018-07-21 23:19:40 +00:00
vmwareapi Rename recreate to evacuate in driver signatures 2018-04-19 14:07:47 +01:00
xenapi XenAPI/Stops the migration of volume backed VHDS 2018-09-20 19:57:37 +00:00
zvm z/VM Driver: add get console output 2018-07-16 11:35:11 +08:00
__init__.py
fakelibosinfo.py
test_block_device.py Override the 'get' method in DriverBlockDevice class 2019-03-26 12:13:56 +09:00
test_configdrive.py
test_driver.py Remove usage of parameter enforce_type 2017-04-17 20:23:19 +08:00
test_events.py
test_fake.py
test_firewall.py remove get_nw_info_for_instance from compute.utils 2017-06-13 13:30:06 +02:00
test_hardware.py hardware: fix memory check usage for small/large pages 2018-09-03 14:45:26 +00:00
test_imagecache.py
test_images.py Fix execute mock for test_convert_image_with_errors 2018-06-14 12:33:21 +00:00
test_netutils.py Remove unnecessary code 2017-07-28 06:01:21 +00:00
test_osinfo.py Do not attempt to load osinfo if we do not have os_distro 2017-03-23 22:07:03 -04:00
test_virt.py Rename block_device_info_get_root 2018-01-11 20:46:13 +00:00
test_virt_drivers.py Revert "libvirt: slow live-migration to ensure network is ready" 2018-08-13 06:20:04 +00:00