nova/nova/virt
Lee Yarwood 4908daed96 libvirt: Simplify device_path check in _detach_encryptor
Introduced by Id670f13a7f197e71c77dc91276fc2fba2fc5f314 to resolve bug
 #1821696 this check was put in place to ensure _detach_encryptor did not
attempt to use the os-brick encryptors with an unsupported volume type
after libvirt secrets had been removed outside the control of Nova.

With the introduction of the [workarounds]disable_native_luksv1 via
Ia500eb614cf575ab846f64f4b69c9068274c8c1f however the use of
_allow_native_luksv1 as part of this check is no longer valid. As this
helper was updated to return False when the workaround is enabled,
regardless of the underlying volume being attached natively or not.

If an admin had enabled the workaround after users had launched
instances with natively attached encrypted volumes *and* the libvirt
secrets had gone missing _detach_encryptor would attempt to use the
os-brick encryptors. This would fail when the underlying volume type is
unsupported, for example rbd. See bug #1917619 for an example.

This change resolves this corner case by dropping the use of
_allow_native_luksv1 from the check and just asserting that a
device_path is present for an encrypted volume before allowing the use
of the os-brick encryptors. As noted this is safe as calls to the
encryptors are idempotent, ignoring failures to detach when the
underlying volume type is supported.

Closes-Bug: #1917619
Change-Id: Iba40c2df72228b461767d5734d5a62403d9f2cfa
2021-03-23 12:38:40 +00:00
..
disk Merge "Remove VFSLocalFS" 2021-03-16 17:33:45 +00:00
hyperv compute: Report COMPUTE_SECURITY_UEFI_SECURE_BOOT 2021-03-08 16:33:16 +00:00
image
ironic cmd: Remove 'nova-manage db ironic_flavor_migration' 2021-02-10 15:32:03 +00:00
libvirt libvirt: Simplify device_path check in _detach_encryptor 2021-03-23 12:38:40 +00:00
powervm compute: Report COMPUTE_SECURITY_UEFI_SECURE_BOOT 2021-03-08 16:33:16 +00:00
vmwareapi Merge "vmware: Use cookiejar from oslo.vmware client directly" 2021-02-13 16:59:34 +00:00
zvm Remove six.text_type (1/2) 2020-12-13 11:25:31 +00:00
__init__.py
arch.py Added ability to configure default architecture for ImagePropertiesFilter 2018-05-14 16:55:13 -04:00
block_device.py trivial: Resolve (most) flake8 3.x issues 2019-12-11 16:57:22 +00:00
configdrive.py Remove six.text_type (1/2) 2020-12-13 11:25:31 +00:00
driver.py compute: Report COMPUTE_SECURITY_UEFI_SECURE_BOOT 2021-03-08 16:33:16 +00:00
event.py Port binding based on events during live migration 2018-07-19 09:09:55 -04:00
fake.py virt: Remove 'get_all_bw_counters' API 2020-11-24 15:29:21 +00:00
hardware.py hardware: Start parsing 'os_secure_boot' 2021-03-08 16:33:15 +00:00
imagecache.py Include removal of ephemeral backing files in the image cache manager 2020-10-09 12:24:06 +01:00
images.py images: Make JSON the default output format of calls to qemu-img info 2020-04-16 16:38:24 +01:00
interfaces.template
netutils.py nova-net: Remove final references to nova-network 2020-01-08 13:54:12 +00:00
osinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
storage_users.py
virtapi.py Add a way to exit early from a wait_for_instance_event() 2019-12-02 07:00:26 -08:00