From 149cb501239413f9fb6e45df5b0d9dba7db97acc Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 18 May 2023 11:44:02 +0900 Subject: [PATCH] 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 30bff6814091fcff6613bb9d20fb5fc402da5357) (cherry picked from commit 29f27cb228465f1927951be8e2d749188440a9bc) (cherry picked from commit 549d89e3177528e9b57d1062a7f7dac10942abc3) --- manifests/migration/libvirt.pp | 10 ++++++---- ...ion-libvirt-manage-service-3d205cd3772650b7.yaml | 13 +++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/fix-migration-libvirt-manage-service-3d205cd3772650b7.yaml diff --git a/manifests/migration/libvirt.pp b/manifests/migration/libvirt.pp index d456b1c34..3556bbd18 100644 --- a/manifests/migration/libvirt.pp +++ b/manifests/migration/libvirt.pp @@ -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', diff --git a/releasenotes/notes/fix-migration-libvirt-manage-service-3d205cd3772650b7.yaml b/releasenotes/notes/fix-migration-libvirt-manage-service-3d205cd3772650b7.yaml new file mode 100644 index 000000000..69cd3a04c --- /dev/null +++ b/releasenotes/notes/fix-migration-libvirt-manage-service-3d205cd3772650b7.yaml @@ -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.