Do not recreate libvirt secret when one already exists on the host during a host reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Lee Yarwood | ||
Queens |
In Progress
|
Undecided
|
Lee Yarwood | ||
Rocky |
In Progress
|
Undecided
|
Lee Yarwood | ||
Stein |
In Progress
|
Undecided
|
Lee Yarwood | ||
Train |
In Progress
|
Undecided
|
Lee Yarwood | ||
Ussuri |
In Progress
|
Undecided
|
Lee Yarwood | ||
Victoria |
Fix Released
|
Undecided
|
Lee Yarwood | ||
Wallaby |
Fix Released
|
Undecided
|
Unassigned | ||
Xena |
Fix Released
|
Medium
|
Lee Yarwood |
Bug Description
Description
===========
When [compute]
When using the libvirt driver and instances with attached LUKSv1 encrypted volumes a call is made to _attach_encryptor that currently assumes that any volume libvirt secrets don't already exist on the host. As a result this call will currently lead to an attempt to lookup encryption metadata that fails as the compute service is using a bare bones local only admin context to drive the restart of the instances.
The libvirt secrets associated with LUKSv1 encrypted volumes actually persist a host reboot and thus this call to fetch encryption metadata, fetch the symmetric key etc are not required. Removal of these calls in this context should allow the compute service to start instances with these volumes attached.
Steps to reproduce
==================
* Enable [compute]
* Launch instances with encrypted LUKSv1 volumes attached
* Reboot the underlying host
Expected result
===============
* The instances are restarted successfully by Nova as no external calls are made and the existing libvirt secret for any encrypted LUKSv1 volumes are reused.
Actual result
=============
* The instances fail to restart as the initial calls made by the Nova service use an empty admin context without a service catelog etc.
Environment
===========
1. Exact version of OpenStack you are running. See the following
master
2. Which hypervisor did you use?
(For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...)
What's the version of that?
libvirt + QEMU/KVM
2. Which storage type did you use?
(For example: Ceph, LVM, GPFS, ...)
What's the version of that?
N/A
3. Which networking type did you use?
(For example: nova-network, Neutron with OpenVSwitch, ...)
N/A
Logs & Configs
==============
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
t_secret
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
t_barbican_client
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
eate_base_url
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
data_for
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
2020-08-20 11:30:12.273 7 ERROR nova.virt.
in progress in https:/ /review. opendev. org/c/openstack /nova/+ /764246