rbd: Support more rbd driver parameters

This change introduces support of the following parameters of the rbd
volume driver.
 - report_dynamic_total_capacity
 - rbd_exclusive_cinder_pool

Change-Id: I496671237bd26a1ff9f032725849f5bed1ddcb71
This commit is contained in:
Takashi Kajinami 2022-01-09 14:32:26 +09:00
parent 77facb506f
commit c7ad9f1f25
3 changed files with 27 additions and 0 deletions

View File

@ -63,6 +63,15 @@
# (optional) Volumes will be chunked into objects of this size (in megabytes).
# Defaults to $::os_service_default
#
# [*report_dynamic_total_capacity*]
# (optional) Set to True for driver to report total capacity as a dynamic
# value
# Defaults to $::os_service_default
#
# [*rbd_exclusive_cinder_pool*]
# (optional) Set to True if the pool is used exclusively by Cinder.
# Defaults to $::os_service_default
#
# [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type.
# If set to true, a Cinder Volume type will be created
@ -89,6 +98,8 @@ define cinder::backend::rbd (
$rados_connection_interval = $::os_service_default,
$rados_connection_retries = $::os_service_default,
$rbd_store_chunk_size = $::os_service_default,
$report_dynamic_total_capacity = $::os_service_default,
$rbd_exclusive_cinder_pool = $::os_service_default,
$manage_volume_type = false,
$extra_options = {},
) {
@ -119,6 +130,8 @@ define cinder::backend::rbd (
"${name}/rados_connection_retries": value => $rados_connection_retries;
"${name}/rbd_store_chunk_size": value => $rbd_store_chunk_size;
"${name}/rbd_cluster_name": value => $rbd_cluster_name_real;
"${name}/report_dynamic_total_capacity": value => $report_dynamic_total_capacity;
"${name}/rbd_exclusive_cinder_pool": value => $rbd_exclusive_cinder_pool;
"${name}/report_discard_supported": value => true;
}

View File

@ -0,0 +1,8 @@
---
features:
- |
The following parameters have been added to the ``cinder::backend::rbd``
resource type.
- ``report_dynamic_total_capacity``
- ``rbd_exclusive_cinder_pool``

View File

@ -34,6 +34,8 @@ describe 'cinder::backend::rbd' do
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_store_chunk_size").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/report_dynamic_total_capacity").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_exclusive_cinder_pool").with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/report_discard_supported").with_value(true)
}
@ -48,6 +50,8 @@ describe 'cinder::backend::rbd' do
:rados_connection_interval => 5,
:rados_connection_retries => 3,
:rbd_store_chunk_size => 4,
:report_dynamic_total_capacity => true,
:rbd_exclusive_cinder_pool => false,
})
end
@ -66,6 +70,8 @@ describe 'cinder::backend::rbd' do
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_interval").with_value(params[:rados_connection_interval])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value(params[:rados_connection_retries])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_store_chunk_size").with_value(params[:rbd_store_chunk_size])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/report_dynamic_total_capacity").with_value(params[:report_dynamic_total_capacity])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_exclusive_cinder_pool").with_value(params[:rbd_exclusive_cinder_pool])
is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/report_discard_supported").with_value(true)
}
end