Bind mount swtpm logs in libvirt virtqemud container

Without this change, logs cannot be directly accessed on a host:

sudo podman exec -it nova_virtqemud cat /var/log/swtpm/libvirt/qemu/...

Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Change-Id: Ib7edb8c2ecbc5c44a85f4040e95be22874fa2f30
This commit is contained in:
Bogdan Dobrelya 2022-06-03 15:38:34 +02:00
parent 92d7061e91
commit ef5d2f45a3
2 changed files with 8 additions and 0 deletions

View File

@ -674,6 +674,7 @@ outputs:
- {get_attr: [NovaLibvirtCommon, volumes]}
- {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]}
- - /var/lib/kolla/config_files/nova_virtqemud.json:/var/lib/kolla/config_files/config.json:ro
- /var/log/containers/libvirt/swtpm:/var/log/swtpm:z
- nova_virtproxyd:
start_order: 5
image: {get_attr: [RoleParametersValue, value, ContainerNovaLibvirtImage]}
@ -922,6 +923,7 @@ outputs:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype | default(omit) }}"
mode: "{{ item.mode | default(omit) }}"
with_items:
- { 'path': /etc/libvirt, 'setype': container_file_t }
- { 'path': /etc/libvirt/secrets, 'setype': container_file_t }
@ -932,6 +934,7 @@ outputs:
- { 'path': /run/libvirt, 'setype': virt_var_run_t }
- { 'path': /var/log/libvirt, 'setype': container_file_t }
- { 'path': /var/log/libvirt/qemu, 'setype': container_file_t }
- { 'path': /var/log/containers/libvirt/swtpm, 'setype': container_file_t, 'mode': '0750' }
# qemu user on host will be cretaed by libvirt package install, ensure
# the qemu user created with same uid/gid as like libvirt package.
# These specific values are required since ovs is running on host.

View File

@ -0,0 +1,5 @@
---
features:
- |
Containerized Libvirt swtpm logs will be placed into
`/var/log/containers/libvirt/swtpm` host path.