Remove libvirt packaged dependencies

This re-apply change reverted in I6db56cec954c4d6272548791e6b73bd01b177769
Problem has been fixed in master and the fix is squashed in this change

Nova services are now running in the containers but we have still
a lot of libvirt packages installed on Overcloud systems.
To delete unnecessary packages on host systems I'm removing following
dependencies:
* modifying NovaLibvirtGuests service to run in containers and generate
  config files for libvirt-guests
* removeing hard dependencies for libvirt-guests service to
  virt-guest-shutdown.target.
  packages.

Change-Id: I2d0557127f88a492b283897767e57ea126adfe83
Closes-Bug: 1842932
(cherry picked from commit 42eb7c98b6)

Create qemu user/group on controller

Deployment is failing with error [1] because the owner/group
of the TLS generated certificate and key were set to 'qemu'.
This user and group exist on compute nodes, but not on controller.
[1] Error: Could not find group qemu"

This patch adds 'qemu' user/group on controller node to
resolve the issue as this user is required to retrieve the cert,
used by the VNC proxy, the same way as on the compute nodes.

Change-Id: I3aa774c06d91a3b67726fad0d0ca409cda5b78b9
Closes-Bug: #1860971
(cherry picked from commit b8c6154e7a)
This commit is contained in:
Piotr Kopec 2019-11-19 09:45:05 +01:00
parent 7683b8bcaa
commit 852dc1013d
4 changed files with 28 additions and 15 deletions

View File

@ -856,18 +856,12 @@ outputs:
- resume_guests_state_on_host_boot_enabled|bool - resume_guests_state_on_host_boot_enabled|bool
- container_cli == 'docker' - container_cli == 'docker'
block: 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 - name: libvirt-guests unit to stop nova_compute container before shutdown VMs
copy: copy:
dest: /etc/systemd/system/libvirt-guests.service dest: /etc/systemd/system/libvirt-guests.service
content: | content: |
[Unit] [Unit]
Description=Suspend/Resume Running libvirt Guests Description=Suspend/Resume Running libvirt Guests
Requires=virt-guest-shutdown.target
After=network.target After=network.target
After=time-sync.target After=time-sync.target
After=virt-guest-shutdown.target After=virt-guest-shutdown.target
@ -878,12 +872,12 @@ outputs:
Documentation=https://libvirt.org Documentation=https://libvirt.org
[Service] [Service]
EnvironmentFile=-/etc/sysconfig/libvirt-guests EnvironmentFile=-/var/lib/config-data/puppet-generated/nova_libvirt/etc/sysconfig/libvirt-guests
# Hack just call traditional service until we factor # Hack just call traditional service until we factor
# out the code # out the code
ExecStart=/usr/libexec/libvirt-guests.sh start ExecStart=/bin/{{container_cli}} exec nova_libvirt /bin/sh -x /usr/libexec/libvirt-guests.sh start
ExecStop=/bin/{{container_cli}} stop nova_compute ExecStop=/bin/{{container_cli}} stop nova_compute
ExecStop=/usr/libexec/libvirt-guests.sh stop ExecStop=/bin/{{container_cli}} exec nova_libvirt /bin/sh -x /usr/libexec/libvirt-guests.sh stop
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
StandardOutput=journal+console StandardOutput=journal+console
@ -895,7 +889,6 @@ outputs:
systemd: systemd:
name: libvirt-guests name: libvirt-guests
enabled: yes enabled: yes
state: started
daemon_reload: yes daemon_reload: yes
- name: install tripleo_nova_libvirt_guests systemd unit file (podman) - name: install tripleo_nova_libvirt_guests systemd unit file (podman)
when: when:
@ -906,7 +899,6 @@ outputs:
systemd: systemd:
name: libvirt-guests name: libvirt-guests
enabled: no enabled: no
state: stopped
masked: yes masked: yes
daemon_reload: yes daemon_reload: yes
- name: libvirt-guests unit to stop nova_compute container before shutdown VMs - name: libvirt-guests unit to stop nova_compute container before shutdown VMs

View File

@ -554,7 +554,6 @@ outputs:
list_join: list_join:
- "\n" - "\n"
- - include tripleo::profile::base::nova::libvirt - - include tripleo::profile::base::nova::libvirt
- include tripleo::profile::base::nova::compute::libvirt_guests
- {get_attr: [MySQLClient, role_data, step_config]} - {get_attr: [MySQLClient, role_data, step_config]}
config_image: {get_param: ContainerNovaLibvirtConfigImage} config_image: {get_param: ContainerNovaLibvirtConfigImage}
kolla_config: kolla_config:

View File

@ -30,6 +30,9 @@ parameters:
default: {} default: {}
description: Parameters specific to the role description: Parameters specific to the role
type: json type: json
ContainerNovaLibvirtConfigImage:
description: The container image to use for the nova_libvirt config_volume
type: string
NovaResumeGuestsStateOnHostBoot: NovaResumeGuestsStateOnHostBoot:
default: false default: false
description: Whether to start running instance on compute host reboot description: Whether to start running instance on compute host reboot
@ -67,5 +70,9 @@ outputs:
value: value:
service_name: nova_libvirt_guests service_name: nova_libvirt_guests
config_settings: {get_attr: [RoleParametersValue, value]} config_settings: {get_attr: [RoleParametersValue, value]}
step_config: | puppet_config:
include ::tripleo::profile::base::nova::compute::libvirt_guests 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}

View File

@ -305,7 +305,22 @@ outputs:
fail: fail:
msg: nova-vnc-proxy isn't working (healthcheck failed) msg: nova-vnc-proxy isn't working (healthcheck failed)
when: nova_vnc_proxy_healthcheck_state.status.ExecMainStatus != '0' when: nova_vnc_proxy_healthcheck_state.status.ExecMainStatus != '0'
host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} host_prep_tasks:
list_concat:
- {get_attr: [NovaLogging, host_prep_tasks]}
- - name: ensure qemu group is present on the host
group:
name: qemu
gid: 107
state: present
- name: ensure qemu user is present on the host
user:
name: qemu
uid: 107
group: qemu
state: present
shell: /sbin/nologin
comment: qemu user
fast_forward_upgrade_tasks: fast_forward_upgrade_tasks:
- when: - when:
- step|int == 0 - step|int == 0