From bac348a784c46e7c8f65b9feb811f48e9e3a9884 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 19 Apr 2022 00:35:21 +0900 Subject: [PATCH] vmdk: Use service defaults instead of hard-coded defaults This removes hard-coded default values of the vmdk volume driver parameters. The planned change has been notified since M-release[1], so we are now ready to make the change. [1] 1485924dd745fcf101516e26a882a4e24a67127b Change-Id: I3a9251ca87d57fb56ad3afb5a63b5d66250e0fa2 --- manifests/backend/vmdk.pp | 28 +++++++------------ ...-use-service-default-e8ab854fa81cf40c.yaml | 7 +++++ spec/defines/cinder_backend_vmdk_spec.rb | 19 ++++++------- 3 files changed, 25 insertions(+), 29 deletions(-) create mode 100644 releasenotes/notes/vmdk-use-service-default-e8ab854fa81cf40c.yaml diff --git a/manifests/backend/vmdk.pp b/manifests/backend/vmdk.pp index c093e439..92e9aaa7 100644 --- a/manifests/backend/vmdk.pp +++ b/manifests/backend/vmdk.pp @@ -28,6 +28,11 @@ # e.g., socket error, etc. # Defaults to $::os_service_default. # +# [*volume_folder*] +# (optional) The name for the folder in the VC datacenter that will contain +# cinder volumes. +# Defaults to $::os_service_default. +# # [*max_object_retrieval*] # (optional) The maximum number of ObjectContent data objects that should # be returned in a single result. A positive value will cause @@ -39,10 +44,11 @@ # # [*task_poll_interval*] # (optional) The interval in seconds used for polling of remote tasks. -# Defaults to 5. +# Defaults to $::os_service_default. # # [*image_transfer_timeout_secs*] -# (optional) The timeout in seconds for VMDK volume transfer between Cinder and Glance. +# (optional) The timeout in seconds for VMDK volume transfer between Cinder +# and Glance. # Defaults to $::os_service_default # # [*wsdl_location*] @@ -51,10 +57,6 @@ # default location for bug work-arounds. # Defaults to $::os_service_default. # -# [*volume_folder*] -# (optional) The name for the folder in the VC datacenter that will contain cinder volumes. -# Defaults to 'cinder-volumes'. -# # [*manage_volume_type*] # (Optional) Whether or not manage Cinder Volume type. # If set to true, a Cinder Volume type will be created @@ -73,10 +75,10 @@ define cinder::backend::vmdk ( $host_password, $volume_backend_name = $name, $backend_availability_zone = $::os_service_default, - $volume_folder = 'cinder-volumes', + $volume_folder = $::os_service_default, $api_retry_count = $::os_service_default, $max_object_retrieval = $::os_service_default, - $task_poll_interval = 5, + $task_poll_interval = $::os_service_default, $image_transfer_timeout_secs = $::os_service_default, $wsdl_location = $::os_service_default, $manage_volume_type = false, @@ -85,16 +87,6 @@ define cinder::backend::vmdk ( include cinder::deps - if $volume_folder == 'cinder-volumes' { - warning("The OpenStack default value of volume_folder differs from the puppet module \ -default of \"cinder-volumes\" and will be changed to the upstream OpenStack default in N-release.") - } - - if $task_poll_interval == 5 { - warning("The OpenStack default value of task_poll_interval differs from the puppet \ -module default of \"5\" and will be changed to the upstream OpenStack default in N-release.") - } - cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; "${name}/backend_availability_zone": value => $backend_availability_zone; diff --git a/releasenotes/notes/vmdk-use-service-default-e8ab854fa81cf40c.yaml b/releasenotes/notes/vmdk-use-service-default-e8ab854fa81cf40c.yaml new file mode 100644 index 00000000..5f8002a1 --- /dev/null +++ b/releasenotes/notes/vmdk-use-service-default-e8ab854fa81cf40c.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The ``cinder::backends::vmdk::volume_foler`` parameter and + the ``cinder::backends::vmdk::task_poll_interval`` parameter now default + to the service default values. Make sure these parameters are set if + the previous default value should be used. diff --git a/spec/defines/cinder_backend_vmdk_spec.rb b/spec/defines/cinder_backend_vmdk_spec.rb index 97681bde..022297a0 100644 --- a/spec/defines/cinder_backend_vmdk_spec.rb +++ b/spec/defines/cinder_backend_vmdk_spec.rb @@ -5,12 +5,9 @@ describe 'cinder::backend::vmdk' do let :params do { - :host_ip => '172.16.16.16', - :host_password => 'asdf', - :host_username => 'user', - :api_retry_count => '', - :max_object_retrieval => '', - :image_transfer_timeout_secs => '' + :host_ip => '172.16.16.16', + :host_password => 'asdf', + :host_username => 'user', } end @@ -33,11 +30,11 @@ describe 'cinder::backend::vmdk' do is_expected.to contain_cinder_config('hippo/vmware_host_ip').with_value(params[:host_ip]) is_expected.to contain_cinder_config('hippo/vmware_host_username').with_value(params[:host_username]) is_expected.to contain_cinder_config('hippo/vmware_host_password').with_value(params[:host_password]).with_secret(true) - is_expected.to contain_cinder_config('hippo/vmware_volume_folder').with_value('cinder-volumes') - is_expected.to contain_cinder_config('hippo/vmware_api_retry_count').with_value(params[:api_retry_count]) - is_expected.to contain_cinder_config('hippo/vmware_max_object_retrieval').with_value(params[:max_object_retrieval]) - is_expected.to contain_cinder_config('hippo/vmware_task_poll_interval').with_value(5) - is_expected.to contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value(params[:image_transfer_timeout_secs]) + is_expected.to contain_cinder_config('hippo/vmware_volume_folder').with_value('') + is_expected.to contain_cinder_config('hippo/vmware_api_retry_count').with_value('') + is_expected.to contain_cinder_config('hippo/vmware_max_object_retrieval').with_value('') + is_expected.to contain_cinder_config('hippo/vmware_task_poll_interval').with_value('') + is_expected.to contain_cinder_config('hippo/vmware_image_transfer_timeout_secs').with_value('') is_expected.to contain_cinder_config('hippo/vmware_wsdl_location').with_value('') is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('') }