From 28fafd2f0ccada0600a7d4428c37f3bfde525346 Mon Sep 17 00:00:00 2001 From: PranaliD Date: Wed, 9 Dec 2020 06:50:41 +0000 Subject: [PATCH] Add cinder volume type for multiple cinder stores Adding 'cinder_volume_type' configuration parameter to allow cinder stores to specify a volume type for each cinder store. Partially Implements: blueprint multiple-cinder-backend-support Change-Id: If0e3e0bd01f976e5a32aa9355ac5dd99425722a3 --- manifests/backend/multistore/cinder.pp | 7 +++++++ ...e_type_for_multiple_cinder_stores-c19b0bb1c753715b.yaml | 5 +++++ spec/defines/glance_backend_multistore_cinder_spec.rb | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 releasenotes/notes/add_cinder_volume_type_for_multiple_cinder_stores-c19b0bb1c753715b.yaml diff --git a/manifests/backend/multistore/cinder.pp b/manifests/backend/multistore/cinder.pp index 2a861dda..63181b8f 100644 --- a/manifests/backend/multistore/cinder.pp +++ b/manifests/backend/multistore/cinder.pp @@ -65,6 +65,10 @@ # (optional) Sets the keystone region to use. # Defaults to 'RegionOne'. # +# [*cinder_volume_type*] +# (Optional) The volume type to be used to create image volumes in cinder. +# Defaults to $::os_service_default. +# # [*cinder_enforce_multipath*] # (optional) Enforce multipath usage when attaching a cinder volume # Defaults to $::os_service_default. @@ -89,6 +93,7 @@ define glance::backend::multistore::cinder( $cinder_store_user_name = $::os_service_default, $cinder_store_password = $::os_service_default, $cinder_os_region_name = 'RegionOne', + $cinder_volume_type = $::os_service_default, $cinder_enforce_multipath = $::os_service_default, $cinder_use_multipath = $::os_service_default, $store_description = $::os_service_default, @@ -110,6 +115,7 @@ define glance::backend::multistore::cinder( "${name}/cinder_store_user_name": value => $cinder_store_user_name; "${name}/cinder_store_password": value => $cinder_store_password; "${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_use_multipath": value => $cinder_use_multipath; "${name}/store_description": value => $store_description; @@ -125,6 +131,7 @@ define glance::backend::multistore::cinder( "${name}/cinder_store_project_name": value => $cinder_store_project_name; "${name}/cinder_store_user_name": value => $cinder_store_user_name; "${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_use_multipath": value => $cinder_use_multipath; "${name}/cinder_store_password": value => $cinder_store_password; diff --git a/releasenotes/notes/add_cinder_volume_type_for_multiple_cinder_stores-c19b0bb1c753715b.yaml b/releasenotes/notes/add_cinder_volume_type_for_multiple_cinder_stores-c19b0bb1c753715b.yaml new file mode 100644 index 00000000..d07e9c08 --- /dev/null +++ b/releasenotes/notes/add_cinder_volume_type_for_multiple_cinder_stores-c19b0bb1c753715b.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add 'cinder_volume_type' configuration parameter to allow cinder + stores to specify a volume type for each cinder store. diff --git a/spec/defines/glance_backend_multistore_cinder_spec.rb b/spec/defines/glance_backend_multistore_cinder_spec.rb index e8fc7ac6..492e3869 100644 --- a/spec/defines/glance_backend_multistore_cinder_spec.rb +++ b/spec/defines/glance_backend_multistore_cinder_spec.rb @@ -41,6 +41,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_api_config('cinder/cinder_store_user_name').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_store_password').with_value('') is_expected.to contain_glance_api_config('cinder/cinder_os_region_name').with_value('RegionOne') + 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('') end @@ -56,6 +57,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_cache_config('cinder/cinder_store_user_name').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_store_password').with_value('') is_expected.to contain_glance_cache_config('cinder/cinder_os_region_name').with_value('RegionOne') + 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('') end @@ -75,6 +77,7 @@ describe 'glance::backend::multistore::cinder' do :cinder_store_user_name => 'glance', :cinder_store_password => 'glance', :cinder_os_region_name => 'RegionTwo', + :cinder_volume_type => 'glance-fast', :cinder_enforce_multipath => true, :cinder_use_multipath => true, } @@ -91,6 +94,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_api_config('cinder/cinder_store_user_name').with_value('glance') is_expected.to contain_glance_api_config('cinder/cinder_store_password').with_value('glance') is_expected.to contain_glance_api_config('cinder/cinder_os_region_name').with_value('RegionTwo') + 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) end @@ -106,6 +110,7 @@ describe 'glance::backend::multistore::cinder' do is_expected.to contain_glance_cache_config('cinder/cinder_store_user_name').with_value('glance') is_expected.to contain_glance_cache_config('cinder/cinder_store_password').with_value('glance') is_expected.to contain_glance_cache_config('cinder/cinder_os_region_name').with_value('RegionTwo') + 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) end