From c7ad9f1f252dfec26af239c3eef916b48bb9c15c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 9 Jan 2022 14:32:26 +0900 Subject: [PATCH] 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 --- manifests/backend/rbd.pp | 13 +++++++++++++ releasenotes/notes/rbd-opts-8e6856ca90979340.yaml | 8 ++++++++ spec/defines/cinder_backend_rbd_spec.rb | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 releasenotes/notes/rbd-opts-8e6856ca90979340.yaml diff --git a/manifests/backend/rbd.pp b/manifests/backend/rbd.pp index 4d04f39c..f4f280d3 100644 --- a/manifests/backend/rbd.pp +++ b/manifests/backend/rbd.pp @@ -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; } diff --git a/releasenotes/notes/rbd-opts-8e6856ca90979340.yaml b/releasenotes/notes/rbd-opts-8e6856ca90979340.yaml new file mode 100644 index 00000000..fe740099 --- /dev/null +++ b/releasenotes/notes/rbd-opts-8e6856ca90979340.yaml @@ -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`` diff --git a/spec/defines/cinder_backend_rbd_spec.rb b/spec/defines/cinder_backend_rbd_spec.rb index 23ce05cd..b49374c6 100644 --- a/spec/defines/cinder_backend_rbd_spec.rb +++ b/spec/defines/cinder_backend_rbd_spec.rb @@ -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('') is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rados_connection_retries").with_value('') is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_store_chunk_size").with_value('') + is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/report_dynamic_total_capacity").with_value('') + is_expected.to contain_cinder_config("#{req_params[:volume_backend_name]}/rbd_exclusive_cinder_pool").with_value('') 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