From 6178fbf0331b7bb1531365f578c56912d67fccb0 Mon Sep 17 00:00:00 2001 From: Christian Rohmann Date: Wed, 10 Mar 2021 16:46:54 +0100 Subject: [PATCH] Expose [workaround]/ensure_libvirt_rbd_instance_dir_cleanup This exposes the nova workaround to remove the instance directory on clean up when using rbd. Change-Id: Iea47828c8022955cf0f91b891d43eff34a905174 --- manifests/workarounds.pp | 12 +++++++++++- ...rt_rbd_instance_dir_cleanup-17da2fc2a88ff5f1.yaml | 5 +++++ spec/classes/nova_workarounds_spec.rb | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/workarounds-ensure_libvirt_rbd_instance_dir_cleanup-17da2fc2a88ff5f1.yaml diff --git a/manifests/workarounds.pp b/manifests/workarounds.pp index 1ed8e2a5d..8169c88ec 100644 --- a/manifests/workarounds.pp +++ b/manifests/workarounds.pp @@ -9,6 +9,12 @@ # glance and uploading to ceph instead of a COW clone # Defaults to $::os_service_default # +# [*ensure_libvirt_rbd_instance_dir_cleanup*] +# (optional) Ensure the instance directory is removed during clean up when using +# rbd. When enabled this workaround will ensure that the instance directory is +# always removed during cleanup on hosts using ``[libvirt]/images_type=rbd`` +# Defaults to $::os_service_default +# # DEPRECATED # # [*enable_numa_live_migration*] @@ -17,6 +23,7 @@ # class nova::workarounds ( $never_download_image_if_on_rbd = $::os_service_default, + $ensure_libvirt_rbd_instance_dir_cleanup = $::os_service_default, # DEPRECATED PARAMETER $enable_numa_live_migration = undef, ) { @@ -29,7 +36,10 @@ class nova::workarounds ( } nova_config { - 'workarounds/never_download_image_if_on_rbd': value => $never_download_image_if_on_rbd; + 'workarounds/never_download_image_if_on_rbd': + value => $never_download_image_if_on_rbd; + 'workarounds/ensure_libvirt_rbd_instance_dir_cleanup': + value => $ensure_libvirt_rbd_instance_dir_cleanup; } } diff --git a/releasenotes/notes/workarounds-ensure_libvirt_rbd_instance_dir_cleanup-17da2fc2a88ff5f1.yaml b/releasenotes/notes/workarounds-ensure_libvirt_rbd_instance_dir_cleanup-17da2fc2a88ff5f1.yaml new file mode 100644 index 000000000..8c04078a9 --- /dev/null +++ b/releasenotes/notes/workarounds-ensure_libvirt_rbd_instance_dir_cleanup-17da2fc2a88ff5f1.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Support for the ``workarounds/ensure_libvirt_rbd_instance_dir_cleanup`` + parameter has been added. diff --git a/spec/classes/nova_workarounds_spec.rb b/spec/classes/nova_workarounds_spec.rb index 911831bca..01c8f72a2 100644 --- a/spec/classes/nova_workarounds_spec.rb +++ b/spec/classes/nova_workarounds_spec.rb @@ -11,18 +11,21 @@ describe 'nova::workarounds' do context 'with default parameters' do it { is_expected.not_to contain_nova_config('workarounds/enable_numa_live_migration') } it { is_expected.to contain_nova_config('workarounds/never_download_image_if_on_rbd').with_value('') } + it { is_expected.to contain_nova_config('workarounds/ensure_libvirt_rbd_instance_dir_cleanup').with_value('') } end context 'with overridden parameters' do let :params do { :enable_numa_live_migration => true, - :never_download_image_if_on_rbd => true + :never_download_image_if_on_rbd => true, + :ensure_libvirt_rbd_instance_dir_cleanup => true } end it { is_expected.to contain_nova_config('workarounds/enable_numa_live_migration').with_value('true') } it { is_expected.to contain_nova_config('workarounds/never_download_image_if_on_rbd').with_value('true') } + it { is_expected.to contain_nova_config('workarounds/ensure_libvirt_rbd_instance_dir_cleanup').with_value('true') } end end