From 2cbcbb08e585222a23c24b1b813639ccdab1b8ac Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Mon, 27 Jan 2020 16:29:16 +0000 Subject: [PATCH] Revert "Remove libvirt packaged dependencies" due to https://bugs.launchpad.net/tripleo/+bug/1860971 and planning a backport later This reverts commit 220661582ef61b7cf81f4ee3c9cd52b050a76ea8. Change-Id: I6db56cec954c4d6272548791e6b73bd01b177769 --- deployment/nova/nova-compute-container-puppet.yaml | 14 +++++++++++--- deployment/nova/nova-libvirt-container-puppet.yaml | 1 + .../nova/nova-libvirt-guests-container-puppet.yaml | 11 ++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/deployment/nova/nova-compute-container-puppet.yaml b/deployment/nova/nova-compute-container-puppet.yaml index d4478dbb95..30de4d93e1 100644 --- a/deployment/nova/nova-compute-container-puppet.yaml +++ b/deployment/nova/nova-compute-container-puppet.yaml @@ -855,12 +855,18 @@ outputs: - resume_guests_state_on_host_boot_enabled|bool - container_cli == 'docker' block: + - name: make sure libvirt-client is installed + when: resume_guests_state_on_host_boot_enabled|bool + package: + name: libvirt-client + state: present - name: libvirt-guests unit to stop nova_compute container before shutdown VMs copy: dest: /etc/systemd/system/libvirt-guests.service content: | [Unit] Description=Suspend/Resume Running libvirt Guests + Requires=virt-guest-shutdown.target After=network.target After=time-sync.target After=virt-guest-shutdown.target @@ -871,12 +877,12 @@ outputs: Documentation=https://libvirt.org [Service] - EnvironmentFile=-/var/lib/config-data/puppet-generated/nova_libvirt/etc/sysconfig/libvirt-guests + EnvironmentFile=-/etc/sysconfig/libvirt-guests # Hack just call traditional service until we factor # out the code - ExecStart=/bin/{{container_cli}} exec nova_libvirt /bin/sh -x /usr/libexec/libvirt-guests.sh start + ExecStart=/usr/libexec/libvirt-guests.sh start ExecStop=/bin/{{container_cli}} stop nova_compute - ExecStop=/bin/{{container_cli}} exec nova_libvirt /bin/sh -x /usr/libexec/libvirt-guests.sh stop + ExecStop=/usr/libexec/libvirt-guests.sh stop Type=oneshot RemainAfterExit=yes StandardOutput=journal+console @@ -888,6 +894,7 @@ outputs: systemd: name: libvirt-guests enabled: yes + state: started daemon_reload: yes - name: install tripleo_nova_libvirt_guests systemd unit file (podman) when: @@ -898,6 +905,7 @@ outputs: systemd: name: libvirt-guests enabled: no + state: stopped masked: yes daemon_reload: yes - name: libvirt-guests unit to stop nova_compute container before shutdown VMs diff --git a/deployment/nova/nova-libvirt-container-puppet.yaml b/deployment/nova/nova-libvirt-container-puppet.yaml index 5709fa57fe..c700644c60 100644 --- a/deployment/nova/nova-libvirt-container-puppet.yaml +++ b/deployment/nova/nova-libvirt-container-puppet.yaml @@ -554,6 +554,7 @@ outputs: list_join: - "\n" - - include tripleo::profile::base::nova::libvirt + - include tripleo::profile::base::nova::compute::libvirt_guests - {get_attr: [MySQLClient, role_data, step_config]} config_image: {get_param: ContainerNovaLibvirtConfigImage} kolla_config: diff --git a/deployment/nova/nova-libvirt-guests-container-puppet.yaml b/deployment/nova/nova-libvirt-guests-container-puppet.yaml index 8b0e134b49..d0cc11fa59 100644 --- a/deployment/nova/nova-libvirt-guests-container-puppet.yaml +++ b/deployment/nova/nova-libvirt-guests-container-puppet.yaml @@ -30,9 +30,6 @@ parameters: default: {} description: Parameters specific to the role type: json - ContainerNovaLibvirtConfigImage: - description: The container image to use for the nova_libvirt config_volume - type: string NovaResumeGuestsStateOnHostBoot: default: false description: Whether to start running instance on compute host reboot @@ -70,9 +67,5 @@ outputs: value: service_name: nova_libvirt_guests config_settings: {get_attr: [RoleParametersValue, value]} - puppet_config: - config_volume: nova_libvirt - puppet_tags: libvirtd_config,nova_config,file,libvirt_tls_password - step_config: | - include ::tripleo::profile::base::nova::compute::libvirt_guests - config_image: {get_param: ContainerNovaLibvirtConfigImage} + step_config: | + include ::tripleo::profile::base::nova::compute::libvirt_guests