Execute kvm-setup inside nova_libvirt container

On POWER8 (and some others), kvm requires some additional setup before
VMs can be successfully run. There is a script to perform this setup,
but it is provided as a systemd service -- we don't have systemd inside
containers, so let's include the invocation of the script in the
definition of the container.

Change-Id: I1e7208e4bd1c7f0c87354b6f6963c0d2df86cc02
Closes-Bug: #1878048
This commit is contained in:
Jeremy Freudberg 2020-05-11 12:33:12 -04:00
parent 29a7fb84ce
commit 3873d36075
1 changed files with 20 additions and 5 deletions

View File

@ -567,11 +567,7 @@ outputs:
config_image: {get_param: ContainerNovaLibvirtConfigImage}
kolla_config:
/var/lib/kolla/config_files/nova_libvirt.json:
command:
if:
- use_tls_for_live_migration
- /usr/sbin/libvirtd --listen
- /usr/sbin/libvirtd
command: /nova_libvirt_launcher.sh
config_files:
list_concat:
-
@ -642,6 +638,24 @@ outputs:
dest: "/"
merge: true
preserve_properties: true
container_config_scripts:
nova_libvirt_launcher.sh:
mode: "0755"
content:
str_replace:
template: |
#!/bin/bash
set -xe
if [[ -f /usr/lib/systemd/kvm-setup ]]; then
/usr/lib/systemd/kvm-setup
fi
/usr/sbin/libvirtd LIBVIRTD_ARGS
params:
LIBVIRTD_ARGS:
if:
- use_tls_for_live_migration
- '--listen'
- ''
docker_config:
step_3:
nova_virtlogd:
@ -694,6 +708,7 @@ outputs:
- /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro
- /var/lib/kolla/config_files/nova_libvirt.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/nova_libvirt:/var/lib/kolla/config_files/src:ro
- /var/lib/container-config-scripts/nova_libvirt_launcher.sh:/nova_libvirt_launcher.sh:ro
- /etc/ceph:/var/lib/kolla/config_files/src-ceph:ro
- /lib/modules:/lib/modules:ro
- /dev:/dev