Fix incorrect usage of manage_libvirt_services

This parameter determines whether the nova::compute::libvirt class
should manage libvirt services. Even if the parameter is set to false,
a user can include nova::compute::libvirt::services explicitly to
manage libvirt services. However the nova::migration::libvirt class
does not care whether the service class is additionally included and
always ignores the service resources even though libvirt services are
actually managed.

This fixes that problem and introduces a proper knob to manage/unmanage
services.

Change-Id: Ibd904309ee5327ec2010925459c1aee4a109b1b0
(cherry picked from commit 30bff68140)
(cherry picked from commit 29f27cb228)
(cherry picked from commit 549d89e317)
This commit is contained in:
Takashi Kajinami 2023-05-18 11:44:02 +09:00 committed by Tobias Urdin
parent 41a7721b83
commit 149cb50123
2 changed files with 19 additions and 4 deletions

View File

@ -4,6 +4,10 @@
#
# === Parameters:
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*transport*]
# (optional) Transport to use for live-migration.
# Valid options are 'tcp', 'tls', and 'ssh'.
@ -129,6 +133,7 @@
# Defaults to undef
#
class nova::migration::libvirt(
$manage_service = true,
$transport = undef,
$auth = 'none',
$listen_address = $::os_service_default,
@ -307,11 +312,8 @@ class nova::migration::libvirt(
if versioncmp($libvirt_version, '5.6') < 0 {
fail('libvirt verson < 5.6 is no longer supported')
}
# Since libvirt >= 5.6, system socket of libvirt should be activated
# by systemd, not by --listen option
$manage_services = pick($::nova::compute::libvirt::manage_libvirt_services, true)
if $manage_services {
if $manage_service {
$proxy_service = $modular_libvirt ? {
true => 'virtproxyd',
default => 'libvirtd',

View File

@ -0,0 +1,13 @@
---
features:
- |
The new ``nova::migration::libvirt::manage_service`` parameter has been
added.
fixes:
- |
The ``nova::migration::libvirt`` class no longer reads
the ``nova::compute::libvirt::manage_libvirt_services`` parameter to
decide whether the class should/shouldn't manage services. The new
``nova::migration::libvirt::manage_service`` parameter now controls that
behavior.