From a96f912c0c80fead1a866f30872fbe9655507b7e Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Wed, 3 Oct 2018 14:19:48 -0400 Subject: [PATCH] Add ability to configure backend availability zones Add new "backend_availability_zone" parameter to every volume backend. The parameters are optional, and when set they override the DEFAULT/storage_availability_zone for the corresponding backend. Implements: blueprint split-controlplane-cinder-volume-az Change-Id: I11821a38d8ba5afc594b3d601cd1634207a6f093 --- manifests/backend/bdd.pp | 44 +++++++------ manifests/backend/dellemc_unity.pp | 36 ++++++----- manifests/backend/dellemc_vmax_iscsi.pp | 8 +++ manifests/backend/dellemc_xtremio_iscsi.pp | 8 +++ manifests/backend/dellsc_iscsi.pp | 10 ++- manifests/backend/emc_vnx.pp | 8 +++ manifests/backend/eqlx.pp | 56 ++++++++++------- manifests/backend/glusterfs.pp | 21 ++++--- manifests/backend/gpfs.pp | 57 +++++++++-------- manifests/backend/hpe3par_iscsi.pp | 8 +++ manifests/backend/hpelefthand_iscsi.pp | 8 +++ manifests/backend/iscsi.pp | 38 +++++++----- manifests/backend/netapp.pp | 8 +++ manifests/backend/nexenta.pp | 8 +++ manifests/backend/nexenta_edge.pp | 44 +++++++------ manifests/backend/nfs.pp | 8 +++ manifests/backend/nvmeof.pp | 40 +++++++----- manifests/backend/pure.pp | 8 +++ manifests/backend/quobyte.pp | 20 ++++-- manifests/backend/rbd.pp | 8 +++ manifests/backend/san.pp | 62 +++++++++++-------- manifests/backend/scaleio.pp | 8 +++ manifests/backend/solidfire.pp | 10 ++- manifests/backend/veritas_hyperscale.pp | 14 ++++- manifests/backend/vmdk.pp | 8 +++ manifests/backend/vstorage.pp | 30 +++++---- ...lity_zone-parameters-da10215b94d604f0.yaml | 6 ++ spec/defines/cinder_backend_bdd_spec.rb | 17 ++--- .../cinder_backend_dellemc_unity_spec.rb | 17 ++++- .../cinder_backend_dellemc_vmax_spec.rb | 5 +- .../cinder_backend_dellemc_xtremio_spec.rb | 19 +++++- .../cinder_backend_dellsc_iscsi_spec.rb | 26 +++++++- spec/defines/cinder_backend_emc_vnx_spec.rb | 3 + spec/defines/cinder_backend_eqlx_spec.rb | 27 ++++---- spec/defines/cinder_backend_glusterfs_spec.rb | 3 + spec/defines/cinder_backend_gpfs_spec.rb | 38 ++++++------ .../cinder_backend_hpe3par_iscsi_spec.rb | 16 ++--- .../cinder_backend_hpelefthand_iscsi_spec.rb | 10 +-- spec/defines/cinder_backend_iscsi_spec.rb | 2 + spec/defines/cinder_backend_netapp_spec.rb | 2 + .../cinder_backend_nexenta_edge_spec.rb | 12 ++-- spec/defines/cinder_backend_nexenta_spec.rb | 4 +- spec/defines/cinder_backend_nfs_spec.rb | 3 + spec/defines/cinder_backend_nvmeof_spec.rb | 2 + spec/defines/cinder_backend_pure_spec.rb | 6 +- spec/defines/cinder_backend_quobyte_spec.rb | 9 ++- spec/defines/cinder_backend_rbd_spec.rb | 13 +++- spec/defines/cinder_backend_san_spec.rb | 13 ++-- spec/defines/cinder_backend_scaleio_spec.rb | 1 + spec/defines/cinder_backend_solidfire_spec.rb | 1 + .../cinder_backend_veritas_hyperscale_spec.rb | 5 +- spec/defines/cinder_backend_vmdk_spec.rb | 4 ++ spec/defines/cinder_backend_vstorage_spec.rb | 25 ++++---- 53 files changed, 596 insertions(+), 271 deletions(-) create mode 100644 releasenotes/notes/add-backend_availability_zone-parameters-da10215b94d604f0.yaml diff --git a/manifests/backend/bdd.pp b/manifests/backend/bdd.pp index 1d24ccdd..c29097a2 100644 --- a/manifests/backend/bdd.pp +++ b/manifests/backend/bdd.pp @@ -16,6 +16,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*volume_driver*] # (Optional) Driver to use for volume creation # Defaults to 'cinder.volume.drivers.block_device.BlockDeviceDriver'. @@ -66,15 +72,16 @@ define cinder::backend::bdd ( $iscsi_ip_address, $available_devices, - $volume_backend_name = $name, - $volume_driver = 'cinder.volume.drivers.block_device.BlockDeviceDriver', - $volume_group = $::os_service_default, - $volumes_dir = '/var/lib/cinder/volumes', - $iscsi_helper = 'tgtadm', - $iscsi_protocol = $::os_service_default, - $volume_clear = $::os_service_default, - $manage_volume_type = false, - $extra_options = {}, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $volume_driver = 'cinder.volume.drivers.block_device.BlockDeviceDriver', + $volume_group = $::os_service_default, + $volumes_dir = '/var/lib/cinder/volumes', + $iscsi_helper = 'tgtadm', + $iscsi_protocol = $::os_service_default, + $volume_clear = $::os_service_default, + $manage_volume_type = false, + $extra_options = {}, ) { include ::cinder::deps @@ -86,15 +93,16 @@ define cinder::backend::bdd ( cinder_config { - "${name}/available_devices": value => $available_devices; - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => $volume_driver; - "${name}/iscsi_ip_address": value => $iscsi_ip_address; - "${name}/iscsi_helper": value => $iscsi_helper; - "${name}/volume_group": value => $volume_group; - "${name}/volumes_dir": value => $volumes_dir; - "${name}/iscsi_protocol": value => $iscsi_protocol; - "${name}/volume_clear": value => $volume_clear; + "${name}/available_devices": value => $available_devices; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => $volume_driver; + "${name}/iscsi_ip_address": value => $iscsi_ip_address; + "${name}/iscsi_helper": value => $iscsi_helper; + "${name}/volume_group": value => $volume_group; + "${name}/volumes_dir": value => $volumes_dir; + "${name}/iscsi_protocol": value => $iscsi_protocol; + "${name}/volume_clear": value => $volume_clear; } if $manage_volume_type { diff --git a/manifests/backend/dellemc_unity.pp b/manifests/backend/dellemc_unity.pp index cf2ca4c9..853de84b 100644 --- a/manifests/backend/dellemc_unity.pp +++ b/manifests/backend/dellemc_unity.pp @@ -20,6 +20,12 @@ # (optional) The storage backend name. # Defaults to the $name of the backend # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*unity_io_ports*] # (optional) A comma-separated list of iSCSI or FC ports to be used. # Each port can be Unix-style glob expressions. The Unity Unisphere API port. @@ -46,26 +52,28 @@ define cinder::backend::dellemc_unity ( $san_login, $san_password, $storage_protocol, - $volume_backend_name = $name, - $unity_io_ports = $::os_service_default, - $unity_storage_pool_names = $::os_service_default, - $manage_volume_type = false, - $extra_options = {}, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $unity_io_ports = $::os_service_default, + $unity_storage_pool_names = $::os_service_default, + $manage_volume_type = false, + $extra_options = {}, ) { include ::cinder::deps $driver = 'dell_emc.unity.Driver' cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => "cinder.volume.drivers.${driver}"; - "${name}/san_ip": value => $san_ip; - "${name}/san_login": value => $san_login; - "${name}/san_password": value => $san_password, secret => true; - "${name}/storage_protocol": value => $storage_protocol; - "${name}/unity_io_ports": value => $unity_io_ports; - "${name}/unity_storage_pool_names": value => $unity_storage_pool_names; - } + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => "cinder.volume.drivers.${driver}"; + "${name}/san_ip": value => $san_ip; + "${name}/san_login": value => $san_login; + "${name}/san_password": value => $san_password, secret => true; + "${name}/storage_protocol": value => $storage_protocol; + "${name}/unity_io_ports": value => $unity_io_ports; + "${name}/unity_storage_pool_names": value => $unity_storage_pool_names; + } if $manage_volume_type { cinder_type { $volume_backend_name: diff --git a/manifests/backend/dellemc_vmax_iscsi.pp b/manifests/backend/dellemc_vmax_iscsi.pp index e7a44f37..12045c19 100644 --- a/manifests/backend/dellemc_vmax_iscsi.pp +++ b/manifests/backend/dellemc_vmax_iscsi.pp @@ -10,6 +10,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*cinder_emc_config_file*] # (required) File path of Dell EMC VMAX ISCSI specific configuration file. # @@ -32,6 +38,7 @@ define cinder::backend::dellemc_vmax_iscsi ( $cinder_emc_config_file, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $extra_options = {}, $volume_driver = 'cinder.volume.drivers.dell_emc.vmax.iscsi.VMAXISCSIDriver', $manage_volume_type = false, @@ -42,6 +49,7 @@ define cinder::backend::dellemc_vmax_iscsi ( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => $volume_driver; "${name}/cinder_emc_config_file": value => $cinder_emc_config_file; } diff --git a/manifests/backend/dellemc_xtremio_iscsi.pp b/manifests/backend/dellemc_xtremio_iscsi.pp index 513c53c8..e1dad896 100644 --- a/manifests/backend/dellemc_xtremio_iscsi.pp +++ b/manifests/backend/dellemc_xtremio_iscsi.pp @@ -20,6 +20,12 @@ # (optional) The storage backend name. # Defaults to the name of the backend # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*xtremio_array_busy_retry_count*] # (optional) Number of retries in case array is busy. # Defaults to 5 @@ -50,6 +56,7 @@ define cinder::backend::dellemc_xtremio_iscsi ( $san_password, $xtremio_cluster_name, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $xtremio_array_busy_retry_count = 5, $xtremio_array_busy_retry_interval = 5, $xtremio_volumes_per_glance_cache = 100, @@ -62,6 +69,7 @@ define cinder::backend::dellemc_xtremio_iscsi ( $driver = 'dell_emc.xtremio.XtremIOISCSIDriver' cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => "cinder.volume.drivers.${driver}"; "${name}/san_ip": value => $san_ip; "${name}/san_login": value => $san_login; diff --git a/manifests/backend/dellsc_iscsi.pp b/manifests/backend/dellsc_iscsi.pp index 5887dfe5..a57da3ce 100644 --- a/manifests/backend/dellsc_iscsi.pp +++ b/manifests/backend/dellsc_iscsi.pp @@ -23,6 +23,12 @@ # (optional) The storage backend name. # Defaults to the name of the backend # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*dell_sc_api_port*] # (optional) The Enterprise Manager API port. # Defaults to $::os_service_default @@ -85,6 +91,7 @@ define cinder::backend::dellsc_iscsi ( $iscsi_ip_address, $dell_sc_ssn, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $dell_sc_api_port = $::os_service_default, $dell_sc_server_folder = 'srv', $dell_sc_verify_cert = $::os_service_default, @@ -97,7 +104,7 @@ define cinder::backend::dellsc_iscsi ( $secondary_sc_api_port = $::os_service_default, $manage_volume_type = false, $use_multipath_for_image_xfer = true, - $extra_options = {}, + $extra_options = {}, ) { include ::cinder::deps @@ -115,6 +122,7 @@ default of \"vol\" and will be changed to the upstream OpenStack default in N-re $driver = 'dell_emc.sc.storagecenter_iscsi.SCISCSIDriver' cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => "cinder.volume.drivers.${driver}"; "${name}/san_ip": value => $san_ip; "${name}/san_login": value => $san_login; diff --git a/manifests/backend/emc_vnx.pp b/manifests/backend/emc_vnx.pp index bd4de742..4a2afc0e 100644 --- a/manifests/backend/emc_vnx.pp +++ b/manifests/backend/emc_vnx.pp @@ -10,6 +10,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*san_ip*] # (required) IP address of SAN controller. # @@ -87,6 +93,7 @@ define cinder::backend::emc_vnx ( $package_ensure = 'present', $san_login = 'admin', $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $extra_options = {}, $volume_driver = 'cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver', $storage_protocol = 'iscsi', @@ -116,6 +123,7 @@ define cinder::backend::emc_vnx ( "${name}/san_password": value => $san_password, secret => true; "${name}/storage_vnx_pool_names": value => $storage_vnx_pool_names_real; "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => $volume_driver; "${name}/storage_protocol": value => $storage_protocol; "${name}/initiator_auto_registration": value => $initiator_auto_registration; diff --git a/manifests/backend/eqlx.pp b/manifests/backend/eqlx.pp index d8e8e348..a4c44516 100644 --- a/manifests/backend/eqlx.pp +++ b/manifests/backend/eqlx.pp @@ -26,6 +26,12 @@ # (optional) The backend name. # Defaults to the name of the resource # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*eqlx_group_name*] # (optional) The CLI prompt message without '>'. # Defaults to $::os_service_default @@ -69,18 +75,19 @@ define cinder::backend::eqlx ( $san_ip, $san_login, $san_password, - $san_private_key = $::os_service_default, - $san_thin_provision = $::os_service_default, - $volume_backend_name = $name, - $eqlx_group_name = $::os_service_default, - $eqlx_pool = $::os_service_default, - $eqlx_cli_max_retries = $::os_service_default, - $extra_options = {}, - $chap_username = $::os_service_default, - $chap_password = $::os_service_default, - $use_chap_auth = $::os_service_default, - $ssh_conn_timeout = $::os_service_default, - $manage_volume_type = false, + $san_private_key = $::os_service_default, + $san_thin_provision = $::os_service_default, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $eqlx_group_name = $::os_service_default, + $eqlx_pool = $::os_service_default, + $eqlx_cli_max_retries = $::os_service_default, + $extra_options = {}, + $chap_username = $::os_service_default, + $chap_password = $::os_service_default, + $use_chap_auth = $::os_service_default, + $ssh_conn_timeout = $::os_service_default, + $manage_volume_type = false, ) { include ::cinder::deps @@ -94,18 +101,19 @@ define cinder::backend::eqlx ( } cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => 'cinder.volume.drivers.dell_emc.ps.PSSeriesISCSIDriver'; - "${name}/san_ip": value => $san_ip; - "${name}/san_login": value => $san_login; - "${name}/san_password": value => $san_password, secret => true; - "${name}/san_private_key": value => $san_private_key; - "${name}/san_thin_provision": value => $san_thin_provision; - "${name}/eqlx_group_name": value => $eqlx_group_name; - "${name}/use_chap_auth": value => $use_chap_auth; - "${name}/ssh_conn_timeout": value => $ssh_conn_timeout; - "${name}/eqlx_cli_max_retries": value => $eqlx_cli_max_retries; - "${name}/eqlx_pool": value => $eqlx_pool; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => 'cinder.volume.drivers.dell_emc.ps.PSSeriesISCSIDriver'; + "${name}/san_ip": value => $san_ip; + "${name}/san_login": value => $san_login; + "${name}/san_password": value => $san_password, secret => true; + "${name}/san_private_key": value => $san_private_key; + "${name}/san_thin_provision": value => $san_thin_provision; + "${name}/eqlx_group_name": value => $eqlx_group_name; + "${name}/use_chap_auth": value => $use_chap_auth; + "${name}/ssh_conn_timeout": value => $ssh_conn_timeout; + "${name}/eqlx_cli_max_retries": value => $eqlx_cli_max_retries; + "${name}/eqlx_pool": value => $eqlx_pool; } if $manage_volume_type { diff --git a/manifests/backend/glusterfs.pp b/manifests/backend/glusterfs.pp index d99443ba..a00a0874 100644 --- a/manifests/backend/glusterfs.pp +++ b/manifests/backend/glusterfs.pp @@ -13,6 +13,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*glusterfs_backup_mount_point*] # (optional) Base dir containing mount point for gluster share. # Defaults to $::os_service_default @@ -56,6 +62,7 @@ define cinder::backend::glusterfs ( $glusterfs_shares, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $glusterfs_backup_mount_point = $::os_service_default, $glusterfs_backup_share = $::os_service_default, $glusterfs_sparsed_volumes = $::os_service_default, @@ -76,14 +83,14 @@ define cinder::backend::glusterfs ( } cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => - 'cinder.volume.drivers.glusterfs.GlusterfsDriver'; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => 'cinder.volume.drivers.glusterfs.GlusterfsDriver'; "${name}/glusterfs_backup_mount_point": value => $glusterfs_backup_mount_point; - "${name}/glusterfs_backup_share": value => $glusterfs_backup_share; - "${name}/glusterfs_shares_config": value => $glusterfs_shares_config; - "${name}/glusterfs_sparsed_volumes": value => $glusterfs_sparsed_volumes; - "${name}/glusterfs_mount_point_base": value => $glusterfs_mount_point_base; + "${name}/glusterfs_backup_share": value => $glusterfs_backup_share; + "${name}/glusterfs_shares_config": value => $glusterfs_shares_config; + "${name}/glusterfs_sparsed_volumes": value => $glusterfs_sparsed_volumes; + "${name}/glusterfs_mount_point_base": value => $glusterfs_mount_point_base; } if $manage_volume_type { diff --git a/manifests/backend/gpfs.pp b/manifests/backend/gpfs.pp index d7def7c5..55ad49a5 100644 --- a/manifests/backend/gpfs.pp +++ b/manifests/backend/gpfs.pp @@ -64,6 +64,12 @@ # (optional) SSH port to use to connect to NAS system. # Defaults to $::os_service_default # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# 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 @@ -86,18 +92,19 @@ # define cinder::backend::gpfs ( $gpfs_mount_point_base, - $gpfs_images_dir = $::os_service_default, - $gpfs_images_share_mode = $::os_service_default, - $gpfs_max_clone_depth = $::os_service_default, - $gpfs_sparse_volumes = $::os_service_default, - $gpfs_storage_pool = $::os_service_default, - $nas_host = $::os_service_default, - $nas_login = $::os_service_default, - $nas_password = $::os_service_default, - $nas_private_key = $::os_service_default, - $nas_ssh_port = $::os_service_default, - $manage_volume_type = false, - $extra_options = {}, + $gpfs_images_dir = $::os_service_default, + $gpfs_images_share_mode = $::os_service_default, + $gpfs_max_clone_depth = $::os_service_default, + $gpfs_sparse_volumes = $::os_service_default, + $gpfs_storage_pool = $::os_service_default, + $nas_host = $::os_service_default, + $nas_login = $::os_service_default, + $nas_password = $::os_service_default, + $nas_private_key = $::os_service_default, + $nas_ssh_port = $::os_service_default, + $backend_availability_zone = $::os_service_default, + $manage_volume_type = false, + $extra_options = {}, ) { include ::cinder::deps @@ -110,19 +117,19 @@ define cinder::backend::gpfs ( } cinder_config { - "${name}/volume_driver": - value => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'; - "${name}/gpfs_max_clone_depth": value => $gpfs_max_clone_depth; - "${name}/gpfs_mount_point_base": value => $gpfs_mount_point_base; - "${name}/gpfs_sparse_volumes": value => $gpfs_sparse_volumes; - "${name}/gpfs_storage_pool": value => $gpfs_storage_pool; - "${name}/gpfs_images_share_mode": value => $gpfs_images_share_mode; - "${name}/gpfs_images_dir": value => $gpfs_images_dir; - "${name}/nas_host": value => $nas_host; - "${name}/nas_login": value => $nas_login; - "${name}/nas_password": value => $nas_password, secret => true; - "${name}/nas_private_key": value => $nas_private_key; - "${name}/nas_ssh_port": value => $nas_ssh_port; + "${name}/volume_driver": value => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver'; + "${name}/gpfs_max_clone_depth": value => $gpfs_max_clone_depth; + "${name}/gpfs_mount_point_base": value => $gpfs_mount_point_base; + "${name}/gpfs_sparse_volumes": value => $gpfs_sparse_volumes; + "${name}/gpfs_storage_pool": value => $gpfs_storage_pool; + "${name}/gpfs_images_share_mode": value => $gpfs_images_share_mode; + "${name}/gpfs_images_dir": value => $gpfs_images_dir; + "${name}/nas_host": value => $nas_host; + "${name}/nas_login": value => $nas_login; + "${name}/nas_password": value => $nas_password, secret => true; + "${name}/nas_private_key": value => $nas_private_key; + "${name}/nas_ssh_port": value => $nas_ssh_port; + "${name}/backend_availability_zone": value => $backend_availability_zone; } if $manage_volume_type { diff --git a/manifests/backend/hpe3par_iscsi.pp b/manifests/backend/hpe3par_iscsi.pp index 8344c3ab..46e8b099 100644 --- a/manifests/backend/hpe3par_iscsi.pp +++ b/manifests/backend/hpe3par_iscsi.pp @@ -31,6 +31,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*volume_driver*] # (optional) Setup cinder-volume to use HPE 3par volume driver. # Defaults to 'cinder.volume.drivers.hpe.hpe_3par_fc.HPE3PARFCDriver' @@ -75,6 +81,7 @@ define cinder::backend::hpe3par_iscsi( $san_password, $hpe3par_iscsi_ips, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $volume_driver = 'cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver', $hpe3par_iscsi_chap_enabled = false, $hpe3par_cpg_snap = 'userCPG', @@ -92,6 +99,7 @@ define cinder::backend::hpe3par_iscsi( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => $volume_driver; "${name}/hpe3par_username": value => $hpe3par_username; "${name}/hpe3par_password": value => $hpe3par_password, secret => true; diff --git a/manifests/backend/hpelefthand_iscsi.pp b/manifests/backend/hpelefthand_iscsi.pp index cd0b9a41..cfaa32c2 100755 --- a/manifests/backend/hpelefthand_iscsi.pp +++ b/manifests/backend/hpelefthand_iscsi.pp @@ -16,6 +16,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*volume_driver*] # (optional) Setup cinder-volume to use HPE LeftHand volume driver. # Defaults to 'cinder.volume.drivers.hpe.hpe_lefthand_iscsi.HPELeftHandISCSIDriver' @@ -47,6 +53,7 @@ define cinder::backend::hpelefthand_iscsi( $hpelefthand_password, $hpelefthand_clustername, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $volume_driver = 'cinder.volume.drivers.hpe.hpe_lefthand_iscsi.HPELeftHandISCSIDriver', $hpelefthand_iscsi_chap_enabled = false, $hpelefthand_debug = false, @@ -58,6 +65,7 @@ define cinder::backend::hpelefthand_iscsi( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => $volume_driver; "${name}/hpelefthand_username": value => $hpelefthand_username; "${name}/hpelefthand_password": value => $hpelefthand_password, secret => true; diff --git a/manifests/backend/iscsi.pp b/manifests/backend/iscsi.pp index bc65416c..30985990 100644 --- a/manifests/backend/iscsi.pp +++ b/manifests/backend/iscsi.pp @@ -10,6 +10,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*volume_driver*] # (Optional) Driver to use for volume creation # Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver'. @@ -44,14 +50,15 @@ # define cinder::backend::iscsi ( $iscsi_ip_address, - $volume_backend_name = $name, - $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', - $volume_group = $::os_service_default, - $volumes_dir = '/var/lib/cinder/volumes', - $iscsi_helper = $::cinder::params::iscsi_helper, - $iscsi_protocol = $::os_service_default, - $manage_volume_type = false, - $extra_options = {}, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', + $volume_group = $::os_service_default, + $volumes_dir = '/var/lib/cinder/volumes', + $iscsi_helper = $::cinder::params::iscsi_helper, + $iscsi_protocol = $::os_service_default, + $manage_volume_type = false, + $extra_options = {}, ) { include ::cinder::deps @@ -67,13 +74,14 @@ define cinder::backend::iscsi ( } cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => $volume_driver; - "${name}/iscsi_ip_address": value => $iscsi_ip_address; - "${name}/iscsi_helper": value => $iscsi_helper; - "${name}/volume_group": value => $volume_group; - "${name}/volumes_dir": value => $volumes_dir; - "${name}/iscsi_protocol": value => $iscsi_protocol; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => $volume_driver; + "${name}/iscsi_ip_address": value => $iscsi_ip_address; + "${name}/iscsi_helper": value => $iscsi_helper; + "${name}/volume_group": value => $volume_group; + "${name}/volumes_dir": value => $volumes_dir; + "${name}/iscsi_protocol": value => $iscsi_protocol; } if $manage_volume_type { diff --git a/manifests/backend/netapp.pp b/manifests/backend/netapp.pp index 12345992..301cf2ef 100644 --- a/manifests/backend/netapp.pp +++ b/manifests/backend/netapp.pp @@ -9,6 +9,12 @@ # (optional) The name of the cinder::backend::netapp ressource # Defaults to $name. # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*netapp_login*] # (required) Administrative user account name used to access the storage # system or proxy server. @@ -200,6 +206,7 @@ define cinder::backend::netapp ( $netapp_password, $netapp_server_hostname, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $netapp_server_port = '80', $netapp_size_multiplier = '1.2', $netapp_storage_family = 'ontap_cluster', @@ -240,6 +247,7 @@ define cinder::backend::netapp ( cinder_config { "${name}/nfs_mount_options": value => $nfs_mount_options; "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.netapp.common.NetAppDriver'; "${name}/netapp_login": value => $netapp_login; "${name}/netapp_password": value => $netapp_password, secret => true; diff --git a/manifests/backend/nexenta.pp b/manifests/backend/nexenta.pp index b8da1a75..8c8fd65d 100644 --- a/manifests/backend/nexenta.pp +++ b/manifests/backend/nexenta.pp @@ -17,6 +17,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*nexenta_volume*] # (optional) Pool on SA that will hold all volumes. # Defaults to 'cinder'. @@ -62,6 +68,7 @@ define cinder::backend::nexenta ( $nexenta_password, $nexenta_host, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $nexenta_volume = 'cinder', $nexenta_target_prefix = 'iqn:', $nexenta_target_group_prefix = 'cinder/', @@ -77,6 +84,7 @@ define cinder::backend::nexenta ( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/nexenta_user": value => $nexenta_user; "${name}/nexenta_password": value => $nexenta_password, secret => true; "${name}/nexenta_host": value => $nexenta_host; diff --git a/manifests/backend/nexenta_edge.pp b/manifests/backend/nexenta_edge.pp index d070ad48..9f0a069b 100644 --- a/manifests/backend/nexenta_edge.pp +++ b/manifests/backend/nexenta_edge.pp @@ -24,6 +24,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*nexenta_lun_container*] # (optional) Logical path of bucket for LUNs. # Defaults to 'cinder'. @@ -57,27 +63,29 @@ define cinder::backend::nexenta_edge ( $nexenta_rest_password, $nexenta_rest_address, $nexenta_client_address, - $nexenta_rest_port = '8080', - $volume_backend_name = $name, - $nexenta_lun_container = 'cinder', - $nexenta_iscsi_service = 'cinder', - $nexenta_chunksize = '32768', - $volume_driver = 'cinder.volume.drivers.nexenta.nexentaedge.iscsi.NexentaEdgeISCSIDriver', - $manage_volume_type = false, - $extra_options = {}, + $nexenta_rest_port = '8080', + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $nexenta_lun_container = 'cinder', + $nexenta_iscsi_service = 'cinder', + $nexenta_chunksize = '32768', + $volume_driver = 'cinder.volume.drivers.nexenta.nexentaedge.iscsi.NexentaEdgeISCSIDriver', + $manage_volume_type = false, + $extra_options = {}, ) { cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/nexenta_rest_user": value => $nexenta_rest_user; - "${name}/nexenta_rest_password": value => $nexenta_rest_password, secret => true; - "${name}/nexenta_rest_address": value => $nexenta_rest_address; - "${name}/nexenta_client_address": value => $nexenta_client_address; - "${name}/nexenta_rest_port": value => $nexenta_rest_port; - "${name}/nexenta_lun_container": value => $nexenta_lun_container; - "${name}/nexenta_iscsi_service": value => $nexenta_iscsi_service; - "${name}/nexenta_chunksize": value => $nexenta_chunksize; - "${name}/volume_driver": value => $volume_driver; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/nexenta_rest_user": value => $nexenta_rest_user; + "${name}/nexenta_rest_password": value => $nexenta_rest_password, secret => true; + "${name}/nexenta_rest_address": value => $nexenta_rest_address; + "${name}/nexenta_client_address": value => $nexenta_client_address; + "${name}/nexenta_rest_port": value => $nexenta_rest_port; + "${name}/nexenta_lun_container": value => $nexenta_lun_container; + "${name}/nexenta_iscsi_service": value => $nexenta_iscsi_service; + "${name}/nexenta_chunksize": value => $nexenta_chunksize; + "${name}/volume_driver": value => $volume_driver; } if $manage_volume_type { diff --git a/manifests/backend/nfs.pp b/manifests/backend/nfs.pp index 52df98d4..597aca52 100644 --- a/manifests/backend/nfs.pp +++ b/manifests/backend/nfs.pp @@ -6,6 +6,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*nfs_servers*] # (Required) Description # Defaults to '[]' @@ -89,6 +95,7 @@ # define cinder::backend::nfs ( $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $nfs_servers = [], $nfs_mount_attempts = $::os_service_default, $nfs_mount_options = $::os_service_default, @@ -116,6 +123,7 @@ define cinder::backend::nfs ( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.nfs.NfsDriver'; "${name}/nfs_shares_config": value => $nfs_shares_config; diff --git a/manifests/backend/nvmeof.pp b/manifests/backend/nvmeof.pp index a4ad69ad..96ffc119 100644 --- a/manifests/backend/nvmeof.pp +++ b/manifests/backend/nvmeof.pp @@ -31,6 +31,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*volume_driver*] # (Optional) Driver to use for volume creation # Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver'. @@ -44,28 +50,30 @@ define cinder::backend::nvmeof ( $target_port, $target_helper, $target_protocol, - $target_prefix = $::os_service_default, - $nvmet_port_id = '1', - $nvmet_ns_id = '10', - $volume_backend_name = $name, - $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', - $volume_group = $::os_service_default, + $target_prefix = $::os_service_default, + $nvmet_port_id = '1', + $nvmet_ns_id = '10', + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', + $volume_group = $::os_service_default, ) { include ::cinder::deps include ::cinder::params cinder_config { - "${name}/target_ip_address": value => $target_ip_address; - "${name}/target_port": value => $target_port; - "${name}/target_helper": value => $target_helper; - "${name}/target_protocol": value => $target_protocol; - "${name}/target_prefix": value => $target_prefix; - "${name}/nvmet_port_id": value => $nvmet_port_id; - "${name}/nvmet_ns_id": value => $nvmet_ns_id; - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => $volume_driver; - "${name}/volume_group": value => $volume_group; + "${name}/target_ip_address": value => $target_ip_address; + "${name}/target_port": value => $target_port; + "${name}/target_helper": value => $target_helper; + "${name}/target_protocol": value => $target_protocol; + "${name}/target_prefix": value => $target_prefix; + "${name}/nvmet_port_id": value => $nvmet_port_id; + "${name}/nvmet_ns_id": value => $nvmet_ns_id; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => $volume_driver; + "${name}/volume_group": value => $volume_group; } package { 'nvmetcli': diff --git a/manifests/backend/pure.pp b/manifests/backend/pure.pp index 9b7be984..bcd7ce94 100644 --- a/manifests/backend/pure.pp +++ b/manifests/backend/pure.pp @@ -15,6 +15,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*pure_storage_protocol*] # (optional) Must be either 'iSCSI' or 'FC'. This will determine # which Volume Driver will be configured; PureISCSIDriver or PureFCDriver. @@ -44,6 +50,7 @@ define cinder::backend::pure( $san_ip, $pure_api_token, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $pure_storage_protocol = 'iSCSI', $use_chap_auth = false, $use_multipath_for_image_xfer = true, @@ -60,6 +67,7 @@ define cinder::backend::pure( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => $volume_driver; "${name}/san_ip": value => $san_ip; "${name}/pure_api_token": value => $pure_api_token, secret => true; diff --git a/manifests/backend/quobyte.pp b/manifests/backend/quobyte.pp index e48aae1f..84ddeee0 100644 --- a/manifests/backend/quobyte.pp +++ b/manifests/backend/quobyte.pp @@ -34,6 +34,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# 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 @@ -48,18 +54,20 @@ # define cinder::backend::quobyte ( $quobyte_volume_url, - $quobyte_client_cfg = undef, - $quobyte_qcow2_volumes = undef, - $quobyte_sparsed_volumes = undef, - $quobyte_mount_point_base = undef, - $volume_backend_name = $name, - $manage_volume_type = false, + $quobyte_client_cfg = undef, + $quobyte_qcow2_volumes = undef, + $quobyte_sparsed_volumes = undef, + $quobyte_mount_point_base = undef, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $manage_volume_type = false, ) { include ::cinder::deps cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.quobyte.QuobyteDriver'; "${name}/quobyte_volume_url": value => $quobyte_volume_url; diff --git a/manifests/backend/rbd.pp b/manifests/backend/rbd.pp index cab56b92..089c5eac 100644 --- a/manifests/backend/rbd.pp +++ b/manifests/backend/rbd.pp @@ -21,6 +21,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*rbd_ceph_conf*] # (optional) Path to the ceph configuration file to use # Defaults to '/etc/ceph/ceph.conf' @@ -74,6 +80,7 @@ define cinder::backend::rbd ( $rbd_user, $backend_host = undef, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $rbd_ceph_conf = '/etc/ceph/ceph.conf', $rbd_flatten_volume_from_snapshot = $::os_service_default, $rbd_secret_uuid = $::os_service_default, @@ -91,6 +98,7 @@ define cinder::backend::rbd ( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.rbd.RBDDriver'; "${name}/rbd_ceph_conf": value => $rbd_ceph_conf; "${name}/rbd_user": value => $rbd_user; diff --git a/manifests/backend/san.pp b/manifests/backend/san.pp index d3ada6e3..baf77e4b 100644 --- a/manifests/backend/san.pp +++ b/manifests/backend/san.pp @@ -12,6 +12,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*san_thin_provision*] # (optional) Use thin provisioning for SAN volumes? Defaults to true. # @@ -64,38 +70,40 @@ # define cinder::backend::san ( $volume_driver, - $volume_backend_name = $name, - $san_thin_provision = true, - $san_ip = undef, - $san_login = 'admin', - $san_password = undef, - $san_private_key = undef, - $san_clustername = undef, - $san_ssh_port = 22, - $san_is_local = false, - $ssh_conn_timeout = 30, - $ssh_min_pool_conn = 1, - $ssh_max_pool_conn = 5, - $manage_volume_type = false, - $extra_options = {}, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $san_thin_provision = true, + $san_ip = undef, + $san_login = 'admin', + $san_password = undef, + $san_private_key = undef, + $san_clustername = undef, + $san_ssh_port = 22, + $san_is_local = false, + $ssh_conn_timeout = 30, + $ssh_min_pool_conn = 1, + $ssh_max_pool_conn = 5, + $manage_volume_type = false, + $extra_options = {}, ) { include ::cinder::deps cinder_config { - "${name}/volume_backend_name": value => $volume_backend_name; - "${name}/volume_driver": value => $volume_driver; - "${name}/san_thin_provision": value => $san_thin_provision; - "${name}/san_ip": value => $san_ip; - "${name}/san_login": value => $san_login; - "${name}/san_password": value => $san_password, secret => true; - "${name}/san_private_key": value => $san_private_key; - "${name}/san_clustername": value => $san_clustername; - "${name}/san_ssh_port": value => $san_ssh_port; - "${name}/san_is_local": value => $san_is_local; - "${name}/ssh_conn_timeout": value => $ssh_conn_timeout; - "${name}/ssh_min_pool_conn": value => $ssh_min_pool_conn; - "${name}/ssh_max_pool_conn": value => $ssh_max_pool_conn; + "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; + "${name}/volume_driver": value => $volume_driver; + "${name}/san_thin_provision": value => $san_thin_provision; + "${name}/san_ip": value => $san_ip; + "${name}/san_login": value => $san_login; + "${name}/san_password": value => $san_password, secret => true; + "${name}/san_private_key": value => $san_private_key; + "${name}/san_clustername": value => $san_clustername; + "${name}/san_ssh_port": value => $san_ssh_port; + "${name}/san_is_local": value => $san_is_local; + "${name}/ssh_conn_timeout": value => $ssh_conn_timeout; + "${name}/ssh_min_pool_conn": value => $ssh_min_pool_conn; + "${name}/ssh_max_pool_conn": value => $ssh_max_pool_conn; } if $manage_volume_type { diff --git a/manifests/backend/scaleio.pp b/manifests/backend/scaleio.pp index 795b6759..f4f47ea2 100644 --- a/manifests/backend/scaleio.pp +++ b/manifests/backend/scaleio.pp @@ -9,6 +9,12 @@ # (optional) The name of the cinder::backend::scaleio ressource # Defaults to $name. # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*sio_login*] # (required) Administrative user account name used to access the storage # system or proxy server. @@ -109,6 +115,7 @@ define cinder::backend::scaleio ( $sio_storage_pool_name, $sio_storage_pools, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $sio_server_port = $::os_service_default, $sio_verify_server_certificate = $::os_service_default, $sio_server_certificate_path = $::os_service_default, @@ -122,6 +129,7 @@ define cinder::backend::scaleio ( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.dell_emc.scaleio.driver.ScaleIODriver'; "${name}/san_login": value => $sio_login; "${name}/san_password": value => $sio_password, secret => true; diff --git a/manifests/backend/solidfire.pp b/manifests/backend/solidfire.pp index d9346451..c8fd9983 100644 --- a/manifests/backend/solidfire.pp +++ b/manifests/backend/solidfire.pp @@ -9,6 +9,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*volume_driver*] # (optional) Setup cinder-volume to use SolidFire volume driver. # Defaults to 'cinder.volume.drivers.solidfire.SolidFireDriver' @@ -87,7 +93,8 @@ define cinder::backend::solidfire( $san_login, $san_password, $volume_backend_name = $name, - $volume_driver = 'cinder.volume.drivers.solidfire.SolidFireDriver', + $backend_availability_zone = $::os_service_default, + $volume_driver = 'cinder.volume.drivers.solidfire.SolidFireDriver', $sf_emulate_512 = $::os_service_default, $sf_allow_tenant_qos = $::os_service_default, $sf_account_prefix = $::os_service_default, @@ -106,6 +113,7 @@ define cinder::backend::solidfire( cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => $volume_driver; "${name}/san_ip": value => $san_ip; "${name}/san_login": value => $san_login; diff --git a/manifests/backend/veritas_hyperscale.pp b/manifests/backend/veritas_hyperscale.pp index 830de7d3..b7bf81b6 100644 --- a/manifests/backend/veritas_hyperscale.pp +++ b/manifests/backend/veritas_hyperscale.pp @@ -8,6 +8,12 @@ # (optional) The name of the cinder::backend::veritas_hyperscale ressource # Defaults to $name. # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*extra_options*] # (optional) Hash of extra options to pass to the backend # Defaults to: {} @@ -30,15 +36,17 @@ # define cinder::backend::veritas_hyperscale ( - $volume_backend_name = $name, - $extra_options = {}, - $manage_volume_type = false, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $extra_options = {}, + $manage_volume_type = false, ) { include ::cinder::deps cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver'; "${name}/image_volume_cache_enabled": value => true } diff --git a/manifests/backend/vmdk.pp b/manifests/backend/vmdk.pp index 3194abd7..981a6eae 100644 --- a/manifests/backend/vmdk.pp +++ b/manifests/backend/vmdk.pp @@ -17,6 +17,12 @@ # Used to set the volume_backend_name in multiple backends. # Defaults to $name as passed in the title. # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*api_retry_count*] # (optional) The number of times we retry on failures, # e.g., socket error, etc. @@ -66,6 +72,7 @@ define cinder::backend::vmdk ( $host_username, $host_password, $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, $volume_folder = 'cinder-volumes', $api_retry_count = $::os_service_default, $max_object_retrieval = $::os_service_default, @@ -90,6 +97,7 @@ module default of \"5\" and will be changed to the upstream OpenStack default in cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver'; "${name}/vmware_host_ip": value => $host_ip; "${name}/vmware_host_username": value => $host_username; diff --git a/manifests/backend/vstorage.pp b/manifests/backend/vstorage.pp index 2244ba9d..e84ea3a1 100644 --- a/manifests/backend/vstorage.pp +++ b/manifests/backend/vstorage.pp @@ -14,6 +14,12 @@ # (optional) Allows for the volume_backend_name to be separate of $name. # Defaults to: $name # +# [*backend_availability_zone*] +# (Optional) Availability zone for this volume backend. +# If not set, the storage_availability_zone option value +# is used as the default for all backends. +# Defaults to $::os_service_default. +# # [*shares_config_path*] # (optional) Shares config file path. # Defaults to: /etc/cinder/vzstorage_shares @@ -59,23 +65,25 @@ define cinder::backend::vstorage ( $cluster_name, $cluster_password, - $volume_backend_name = $name, - $shares_config_path = '/etc/cinder/vzstorage_shares', - $use_sparsed_volumes = $::os_service_default, - $used_ratio = $::os_service_default, - $mount_point_base = $::os_service_default, - $default_volume_format = $::os_service_default, - $manage_volume_type = false, - $mount_user = 'cinder', - $mount_group = 'root', - $mount_permissions = '0770', - $manage_package = true, + $volume_backend_name = $name, + $backend_availability_zone = $::os_service_default, + $shares_config_path = '/etc/cinder/vzstorage_shares', + $use_sparsed_volumes = $::os_service_default, + $used_ratio = $::os_service_default, + $mount_point_base = $::os_service_default, + $default_volume_format = $::os_service_default, + $manage_volume_type = false, + $mount_user = 'cinder', + $mount_group = 'root', + $mount_permissions = '0770', + $manage_package = true, ) { include ::cinder::deps cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; + "${name}/backend_availability_zone": value => $backend_availability_zone; "${name}/volume_driver": value => 'cinder.volume.drivers.vzstorage.VZStorageDriver'; "${name}/vzstorage_shares_config": value => $shares_config_path; "${name}/vzstorage_sparsed_volumes": value => $use_sparsed_volumes; diff --git a/releasenotes/notes/add-backend_availability_zone-parameters-da10215b94d604f0.yaml b/releasenotes/notes/add-backend_availability_zone-parameters-da10215b94d604f0.yaml new file mode 100644 index 00000000..d5fd007c --- /dev/null +++ b/releasenotes/notes/add-backend_availability_zone-parameters-da10215b94d604f0.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add new "backend_availability_zone" parameter to every volume + backend. The parameters are optional, and when set they override the + DEFAULT/storage_availability_zone for the corresponding backend. diff --git a/spec/defines/cinder_backend_bdd_spec.rb b/spec/defines/cinder_backend_bdd_spec.rb index 4acf33fc..d4ec8f0c 100644 --- a/spec/defines/cinder_backend_bdd_spec.rb +++ b/spec/defines/cinder_backend_bdd_spec.rb @@ -22,19 +22,21 @@ describe 'cinder::backend::bdd' do should contain_cinder_config('hippo/volume_group').with_value('') should contain_cinder_config('hippo/iscsi_protocol').with_value('') should contain_cinder_config('hippo/volume_clear').with_value('') + should contain_cinder_config('hippo/backend_availability_zone').with_value('') end end context 'with optional parameters' do before :each do params.merge!({ - :iscsi_ip_address => '10.20.0.2', - :available_devices => '/dev/sdb,/dev/sdc', - :volumes_dir => '/var/lib/cinder/bdd-volumes', - :volume_clear => 'zero', - :volume_group => 'cinder', - :iscsi_helper => 'lioadm', - :manage_volume_type => true, + :iscsi_ip_address => '10.20.0.2', + :available_devices => '/dev/sdb,/dev/sdc', + :volumes_dir => '/var/lib/cinder/bdd-volumes', + :volume_clear => 'zero', + :volume_group => 'cinder', + :iscsi_helper => 'lioadm', + :manage_volume_type => true, + :backend_availability_zone => 'my_zone', }) end @@ -45,6 +47,7 @@ describe 'cinder::backend::bdd' do should contain_cinder_config('hippo/iscsi_helper').with_value('lioadm') should contain_cinder_config('hippo/volume_group').with_value('cinder') should contain_cinder_config('hippo/volume_clear').with_value('zero') + should contain_cinder_config('hippo/backend_availability_zone').with_value('my_zone') end it 'should create type with properties' do should contain_cinder_type('hippo').with(:ensure => :present, :properties => ['volume_backend_name=hippo']) diff --git a/spec/defines/cinder_backend_dellemc_unity_spec.rb b/spec/defines/cinder_backend_dellemc_unity_spec.rb index 2a5d692a..b82b437e 100644 --- a/spec/defines/cinder_backend_dellemc_unity_spec.rb +++ b/spec/defines/cinder_backend_dellemc_unity_spec.rb @@ -17,11 +17,20 @@ describe 'cinder::backend::dellemc_unity' do let :default_params do { + :backend_availability_zone => '', :unity_io_ports => '', :unity_storage_pool_names => '', } end + let :custom_params do + { + :backend_availability_zone => 'my_zone', + :unity_io_ports => '1,42,66', + :unity_storage_pool_names => 'pool_1,pool_2', + } + end + let :facts do OSDefaults.get_facts({}) end @@ -41,8 +50,14 @@ describe 'cinder::backend::dellemc_unity' do end end + context 'with default parameters' do + it_configures 'dellemc_unity volume driver' + end - context 'with parameters' do + context 'with custom parameters' do + before do + params.merge(custom_params) + end it_configures 'dellemc_unity volume driver' end diff --git a/spec/defines/cinder_backend_dellemc_vmax_spec.rb b/spec/defines/cinder_backend_dellemc_vmax_spec.rb index 904f5d2b..a78ed551 100644 --- a/spec/defines/cinder_backend_dellemc_vmax_spec.rb +++ b/spec/defines/cinder_backend_dellemc_vmax_spec.rb @@ -25,13 +25,14 @@ describe 'cinder::backend::dellemc_vmax_iscsi' do describe 'dell emc vmax iscsi backend overriding some parameters' do before :each do params.merge!({ + :backend_availability_zone => 'my_zone', :manage_volume_type => true, }) end it 'configure dell emc vmax iscsi volume driver' do - is_expected.to contain_cinder_config('dellemc_vmax_iscsi/cinder_emc_config_file').with_value('/etc/cinder/cinder_emc_config_CONF_GROUP_ISCSI.xml' -) + is_expected.to contain_cinder_config('dellemc_vmax_iscsi/cinder_emc_config_file').with_value('/etc/cinder/cinder_emc_config_CONF_GROUP_ISCSI.xml') + is_expected.to contain_cinder_config('dellemc_vmax_iscsi/backend_availability_zone').with_value('my_zone') end it 'should create type with properties' do diff --git a/spec/defines/cinder_backend_dellemc_xtremio_spec.rb b/spec/defines/cinder_backend_dellemc_xtremio_spec.rb index ab1b4cda..fb378c10 100644 --- a/spec/defines/cinder_backend_dellemc_xtremio_spec.rb +++ b/spec/defines/cinder_backend_dellemc_xtremio_spec.rb @@ -17,12 +17,22 @@ describe 'cinder::backend::dellemc_xtremio_iscsi' do let :default_params do { + :backend_availability_zone => '', :xtremio_array_busy_retry_count => 5, :xtremio_array_busy_retry_interval => 5, :xtremio_volumes_per_glance_cache => 100, } end + let :custom_params do + { + :backend_availability_zone => 'my_zone', + :xtremio_array_busy_retry_count => 15, + :xtremio_array_busy_retry_interval => 25, + :xtremio_volumes_per_glance_cache => 10, + } + end + let :facts do OSDefaults.get_facts({}) end @@ -43,7 +53,14 @@ describe 'cinder::backend::dellemc_xtremio_iscsi' do end - context 'with parameters' do + context 'with default parameters' do + it_configures 'dellemc_xtremio_iscsi volume driver' + end + + context 'with custom parameters' do + before do + params.merge(custom_params) + end it_configures 'dellemc_xtremio_iscsi volume driver' end diff --git a/spec/defines/cinder_backend_dellsc_iscsi_spec.rb b/spec/defines/cinder_backend_dellsc_iscsi_spec.rb index e0bdd164..65eaa03f 100644 --- a/spec/defines/cinder_backend_dellsc_iscsi_spec.rb +++ b/spec/defines/cinder_backend_dellsc_iscsi_spec.rb @@ -18,6 +18,7 @@ describe 'cinder::backend::dellsc_iscsi' do let :default_params do { + :backend_availability_zone => '', :dell_sc_api_port => '', :dell_sc_server_folder => 'srv', :dell_sc_verify_cert => '', @@ -32,6 +33,22 @@ describe 'cinder::backend::dellsc_iscsi' do } end + let :custom_params do + { + :backend_availability_zone => 'my_zone', + :dell_sc_api_port => 111, + :dell_sc_server_folder => 'other_srv', + :dell_sc_verify_cert => true, + :dell_sc_volume_folder => 'other_vol', + :iscsi_port => 222, + :excluded_domain_ip => '127.0.0.2', + :secondary_san_ip => '127.0.0.3', + :secondary_san_login => 'Foo', + :secondary_san_password => 'Bar', + :secondary_sc_api_port => 333, + } + end + let :facts do OSDefaults.get_facts({}) end @@ -53,7 +70,14 @@ describe 'cinder::backend::dellsc_iscsi' do end - context 'with parameters' do + context 'with default parameters' do + it_configures 'dellsc_iscsi volume driver' + end + + context 'with custom parameters' do + before do + params.merge(custom_params) + end it_configures 'dellsc_iscsi volume driver' end diff --git a/spec/defines/cinder_backend_emc_vnx_spec.rb b/spec/defines/cinder_backend_emc_vnx_spec.rb index 735406c5..44908d7d 100644 --- a/spec/defines/cinder_backend_emc_vnx_spec.rb +++ b/spec/defines/cinder_backend_emc_vnx_spec.rb @@ -32,6 +32,7 @@ describe 'cinder::backend::emc_vnx' do is_expected.to contain_cinder_config('emc/storage_vnx_authentication_type').with_value('') is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value('') is_expected.to contain_cinder_config('emc/naviseccli_path').with_value('') + is_expected.to contain_cinder_config('emc/backend_availability_zone').with_value('') end end @@ -44,6 +45,7 @@ describe 'cinder::backend::emc_vnx' do :naviseccli_path => '/opt/Navisphere/bin/naviseccli', :manage_volume_type => true, :storage_protocol => 'fc', + :backend_availability_zone => 'my_zone', }) end @@ -53,6 +55,7 @@ describe 'cinder::backend::emc_vnx' do is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value(params[:storage_vnx_security_file_dir]) is_expected.to contain_cinder_config('emc/naviseccli_path').with_value(params[:naviseccli_path]) is_expected.to contain_cinder_config('emc/storage_protocol').with_value(params[:storage_protocol]) + is_expected.to contain_cinder_config('emc/backend_availability_zone').with_value(params[:backend_availability_zone]) end it 'should create type with properties' do diff --git a/spec/defines/cinder_backend_eqlx_spec.rb b/spec/defines/cinder_backend_eqlx_spec.rb index 463e7352..77e575c1 100644 --- a/spec/defines/cinder_backend_eqlx_spec.rb +++ b/spec/defines/cinder_backend_eqlx_spec.rb @@ -7,19 +7,20 @@ describe 'cinder::backend::eqlx' do let :params do { - :san_ip => '192.168.100.10', - :san_login => 'grpadmin', - :san_password => '12345', - :san_private_key => '', - :volume_backend_name => 'Dell_EQLX', - :san_thin_provision => '', - :eqlx_group_name => '', - :eqlx_pool => 'apool', - :use_chap_auth => true, - :chap_username => 'chapadm', - :chap_password => '56789', - :ssh_conn_timeout => 31, - :eqlx_cli_max_retries => 6, + :backend_availability_zone => 'my_zone', + :san_ip => '192.168.100.10', + :san_login => 'grpadmin', + :san_password => '12345', + :san_private_key => '', + :volume_backend_name => 'Dell_EQLX', + :san_thin_provision => '', + :eqlx_group_name => '', + :eqlx_pool => 'apool', + :use_chap_auth => true, + :chap_username => 'chapadm', + :chap_password => '56789', + :ssh_conn_timeout => 31, + :eqlx_cli_max_retries => 6, } end diff --git a/spec/defines/cinder_backend_glusterfs_spec.rb b/spec/defines/cinder_backend_glusterfs_spec.rb index 64add740..0e6f60b4 100644 --- a/spec/defines/cinder_backend_glusterfs_spec.rb +++ b/spec/defines/cinder_backend_glusterfs_spec.rb @@ -11,6 +11,7 @@ describe 'cinder::backend::glusterfs' do let :params do { + :backend_availability_zone => 'my_zone', :glusterfs_shares => ['10.10.10.10:/volumes', '10.10.10.11:/volumes'], :glusterfs_shares_config => '/etc/cinder/other_shares.conf', :glusterfs_sparsed_volumes => true, @@ -21,6 +22,8 @@ describe 'cinder::backend::glusterfs' do it 'configures glusterfs volume driver' do is_expected.to contain_cinder_config('mygluster/volume_driver').with_value( 'cinder.volume.drivers.glusterfs.GlusterfsDriver') + is_expected.to contain_cinder_config('mygluster/backend_availability_zone').with_value( + 'my_zone') is_expected.to contain_cinder_config('mygluster/glusterfs_backup_mount_point').with_value( '') is_expected.to contain_cinder_config('mygluster/glusterfs_backup_share').with_value( diff --git a/spec/defines/cinder_backend_gpfs_spec.rb b/spec/defines/cinder_backend_gpfs_spec.rb index 62286745..b24a675e 100644 --- a/spec/defines/cinder_backend_gpfs_spec.rb +++ b/spec/defines/cinder_backend_gpfs_spec.rb @@ -12,29 +12,31 @@ describe 'cinder::backend::gpfs' do let :default_params do { - :gpfs_max_clone_depth => '', - :gpfs_sparse_volumes => '', - :gpfs_storage_pool => '', - :gpfs_images_dir => '', - :gpfs_images_share_mode => '', - :nas_host => '', - :nas_login => '', - :nas_password => '', - :nas_private_key => '', - :nas_ssh_port => '', + :backend_availability_zone => '', + :gpfs_max_clone_depth => '', + :gpfs_sparse_volumes => '', + :gpfs_storage_pool => '', + :gpfs_images_dir => '', + :gpfs_images_share_mode => '', + :nas_host => '', + :nas_login => '', + :nas_password => '', + :nas_private_key => '', + :nas_ssh_port => '', } end let :custom_params do { - :gpfs_max_clone_depth => 1, - :gpfs_sparse_volumes => false, - :gpfs_storage_pool => 'foo', - :nas_host => 'nas_host', - :nas_login => 'admin', - :nas_password => 'nas_password', - :nas_private_key => '/path/to/private_key', - :nas_ssh_port => '22', + :backend_availability_zone => 'my_zone', + :gpfs_max_clone_depth => 1, + :gpfs_sparse_volumes => false, + :gpfs_storage_pool => 'foo', + :nas_host => 'nas_host', + :nas_login => 'admin', + :nas_password => 'nas_password', + :nas_private_key => '/path/to/private_key', + :nas_ssh_port => '22', } end diff --git a/spec/defines/cinder_backend_hpe3par_iscsi_spec.rb b/spec/defines/cinder_backend_hpe3par_iscsi_spec.rb index 53a0197c..f4587f41 100644 --- a/spec/defines/cinder_backend_hpe3par_iscsi_spec.rb +++ b/spec/defines/cinder_backend_hpe3par_iscsi_spec.rb @@ -5,13 +5,14 @@ describe 'cinder::backend::hpe3par_iscsi' do let :req_params do { - :hpe3par_api_url => 'https://172.0.0.2:8080/api/v1', - :hpe3par_username => '3paradm', - :hpe3par_password => 'password', - :hpe3par_iscsi_ips => '172.0.0.3', - :san_ip => '172.0.0.2', - :san_login => '3paradm', - :san_password => 'password', + :backend_availability_zone => 'my_zone', + :hpe3par_api_url => 'https://172.0.0.2:8080/api/v1', + :hpe3par_username => '3paradm', + :hpe3par_password => 'password', + :hpe3par_iscsi_ips => '172.0.0.3', + :san_ip => '172.0.0.2', + :san_login => '3paradm', + :san_password => 'password', } end @@ -22,6 +23,7 @@ describe 'cinder::backend::hpe3par_iscsi' do describe 'hpe3par_iscsi volume driver' do it 'configure hpe3par_iscsi volume driver' do is_expected.to contain_cinder_config('hpe3par_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_3par_iscsi.HPE3PARISCSIDriver') + is_expected.to contain_cinder_config('hpe3par_iscsi/backend_availability_zone').with_value('my_zone') is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_api_url').with_value('https://172.0.0.2:8080/api/v1') is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_username').with_value('3paradm') is_expected.to contain_cinder_config('hpe3par_iscsi/hpe3par_password').with_value('password') diff --git a/spec/defines/cinder_backend_hpelefthand_iscsi_spec.rb b/spec/defines/cinder_backend_hpelefthand_iscsi_spec.rb index 587a52dd..0654cb5d 100644 --- a/spec/defines/cinder_backend_hpelefthand_iscsi_spec.rb +++ b/spec/defines/cinder_backend_hpelefthand_iscsi_spec.rb @@ -5,10 +5,11 @@ describe 'cinder::backend::hpelefthand_iscsi' do let :req_params do { - :hpelefthand_api_url => 'https://10.206.219.18:8081/lhos', - :hpelefthand_username => 'admin', - :hpelefthand_password => 'password', - :hpelefthand_clustername => 'nfvsys_clust_001', + :backend_availability_zone => 'my_zone', + :hpelefthand_api_url => 'https://10.206.219.18:8081/lhos', + :hpelefthand_username => 'admin', + :hpelefthand_password => 'password', + :hpelefthand_clustername => 'nfvsys_clust_001', } end @@ -19,6 +20,7 @@ describe 'cinder::backend::hpelefthand_iscsi' do describe 'hpelefthand_iscsi volume driver' do it 'configure hpelefthand_iscsi volume driver' do is_expected.to contain_cinder_config('hpelefthand_iscsi/volume_driver').with_value('cinder.volume.drivers.hpe.hpe_lefthand_iscsi.HPELeftHandISCSIDriver') + is_expected.to contain_cinder_config('hpelefthand_iscsi/backend_availability_zone').with_value('my_zone') is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_api_url').with_value('https://10.206.219.18:8081/lhos') is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_username').with_value('admin') is_expected.to contain_cinder_config('hpelefthand_iscsi/hpelefthand_password').with_value('password') diff --git a/spec/defines/cinder_backend_iscsi_spec.rb b/spec/defines/cinder_backend_iscsi_spec.rb index 68fc6e56..056cb9e9 100644 --- a/spec/defines/cinder_backend_iscsi_spec.rb +++ b/spec/defines/cinder_backend_iscsi_spec.rb @@ -31,6 +31,8 @@ describe 'cinder::backend::iscsi' do it 'should configure iscsi driver' do is_expected.to contain_cinder_config('hippo/volume_backend_name').with( :value => 'hippo') + is_expected.to contain_cinder_config('hippo/backend_availability_zone').with( + :value => '') is_expected.to contain_cinder_config('hippo/volume_driver').with( :value => 'cinder.volume.drivers.lvm.LVMVolumeDriver') is_expected.to contain_cinder_config('hippo/iscsi_ip_address').with( diff --git a/spec/defines/cinder_backend_netapp_spec.rb b/spec/defines/cinder_backend_netapp_spec.rb index e29a37f8..32209d17 100644 --- a/spec/defines/cinder_backend_netapp_spec.rb +++ b/spec/defines/cinder_backend_netapp_spec.rb @@ -11,6 +11,7 @@ describe 'cinder::backend::netapp' do let :params do { :volume_backend_name => 'netapp-cdot-nfs', + :backend_availability_zone => 'my_zone', :netapp_login => 'netapp', :netapp_password => 'password', :netapp_server_hostname => '127.0.0.2', @@ -25,6 +26,7 @@ describe 'cinder::backend::netapp' do let :default_params do { + :backend_availability_zone => '', :netapp_server_port => '80', :netapp_size_multiplier => '1.2', :netapp_storage_family => 'ontap_cluster', diff --git a/spec/defines/cinder_backend_nexenta_edge_spec.rb b/spec/defines/cinder_backend_nexenta_edge_spec.rb index 6d22d452..6bdc084c 100644 --- a/spec/defines/cinder_backend_nexenta_edge_spec.rb +++ b/spec/defines/cinder_backend_nexenta_edge_spec.rb @@ -11,11 +11,13 @@ describe 'cinder::backend::nexenta_edge' do end let :default_params do - { :nexenta_rest_port => '8080', - :nexenta_lun_container => 'cinder', - :nexenta_iscsi_service => 'cinder', - :nexenta_chunksize => '32768', - :volume_driver => 'cinder.volume.drivers.nexenta.nexentaedge.iscsi.NexentaEdgeISCSIDriver' } + { :nexenta_rest_port => '8080', + :nexenta_lun_container => 'cinder', + :nexenta_iscsi_service => 'cinder', + :nexenta_chunksize => '32768', + :volume_driver => 'cinder.volume.drivers.nexenta.nexentaedge.iscsi.NexentaEdgeISCSIDriver', + :backend_availability_zone => '', + } end let :facts do diff --git a/spec/defines/cinder_backend_nexenta_spec.rb b/spec/defines/cinder_backend_nexenta_spec.rb index 0e467961..a2a4789f 100644 --- a/spec/defines/cinder_backend_nexenta_spec.rb +++ b/spec/defines/cinder_backend_nexenta_spec.rb @@ -19,7 +19,9 @@ describe 'cinder::backend::nexenta' do :nexenta_blocksize => '8192', :nexenta_sparse => true, :nexenta_rest_port => '8457', - :volume_driver => 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver' } + :volume_driver => 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver', + :backend_availability_zone => '', + } end let :facts do diff --git a/spec/defines/cinder_backend_nfs_spec.rb b/spec/defines/cinder_backend_nfs_spec.rb index 7d7dba50..4c858d2c 100644 --- a/spec/defines/cinder_backend_nfs_spec.rb +++ b/spec/defines/cinder_backend_nfs_spec.rb @@ -6,6 +6,7 @@ describe 'cinder::backend::nfs' do let :params do { + :backend_availability_zone => 'my_zone', :nfs_servers => ['10.10.10.10:/shares', '10.10.10.10:/shares2'], :nfs_mount_attempts => '4', :nfs_mount_options => 'vers=3', @@ -27,6 +28,8 @@ describe 'cinder::backend::nfs' do it 'configures nfs volume driver' do is_expected.to contain_cinder_config('hippo/volume_backend_name').with( :value => 'hippo') + is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value( + 'my_zone') is_expected.to contain_cinder_config('hippo/volume_driver').with_value( 'cinder.volume.drivers.nfs.NfsDriver') is_expected.to contain_cinder_config('hippo/nfs_shares_config').with_value( diff --git a/spec/defines/cinder_backend_nvmeof_spec.rb b/spec/defines/cinder_backend_nvmeof_spec.rb index 6aa66459..c66ae0c5 100644 --- a/spec/defines/cinder_backend_nvmeof_spec.rb +++ b/spec/defines/cinder_backend_nvmeof_spec.rb @@ -37,6 +37,8 @@ describe 'cinder::backend::nvmeof' do :value => '10') is_expected.to contain_cinder_config('nvme-backend/volume_backend_name').with( :value => 'nvme-backend') + is_expected.to contain_cinder_config('nvme-backend/backend_availability_zone').with( + :value => '') is_expected.to contain_cinder_config('nvme-backend/volume_driver').with( :value => 'cinder.volume.drivers.lvm.LVMVolumeDriver') end diff --git a/spec/defines/cinder_backend_pure_spec.rb b/spec/defines/cinder_backend_pure_spec.rb index c182e4e1..30c18256 100644 --- a/spec/defines/cinder_backend_pure_spec.rb +++ b/spec/defines/cinder_backend_pure_spec.rb @@ -27,13 +27,15 @@ describe 'cinder::backend::pure' do describe 'pure iscsi volume driver' do let :params do req_params.merge({ - 'pure_storage_protocol' => 'iSCSI', - 'use_chap_auth' => 'true' + 'backend_availability_zone' => 'my_zone', + 'pure_storage_protocol' => 'iSCSI', + 'use_chap_auth' => 'true', }) end it 'configure pure volume driver' do is_expected.to contain_cinder_config('pure/volume_driver').with_value('cinder.volume.drivers.pure.PureISCSIDriver') + is_expected.to contain_cinder_config('pure/backend_availability_zone').with_value('my_zone') is_expected.to contain_cinder_config('pure/san_ip').with_value('127.0.0.2') is_expected.to contain_cinder_config('pure/pure_api_token').with_value('abc123def456ghi789') is_expected.to contain_cinder_config('pure/use_multipath_for_image_xfer').with_value('true') diff --git a/spec/defines/cinder_backend_quobyte_spec.rb b/spec/defines/cinder_backend_quobyte_spec.rb index c241dc3e..c6f678d3 100644 --- a/spec/defines/cinder_backend_quobyte_spec.rb +++ b/spec/defines/cinder_backend_quobyte_spec.rb @@ -7,9 +7,10 @@ describe 'cinder::backend::quobyte' do let :params do { - :quobyte_volume_url => 'quobyte://quobyte.cluster.example.com/volume-name', - :quobyte_qcow2_volumes => false, - :quobyte_sparsed_volumes => true, + :quobyte_volume_url => 'quobyte://quobyte.cluster.example.com/volume-name', + :quobyte_qcow2_volumes => false, + :quobyte_sparsed_volumes => true, + :backend_availability_zone => 'my_zone', } end @@ -22,6 +23,8 @@ describe 'cinder::backend::quobyte' do false) is_expected.to contain_cinder_config('myquobyte/quobyte_sparsed_volumes').with_value( true) + is_expected.to contain_cinder_config('myquobyte/backend_availability_zone').with_value( + 'my_zone') end context 'quobyte backend with cinder type' do diff --git a/spec/defines/cinder_backend_rbd_spec.rb b/spec/defines/cinder_backend_rbd_spec.rb index 30658702..bc39db4f 100644 --- a/spec/defines/cinder_backend_rbd_spec.rb +++ b/spec/defines/cinder_backend_rbd_spec.rb @@ -84,15 +84,22 @@ describe 'cinder::backend::rbd' do end end - context 'override backend_host parameter' do + context 'override backend_host and backend_availability_zone parameters' do before do - params.merge!({:backend_host => 'test_host.fqdn.com' }) + params.merge!( + { + :backend_host => 'test_host.fqdn.com', + :backend_availability_zone => 'my_zone', + }) end - it 'configure rbd backend with specific hostname' do + it 'configure rbd backend with specific hostname and availability zone' do is_expected.to contain_cinder_config('rbd-ssd/backend_host').with({ :value => 'test_host.fqdn.com', }) + is_expected.to contain_cinder_config('rbd-ssd/backend_availability_zone').with({ + :value => 'my_zone', + }) end end diff --git a/spec/defines/cinder_backend_san_spec.rb b/spec/defines/cinder_backend_san_spec.rb index 3e5208ba..71a90f31 100644 --- a/spec/defines/cinder_backend_san_spec.rb +++ b/spec/defines/cinder_backend_san_spec.rb @@ -4,11 +4,14 @@ describe 'cinder::backend::san' do let (:title) { 'mysan' } let :params do - { :volume_driver => 'cinder.volume.san.SolarisISCSIDriver', - :san_ip => '127.0.0.1', - :san_login => 'cluster_operator', - :san_password => '007', - :san_clustername => 'storage_cluster' } + { + :backend_availability_zone => 'my_zone', + :volume_driver => 'cinder.volume.san.SolarisISCSIDriver', + :san_ip => '127.0.0.1', + :san_login => 'cluster_operator', + :san_password => '007', + :san_clustername => 'storage_cluster', + } end let :default_params do diff --git a/spec/defines/cinder_backend_scaleio_spec.rb b/spec/defines/cinder_backend_scaleio_spec.rb index d2b420bf..2196b164 100644 --- a/spec/defines/cinder_backend_scaleio_spec.rb +++ b/spec/defines/cinder_backend_scaleio_spec.rb @@ -16,6 +16,7 @@ describe 'cinder::backend::scaleio' do let :params2 do { + :backend_availability_zone => 'my_zone', :sio_server_certificate_path => '/path/cert.pem', :sio_max_over_subscription_ratio => '6.0', :sio_verify_server_certificate => true, diff --git a/spec/defines/cinder_backend_solidfire_spec.rb b/spec/defines/cinder_backend_solidfire_spec.rb index c3afd626..ee77457e 100644 --- a/spec/defines/cinder_backend_solidfire_spec.rb +++ b/spec/defines/cinder_backend_solidfire_spec.rb @@ -15,6 +15,7 @@ describe 'cinder::backend::solidfire' do let :other_params do { + :backend_availability_zone => '', :sf_emulate_512 => '', :sf_allow_tenant_qos => '', :sf_account_prefix => '', diff --git a/spec/defines/cinder_backend_veritas_hyperscale_spec.rb b/spec/defines/cinder_backend_veritas_hyperscale_spec.rb index 811acb07..9960abda 100644 --- a/spec/defines/cinder_backend_veritas_hyperscale_spec.rb +++ b/spec/defines/cinder_backend_veritas_hyperscale_spec.rb @@ -5,7 +5,8 @@ describe 'cinder::backend::veritas_hyperscale' do let (:title) { 'Veritas_HyperScale' } let :params do { - :manage_volume_type => true, + :backend_availability_zone => 'my_zone', + :manage_volume_type => true, } end @@ -15,6 +16,8 @@ describe 'cinder::backend::veritas_hyperscale' do 'cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver') should contain_cinder_config("#{title}/volume_backend_name").with_value( "#{title}") + should contain_cinder_config("#{title}/backend_availability_zone").with_value( + 'my_zone') should contain_cinder_config("#{title}/image_volume_cache_enabled").with_value( true) end diff --git a/spec/defines/cinder_backend_vmdk_spec.rb b/spec/defines/cinder_backend_vmdk_spec.rb index 3bf75b54..09e8e547 100644 --- a/spec/defines/cinder_backend_vmdk_spec.rb +++ b/spec/defines/cinder_backend_vmdk_spec.rb @@ -26,6 +26,7 @@ describe 'cinder::backend::vmdk' do :max_object_retrieval => 200, :task_poll_interval => 10, :image_transfer_timeout_secs => 3600, + :backend_availability_zone => 'my_zone', :wsdl_location => 'http://127.0.0.1:8080/vmware/SDK/wsdl/vim25/vimService.wsdl' } end @@ -42,6 +43,7 @@ describe 'cinder::backend::vmdk' do 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_wsdl_location').with_value('') + is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value('') end it 'installs suds python package' do @@ -55,12 +57,14 @@ describe 'cinder::backend::vmdk' do end it 'should configure vmdk driver in cinder.conf' do + is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value(params[:backend_availability_zone]) is_expected.to contain_cinder_config('hippo/vmware_volume_folder').with_value(params[:volume_folder]) 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(params[:task_poll_interval]) 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_wsdl_location').with_value(params[:wsdl_location]) + is_expected.to contain_cinder_config('hippo/backend_availability_zone').with_value(params[:backend_availability_zone]) is_expected.to contain_cinder_config('hippo/host').with_value("vmdk:#{params[:host_ip]}-#{params[:volume_folder]}") end end diff --git a/spec/defines/cinder_backend_vstorage_spec.rb b/spec/defines/cinder_backend_vstorage_spec.rb index 77879b92..eb4cbbdf 100644 --- a/spec/defines/cinder_backend_vstorage_spec.rb +++ b/spec/defines/cinder_backend_vstorage_spec.rb @@ -6,23 +6,26 @@ describe 'cinder::backend::vstorage' do let :params do { - :cluster_name => 'stor1', - :cluster_password => 'passw0rd', - :shares_config_path => '/etc/cinder/vstorage_shares.conf', - :use_sparsed_volumes => true, - :used_ratio => '0.9', - :mount_point_base => '/vstorage', - :default_volume_format => 'ploop', - :mount_user => 'cinder', - :mount_group => 'root', - :mount_permissions => '0770', - :manage_package => true, + :cluster_name => 'stor1', + :cluster_password => 'passw0rd', + :backend_availability_zone => 'my_zone', + :shares_config_path => '/etc/cinder/vstorage_shares.conf', + :use_sparsed_volumes => true, + :used_ratio => '0.9', + :mount_point_base => '/vstorage', + :default_volume_format => 'ploop', + :mount_user => 'cinder', + :mount_group => 'root', + :mount_permissions => '0770', + :manage_package => true, } end it 'configures vstorage volume driver' do is_expected.to contain_cinder_config('vstorage/volume_backend_name').with( :value => 'vstorage') + is_expected.to contain_cinder_config('vstorage/backend_availability_zone').with_value( + 'my_zone') is_expected.to contain_cinder_config('vstorage/volume_driver').with_value( 'cinder.volume.drivers.vzstorage.VZStorageDriver') is_expected.to contain_cinder_config('vstorage/vzstorage_shares_config').with_value(