From 46e9319d8e012d2df6b7d8f85f59315db6e95ff2 Mon Sep 17 00:00:00 2001 From: PranaliD Date: Tue, 2 Feb 2021 07:20:27 -0500 Subject: [PATCH] Add config parameter for cinder mounting needs This patch is introducing cinder_mount_point_base parameter into glance::backend::multistore::cinder class, so that operators can provide the cinder mount point for NFS volumes. Change-Id: Ib724f6e895716847827be48ed08b01a7a312338f --- manifests/backend/multistore/cinder.pp | 8 ++++++++ ..._backend_cinder_mount_point_base-5741d2966cc10c7b.yaml | 6 ++++++ spec/defines/glance_backend_multistore_cinder_spec.rb | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/glance_backend_cinder_mount_point_base-5741d2966cc10c7b.yaml diff --git a/manifests/backend/multistore/cinder.pp b/manifests/backend/multistore/cinder.pp index de42129a..b1044713 100644 --- a/manifests/backend/multistore/cinder.pp +++ b/manifests/backend/multistore/cinder.pp @@ -77,6 +77,11 @@ # (optional) Flag to identify multipath is supported or not in the deployment # Defaults to $::os_service_default. # +# [*cinder_mount_point_base*] +# (Optional) When glance uses cinder as store and cinder backend is NFS, the mount point +# would be required to be set with this parameter. +# Defaults to $::os_service_default. +# # [*store_description*] # (optional) Provides constructive information about the store backend to # end users. @@ -96,6 +101,7 @@ define glance::backend::multistore::cinder( $cinder_volume_type = $::os_service_default, $cinder_enforce_multipath = $::os_service_default, $cinder_use_multipath = $::os_service_default, + $cinder_mount_point_base = $::os_service_default, $store_description = $::os_service_default, ) { @@ -118,6 +124,7 @@ define glance::backend::multistore::cinder( "${name}/cinder_volume_type": value => $cinder_volume_type; "${name}/cinder_enforce_multipath": value => $cinder_enforce_multipath; "${name}/cinder_use_multipath": value => $cinder_use_multipath; + "${name}/cinder_mount_point_base": value => $cinder_mount_point_base; "${name}/store_description": value => $store_description; } @@ -134,6 +141,7 @@ define glance::backend::multistore::cinder( "${name}/cinder_os_region_name": value => $cinder_os_region_name_real; "${name}/cinder_volume_type": value => $cinder_volume_type; "${name}/cinder_enforce_multipath": value => $cinder_enforce_multipath; + "${name}/cinder_mount_point_base": value => $cinder_mount_point_base; "${name}/cinder_use_multipath": value => $cinder_use_multipath; } diff --git a/releasenotes/notes/glance_backend_cinder_mount_point_base-5741d2966cc10c7b.yaml b/releasenotes/notes/glance_backend_cinder_mount_point_base-5741d2966cc10c7b.yaml new file mode 100644 index 00000000..77add832 --- /dev/null +++ b/releasenotes/notes/glance_backend_cinder_mount_point_base-5741d2966cc10c7b.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + A new parameter ``cinder_mount_point_base`` is introduced into + ``glance::backend::multistore::cinder`` class, so that operators + can provide the cinder mount point for NFS volumes. \ No newline at end of file diff --git a/spec/defines/glance_backend_multistore_cinder_spec.rb b/spec/defines/glance_backend_multistore_cinder_spec.rb index b68b10d3..9edfe0c8 100644 --- a/spec/defines/glance_backend_multistore_cinder_spec.rb +++ b/spec/defines/glance_backend_multistore_cinder_spec.rb @@ -44,6 +44,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_api_config('cinder/cinder_volume_type').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_enforce_multipath').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_use_multipath').with_value('') + is_expected.to contain_glance_api_config('cinder/cinder_mount_point_base').with_value('') end it 'configures glance-cache.conf' do is_expected.to_not contain_glance_cache_config('cinder/store_description') @@ -60,6 +61,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_cache_config('cinder/cinder_volume_type').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_enforce_multipath').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_use_multipath').with_value('') + is_expected.to contain_glance_cache_config('cinder/cinder_mount_point_base').with_value('') end end @@ -80,6 +82,7 @@ describe 'glance::backend::multistore::cinder' do :cinder_volume_type => 'glance-fast', :cinder_enforce_multipath => true, :cinder_use_multipath => true, + :cinder_mount_point_base => '/var/lib/glance/mnt', } end it 'configures glance-api.conf' do @@ -97,6 +100,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_api_config('cinder/cinder_volume_type').with_value('glance-fast') is_expected.to contain_glance_api_config('cinder/cinder_enforce_multipath').with_value(true) is_expected.to contain_glance_api_config('cinder/cinder_use_multipath').with_value(true) + is_expected.to contain_glance_api_config('cinder/cinder_mount_point_base').with_value('/var/lib/glance/mnt') end it 'configures glance-cache.conf' do is_expected.to_not contain_glance_cache_config('cinder/store_description') @@ -113,6 +117,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_cache_config('cinder/cinder_volume_type').with_value('glance-fast') is_expected.to contain_glance_cache_config('cinder/cinder_enforce_multipath').with_value(true) is_expected.to contain_glance_cache_config('cinder/cinder_use_multipath').with_value(true) + is_expected.to contain_glance_cache_config('cinder/cinder_mount_point_base').with_value('/var/lib/glance/mnt') end end end