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
This commit is contained in:
PranaliD 2020-12-09 06:50:41 +00:00 committed by Takashi Kajinami
parent 73d1c92a41
commit 28fafd2f0c
3 changed files with 17 additions and 0 deletions

View File

@ -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;

View File

@ -0,0 +1,5 @@
---
features:
- |
Add 'cinder_volume_type' configuration parameter to allow cinder
stores to specify a volume type for each cinder store.

View File

@ -41,6 +41,7 @@ describe 'glance::backend::multistore::cinder' do
is_expected.to contain_glance_api_config('cinder/cinder_store_user_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('cinder/cinder_store_password').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('cinder/cinder_enforce_multipath').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_api_config('cinder/cinder_use_multipath').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('cinder/cinder_store_password').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('cinder/cinder_enforce_multipath').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glance_cache_config('cinder/cinder_use_multipath').with_value('<SERVICE DEFAULT>')
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