From e1fefac52e9c85c7006aa2234655a8baf54f169f Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Tue, 23 Nov 2021 08:04:40 -0800 Subject: [PATCH] Support configuring extra cinder RBD options Add tripleo::profile::base::cinder::volume::rbd::extra_options parameter, which provides a mechanism for configuring arbitrary "extra options" for RBD backends. Having this capability will help resolve problems that require adjusting arcane driver settings that are not supported by puppet-cinder, expecially in older stable releases. Note: The cinder::config::cinder_config parameter also provides a mechanism for configuring arbitrary settings in cinder.conf. However, having a parameter dedicated for RBD backends will help avoid situations where a user adds hiera data that sets cinder::config::cinder_config, and inadvertently overrides any critical RBD settings. NOTE(stable/victoria): Backport conflicts had to be resolved due to support for the multi_config parameter that was introduced in stable/wallaby. Change-Id: I7a928978205a5bd5698bebe3c1b9aae94af80057 (cherry picked from commit f6815f341d4f2585270e0f94225f6a75e260f89f) (cherry picked from commit f60e1c1f683bf3636e3b6eb5e49eda473b98e87c) (cherry picked from commit 74fe2876aca8e599662feaad4d5fb29b5f093b4c) --- manifests/profile/base/cinder/volume/rbd.pp | 8 ++++++++ .../notes/cinder-rbd-extra-options-c13a1e84b6452fac.yaml | 6 ++++++ .../tripleo_profile_base_cinder_volume_rbd_spec.rb | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/cinder-rbd-extra-options-c13a1e84b6452fac.yaml diff --git a/manifests/profile/base/cinder/volume/rbd.pp b/manifests/profile/base/cinder/volume/rbd.pp index 0db22a886..0cc95918c 100644 --- a/manifests/profile/base/cinder/volume/rbd.pp +++ b/manifests/profile/base/cinder/volume/rbd.pp @@ -56,6 +56,11 @@ # in order to remove a dependency on the snapshot. # Defaults to hiera('cinder::backend::rbd::flatten_volume_from_snapshot, undef) # +# [*extra_options*] +# (optional) Hash of extra options to configure for the RBD backends. +# Example: { 'tripleo_ceph/param1' => { 'value' => value1 } } +# Defaults to: {} +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. @@ -73,6 +78,7 @@ class tripleo::profile::base::cinder::volume::rbd ( $cinder_rbd_secret_uuid = undef, $cinder_rbd_user_name = 'openstack', $cinder_rbd_flatten_volume_from_snapshot = hiera('cinder::backend::rbd::flatten_volume_from_snapshot', undef), + $extra_options = {}, $step = Integer(hiera('step')), ) { include tripleo::profile::base::cinder::volume @@ -86,6 +92,7 @@ class tripleo::profile::base::cinder::volume::rbd ( rbd_user => $cinder_rbd_user_name, rbd_secret_uuid => $cinder_rbd_secret_uuid, rbd_flatten_volume_from_snapshot => $cinder_rbd_flatten_volume_from_snapshot, + extra_options => $extra_options, } if $cinder_rbd_extra_pools { @@ -98,6 +105,7 @@ class tripleo::profile::base::cinder::volume::rbd ( rbd_user => $cinder_rbd_user_name, rbd_secret_uuid => $cinder_rbd_secret_uuid, rbd_flatten_volume_from_snapshot => $cinder_rbd_flatten_volume_from_snapshot, + # extra_options are global, and are only applied once (not on each pool). } } } diff --git a/releasenotes/notes/cinder-rbd-extra-options-c13a1e84b6452fac.yaml b/releasenotes/notes/cinder-rbd-extra-options-c13a1e84b6452fac.yaml new file mode 100644 index 000000000..a3006c749 --- /dev/null +++ b/releasenotes/notes/cinder-rbd-extra-options-c13a1e84b6452fac.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + A new ``tripleo::profile::base::cinder::volume::rbd::extra_options`` + parameter adds the ability to configure additional options for use + with cinder RBD backends. diff --git a/spec/classes/tripleo_profile_base_cinder_volume_rbd_spec.rb b/spec/classes/tripleo_profile_base_cinder_volume_rbd_spec.rb index 44e802687..04834a897 100644 --- a/spec/classes/tripleo_profile_base_cinder_volume_rbd_spec.rb +++ b/spec/classes/tripleo_profile_base_cinder_volume_rbd_spec.rb @@ -62,6 +62,7 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do :cinder_rbd_secret_uuid => 'secretuuid', :cinder_rbd_user_name => 'kcatsnepo', :cinder_rbd_flatten_volume_from_snapshot => true, + :extra_options => {'poodles/param1' => { 'value' => 'value1' }}, }) end it 'should trigger complete configuration' do @@ -73,6 +74,7 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do :rbd_user => 'kcatsnepo', :rbd_secret_uuid => 'secretuuid', :rbd_flatten_volume_from_snapshot => true, + :extra_options => {'poodles/param1' => { 'value' => 'value1' }}, ) is_expected.to contain_cinder__backend__rbd('poodles_aplenty').with( :backend_host => 'fe80::fc54:ff:fe9e:7846', @@ -82,6 +84,8 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do :rbd_user => 'kcatsnepo', :rbd_secret_uuid => 'secretuuid', :rbd_flatten_volume_from_snapshot => true, + # extra_options are provided with only the first RBD backend/pool + :extra_options => {}, ) is_expected.to contain_cinder__backend__rbd('poodles_galore').with( :backend_host => 'fe80::fc54:ff:fe9e:7846', @@ -91,6 +95,7 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do :rbd_user => 'kcatsnepo', :rbd_secret_uuid => 'secretuuid', :rbd_flatten_volume_from_snapshot => true, + :extra_options => {}, ) end end