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] 1485924dd7

Change-Id: I3a9251ca87d57fb56ad3afb5a63b5d66250e0fa2
This commit is contained in:
Takashi Kajinami 2022-04-19 00:35:21 +09:00
parent 9e415238f7
commit bac348a784
3 changed files with 25 additions and 29 deletions

View File

@ -28,6 +28,11 @@
# e.g., socket error, etc. # e.g., socket error, etc.
# Defaults to $::os_service_default. # 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*] # [*max_object_retrieval*]
# (optional) The maximum number of ObjectContent data objects that should # (optional) The maximum number of ObjectContent data objects that should
# be returned in a single result. A positive value will cause # be returned in a single result. A positive value will cause
@ -39,10 +44,11 @@
# #
# [*task_poll_interval*] # [*task_poll_interval*]
# (optional) The interval in seconds used for polling of remote tasks. # (optional) The interval in seconds used for polling of remote tasks.
# Defaults to 5. # Defaults to $::os_service_default.
# #
# [*image_transfer_timeout_secs*] # [*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 # Defaults to $::os_service_default
# #
# [*wsdl_location*] # [*wsdl_location*]
@ -51,10 +57,6 @@
# default location for bug work-arounds. # default location for bug work-arounds.
# Defaults to $::os_service_default. # 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*] # [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type. # (Optional) Whether or not manage Cinder Volume type.
# If set to true, a Cinder Volume type will be created # If set to true, a Cinder Volume type will be created
@ -73,10 +75,10 @@ define cinder::backend::vmdk (
$host_password, $host_password,
$volume_backend_name = $name, $volume_backend_name = $name,
$backend_availability_zone = $::os_service_default, $backend_availability_zone = $::os_service_default,
$volume_folder = 'cinder-volumes', $volume_folder = $::os_service_default,
$api_retry_count = $::os_service_default, $api_retry_count = $::os_service_default,
$max_object_retrieval = $::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, $image_transfer_timeout_secs = $::os_service_default,
$wsdl_location = $::os_service_default, $wsdl_location = $::os_service_default,
$manage_volume_type = false, $manage_volume_type = false,
@ -85,16 +87,6 @@ define cinder::backend::vmdk (
include cinder::deps 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 { cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name; "${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/backend_availability_zone": value => $backend_availability_zone;

View File

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

View File

@ -5,12 +5,9 @@ describe 'cinder::backend::vmdk' do
let :params do let :params do
{ {
:host_ip => '172.16.16.16', :host_ip => '172.16.16.16',
:host_password => 'asdf', :host_password => 'asdf',
:host_username => 'user', :host_username => 'user',
:api_retry_count => '<SERVICE DEFAULT>',
:max_object_retrieval => '<SERVICE DEFAULT>',
:image_transfer_timeout_secs => '<SERVICE DEFAULT>'
} }
end 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_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_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_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_volume_folder').with_value('<SERVICE DEFAULT>')
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_api_retry_count').with_value('<SERVICE DEFAULT>')
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_max_object_retrieval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hippo/vmware_task_poll_interval').with_value(5) is_expected.to contain_cinder_config('hippo/vmware_task_poll_interval').with_value('<SERVICE DEFAULT>')
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_image_transfer_timeout_secs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hippo/vmware_wsdl_location').with_value('<SERVICE DEFAULT>') is_expected.to contain_cinder_config('hippo/vmware_wsdl_location').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>') is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('<SERVICE DEFAULT>')
} }