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
(cherry picked from commit 6178fbf033)
(cherry picked from commit cbb0596205)
This commit is contained in:
Christian Rohmann 2021-03-10 16:46:54 +01:00 committed by Takashi Kajinami
parent a91e12b905
commit 5fc2a5c991
3 changed files with 20 additions and 2 deletions

View File

@ -9,6 +9,12 @@
# glance and uploading to ceph instead of a COW clone # glance and uploading to ceph instead of a COW clone
# Defaults to $::os_service_default # 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 # DEPRECATED
# #
# [*enable_numa_live_migration*] # [*enable_numa_live_migration*]
@ -17,6 +23,7 @@
# #
class nova::workarounds ( class nova::workarounds (
$never_download_image_if_on_rbd = $::os_service_default, $never_download_image_if_on_rbd = $::os_service_default,
$ensure_libvirt_rbd_instance_dir_cleanup = $::os_service_default,
# DEPRECATED PARAMETER # DEPRECATED PARAMETER
$enable_numa_live_migration = undef, $enable_numa_live_migration = undef,
) { ) {
@ -29,7 +36,10 @@ class nova::workarounds (
} }
nova_config { 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;
} }
} }

View File

@ -0,0 +1,5 @@
---
features:
- |
Support for the ``workarounds/ensure_libvirt_rbd_instance_dir_cleanup``
parameter has been added.

View File

@ -11,18 +11,21 @@ describe 'nova::workarounds' do
context 'with default parameters' do context 'with default parameters' do
it { is_expected.not_to contain_nova_config('workarounds/enable_numa_live_migration') } 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('<SERVICE DEFAULT>') } it { is_expected.to contain_nova_config('workarounds/never_download_image_if_on_rbd').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('workarounds/ensure_libvirt_rbd_instance_dir_cleanup').with_value('<SERVICE DEFAULT>') }
end end
context 'with overridden parameters' do context 'with overridden parameters' do
let :params do let :params do
{ {
:enable_numa_live_migration => true, :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 end
it { is_expected.to contain_nova_config('workarounds/enable_numa_live_migration').with_value('true') } 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/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
end end