Add support for cinder backend availability zones

Add the ability to override the "backend_availability_zone" parameter
in every cinder volume backend.

Implements: blueprint split-controlplane-cinder-volume-az
Depends-On: I11821a38d8ba5afc594b3d601cd1634207a6f093
Change-Id: Ic407b747474b567858ad36beabc8a7d8c5022343
This commit is contained in:
Alan Bishop 2018-10-03 14:17:56 -04:00
parent 89dab0c7e0
commit ab13b5dc80
20 changed files with 184 additions and 94 deletions

View File

@ -35,12 +35,13 @@ class tripleo::profile::base::cinder::volume::dellemc_unity (
if $step >= 4 { if $step >= 4 {
cinder::backend::dellemc_unity { $backend_name : cinder::backend::dellemc_unity { $backend_name :
san_ip => hiera('cinder::backend::dellemc_unity::san_ip', undef), backend_availability_zone => hiera('cinder::backend::dellemc_unity::backend_availability_zone', undef),
san_login => hiera('cinder::backend::dellemc_unity::san_login', undef), san_ip => hiera('cinder::backend::dellemc_unity::san_ip', undef),
san_password => hiera('cinder::backend::dellemc_unity::san_password', undef), san_login => hiera('cinder::backend::dellemc_unity::san_login', undef),
storage_protocol => hiera('cinder::backend::dellemc_unity::storage_protocol', undef), san_password => hiera('cinder::backend::dellemc_unity::san_password', undef),
unity_io_ports => hiera('cinder::backend::dellemc_unity::unity_io_ports', undef), storage_protocol => hiera('cinder::backend::dellemc_unity::storage_protocol', undef),
unity_storage_pool_names => hiera('cinder::backend::dellemc_unity::unity_storage_pool_names', undef), unity_io_ports => hiera('cinder::backend::dellemc_unity::unity_io_ports', undef),
unity_storage_pool_names => hiera('cinder::backend::dellemc_unity::unity_storage_pool_names', undef),
} }
} }

View File

@ -35,7 +35,8 @@ class tripleo::profile::base::cinder::volume::dellemc_vmax_iscsi (
if $step >= 4 { if $step >= 4 {
cinder::backend::dellemc_vmax_iscsi { $backend_name : cinder::backend::dellemc_vmax_iscsi { $backend_name :
cinder_emc_config_file => hiera('cinder::backend::dellemc_vmax_iscsi::cinder_emc_config_file', undef), backend_availability_zone => hiera('cinder::backend::dellemc_vmax_iscsi::backend_availability_zone', undef),
cinder_emc_config_file => hiera('cinder::backend::dellemc_vmax_iscsi::cinder_emc_config_file', undef),
} }
} }

View File

@ -40,6 +40,7 @@ class tripleo::profile::base::cinder::volume::dellemc_vnx (
undef))) undef)))
cinder::backend::emc_vnx { $backend_name : cinder::backend::emc_vnx { $backend_name :
backend_availability_zone => hiera('cinder::backend::emc_vnx::backend_availability_zone', undef),
san_ip => hiera('cinder::backend::emc_vnx::san_ip', undef), san_ip => hiera('cinder::backend::emc_vnx::san_ip', undef),
san_login => hiera('cinder::backend::emc_vnx::san_login', undef), san_login => hiera('cinder::backend::emc_vnx::san_login', undef),
san_password => hiera('cinder::backend::emc_vnx::san_password', undef), san_password => hiera('cinder::backend::emc_vnx::san_password', undef),
@ -51,7 +52,6 @@ class tripleo::profile::base::cinder::volume::dellemc_vnx (
storage_vnx_auth_type => hiera('cinder::backend::emc_vnx::storage_vnx_auth_type', undef), storage_vnx_auth_type => hiera('cinder::backend::emc_vnx::storage_vnx_auth_type', undef),
storage_vnx_security_file_dir => hiera('cinder::backend::emc_vnx::storage_vnx_security_file_dir', undef), storage_vnx_security_file_dir => hiera('cinder::backend::emc_vnx::storage_vnx_security_file_dir', undef),
naviseccli_path => hiera('cinder::backend::emc_vnx::naviseccli_path', undef), naviseccli_path => hiera('cinder::backend::emc_vnx::naviseccli_path', undef),
} }
} }

View File

@ -35,6 +35,7 @@ class tripleo::profile::base::cinder::volume::dellemc_xtremio_iscsi (
if $step >= 4 { if $step >= 4 {
cinder::backend::dellemc_xtremio_iscsi { $backend_name : cinder::backend::dellemc_xtremio_iscsi { $backend_name :
backend_availability_zone => hiera('cinder::backend::dellemc_xtremio_iscsi::backend_availability_zone', undef),
san_ip => hiera('cinder::backend::dellemc_xtremio_iscsi::san_ip', undef), san_ip => hiera('cinder::backend::dellemc_xtremio_iscsi::san_ip', undef),
san_login => hiera('cinder::backend::dellemc_xtremio_iscsi::san_login', undef), san_login => hiera('cinder::backend::dellemc_xtremio_iscsi::san_login', undef),
san_password => hiera('cinder::backend::dellemc_xtremio_iscsi::san_password', undef), san_password => hiera('cinder::backend::dellemc_xtremio_iscsi::san_password', undef),

View File

@ -35,16 +35,17 @@ class tripleo::profile::base::cinder::volume::dellps (
if $step >= 4 { if $step >= 4 {
cinder::backend::eqlx { $backend_name : cinder::backend::eqlx { $backend_name :
san_ip => hiera('cinder::backend::eqlx::san_ip', undef), backend_availability_zone => hiera('cinder::backend::eqlx::backend_availability_zone', undef),
san_login => hiera('cinder::backend::eqlx::san_login', undef), san_ip => hiera('cinder::backend::eqlx::san_ip', undef),
san_password => hiera('cinder::backend::eqlx::san_password', undef), san_login => hiera('cinder::backend::eqlx::san_login', undef),
san_private_key => hiera('cinder::backend::eqlx::san_private_key', undef), san_password => hiera('cinder::backend::eqlx::san_password', undef),
san_thin_provision => hiera('cinder::backend::eqlx::san_thin_provision', undef), san_private_key => hiera('cinder::backend::eqlx::san_private_key', undef),
eqlx_group_name => hiera('cinder::backend::eqlx::eqlx_group_name', undef), san_thin_provision => hiera('cinder::backend::eqlx::san_thin_provision', undef),
eqlx_pool => hiera('cinder::backend::eqlx::eqlx_pool', undef), eqlx_group_name => hiera('cinder::backend::eqlx::eqlx_group_name', undef),
use_chap_auth => hiera('cinder::backend::eqlx::eqlx_use_chap', undef), eqlx_pool => hiera('cinder::backend::eqlx::eqlx_pool', undef),
chap_username => hiera('cinder::backend::eqlx::eqlx_chap_login', undef), use_chap_auth => hiera('cinder::backend::eqlx::eqlx_use_chap', undef),
chap_password => hiera('cinder::backend::eqlx::eqlx_chap_password', undef), chap_username => hiera('cinder::backend::eqlx::eqlx_chap_login', undef),
chap_password => hiera('cinder::backend::eqlx::eqlx_chap_password', undef),
} }
} }

View File

@ -44,21 +44,22 @@ class tripleo::profile::base::cinder::volume::dellsc (
} }
cinder::backend::dellsc_iscsi { $backend_name : cinder::backend::dellsc_iscsi { $backend_name :
san_ip => hiera('cinder::backend::dellsc_iscsi::san_ip', undef), backend_availability_zone => hiera('cinder::backend::dellsc_iscsi::backend_availability_zone', undef),
san_login => hiera('cinder::backend::dellsc_iscsi::san_login', undef), san_ip => hiera('cinder::backend::dellsc_iscsi::san_ip', undef),
san_password => hiera('cinder::backend::dellsc_iscsi::san_password', undef), san_login => hiera('cinder::backend::dellsc_iscsi::san_login', undef),
dell_sc_ssn => hiera('cinder::backend::dellsc_iscsi::dell_sc_ssn', undef), san_password => hiera('cinder::backend::dellsc_iscsi::san_password', undef),
iscsi_ip_address => hiera('cinder::backend::dellsc_iscsi::iscsi_ip_address', undef), dell_sc_ssn => hiera('cinder::backend::dellsc_iscsi::dell_sc_ssn', undef),
iscsi_port => hiera('cinder::backend::dellsc_iscsi::iscsi_port', undef), iscsi_ip_address => hiera('cinder::backend::dellsc_iscsi::iscsi_ip_address', undef),
dell_sc_api_port => hiera('cinder::backend::dellsc_iscsi::dell_sc_api_port', undef), iscsi_port => hiera('cinder::backend::dellsc_iscsi::iscsi_port', undef),
dell_sc_server_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_server_folder', undef), dell_sc_api_port => hiera('cinder::backend::dellsc_iscsi::dell_sc_api_port', undef),
dell_sc_volume_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_volume_folder', undef), dell_sc_server_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_server_folder', undef),
excluded_domain_ip => $excluded_domain_ip_real, dell_sc_volume_folder => hiera('cinder::backend::dellsc_iscsi::dell_sc_volume_folder', undef),
excluded_domain_ips => hiera('cinder::backend::dellsc_iscsi::excluded_domain_ips', undef), excluded_domain_ip => $excluded_domain_ip_real,
secondary_san_ip => hiera('cinder::backend::dellsc_iscsi::secondary_san_ip', undef), excluded_domain_ips => hiera('cinder::backend::dellsc_iscsi::excluded_domain_ips', undef),
secondary_san_login => hiera('cinder::backend::dellsc_iscsi::secondary_san_login', undef), secondary_san_ip => hiera('cinder::backend::dellsc_iscsi::secondary_san_ip', undef),
secondary_san_password => hiera('cinder::backend::dellsc_iscsi::secondary_san_password', undef), secondary_san_login => hiera('cinder::backend::dellsc_iscsi::secondary_san_login', undef),
secondary_sc_api_port => hiera('cinder::backend::dellsc_iscsi::secondary_sc_api_port', undef), secondary_san_password => hiera('cinder::backend::dellsc_iscsi::secondary_san_password', undef),
secondary_sc_api_port => hiera('cinder::backend::dellsc_iscsi::secondary_sc_api_port', undef),
} }
} }

View File

@ -22,6 +22,10 @@
# (Optional) Name given to the Cinder backend stanza # (Optional) Name given to the Cinder backend stanza
# Defaults to 'tripleo_hpelefthand' # Defaults to 'tripleo_hpelefthand'
# #
# [*backend_availability_zone*]
# (Optional) Availability zone for this volume backend
# Defaults to hiera('cinder::backend::hpelefthand_iscsi::backend_availability_zone', undef)
#
# [*cinder_hpelefthand_api_url*] # [*cinder_hpelefthand_api_url*]
# (required) url for api access to lefthand - example https://10.x.x.x:8080/api/v1 # (required) url for api access to lefthand - example https://10.x.x.x:8080/api/v1
# #
@ -47,6 +51,7 @@
# #
class tripleo::profile::base::cinder::volume::hpelefthand ( class tripleo::profile::base::cinder::volume::hpelefthand (
$backend_name = hiera('cinder::backend::hpelefthand_iscsi::volume_backend_name', 'tripleo_hpelefthand'), $backend_name = hiera('cinder::backend::hpelefthand_iscsi::volume_backend_name', 'tripleo_hpelefthand'),
$backend_availability_zone = hiera('cinder::backend::hpelefthand_iscsi::backend_availability_zone', undef),
$cinder_hpelefthand_username = hiera('cinder::backend::hpelefthand_iscsi::hpelefthand_username', undef), $cinder_hpelefthand_username = hiera('cinder::backend::hpelefthand_iscsi::hpelefthand_username', undef),
$cinder_hpelefthand_password = hiera('cinder::backend::hpelefthand_iscsi::hpelefthand_password', undef), $cinder_hpelefthand_password = hiera('cinder::backend::hpelefthand_iscsi::hpelefthand_password', undef),
$cinder_hpelefthand_clustername = hiera('cinder::backend::hpelefthand_iscsi::hpelefthand_clustername', undef), $cinder_hpelefthand_clustername = hiera('cinder::backend::hpelefthand_iscsi::hpelefthand_clustername', undef),
@ -59,6 +64,7 @@ class tripleo::profile::base::cinder::volume::hpelefthand (
if $step >= 4 { if $step >= 4 {
cinder::backend::hpelefthand_iscsi { $backend_name : cinder::backend::hpelefthand_iscsi { $backend_name :
backend_availability_zone => $backend_availability_zone,
hpelefthand_username => $cinder_hpelefthand_username, hpelefthand_username => $cinder_hpelefthand_username,
hpelefthand_password => $cinder_hpelefthand_password, hpelefthand_password => $cinder_hpelefthand_password,
hpelefthand_clustername => $cinder_hpelefthand_clustername, hpelefthand_clustername => $cinder_hpelefthand_clustername,

View File

@ -25,6 +25,10 @@
# (Optional) Name given to the Cinder backend stanza # (Optional) Name given to the Cinder backend stanza
# Defaults to 'tripleo_iscsi' # Defaults to 'tripleo_iscsi'
# #
# [*backend_availability_zone*]
# (Optional) Availability zone for this volume backend
# Defaults to hiera('cinder::backend::iscsi::backend_availability_zone', undef)
#
# [*cinder_iscsi_helper*] # [*cinder_iscsi_helper*]
# (Optional) The iscsi helper to use # (Optional) The iscsi helper to use
# Defaults to 'tgtadm' # Defaults to 'tgtadm'
@ -45,6 +49,7 @@
class tripleo::profile::base::cinder::volume::iscsi ( class tripleo::profile::base::cinder::volume::iscsi (
$cinder_iscsi_address, $cinder_iscsi_address,
$backend_name = hiera('cinder::backend::iscsi::volume_backend_name', 'tripleo_iscsi'), $backend_name = hiera('cinder::backend::iscsi::volume_backend_name', 'tripleo_iscsi'),
$backend_availability_zone = hiera('cinder::backend::iscsi::backend_availability_zone', undef),
$cinder_iscsi_helper = 'tgtadm', $cinder_iscsi_helper = 'tgtadm',
$cinder_iscsi_protocol = 'iscsi', $cinder_iscsi_protocol = 'iscsi',
$cinder_lvm_loop_device_size = '10280', $cinder_lvm_loop_device_size = '10280',
@ -61,9 +66,10 @@ class tripleo::profile::base::cinder::volume::iscsi (
# key: [ipv6] # key: [ipv6]
# as it will cause hiera parsing errors # as it will cause hiera parsing errors
cinder::backend::iscsi { $backend_name : cinder::backend::iscsi { $backend_name :
iscsi_ip_address => normalize_ip_for_uri($cinder_iscsi_address), backend_availability_zone => $backend_availability_zone,
iscsi_helper => $cinder_iscsi_helper, iscsi_ip_address => normalize_ip_for_uri($cinder_iscsi_address),
iscsi_protocol => $cinder_iscsi_protocol, iscsi_helper => $cinder_iscsi_helper,
iscsi_protocol => $cinder_iscsi_protocol,
} }
} }

View File

@ -50,6 +50,7 @@ class tripleo::profile::base::cinder::volume::netapp (
$netapp_pool_name_search_pattern_fallback = undef $netapp_pool_name_search_pattern_fallback = undef
} }
cinder::backend::netapp { $backend_name : cinder::backend::netapp { $backend_name :
backend_availability_zone => hiera('cinder::backend::netapp::backend_availability_zone', undef),
netapp_login => hiera('cinder::backend::netapp::netapp_login', undef), netapp_login => hiera('cinder::backend::netapp::netapp_login', undef),
netapp_password => hiera('cinder::backend::netapp::netapp_password', undef), netapp_password => hiera('cinder::backend::netapp::netapp_password', undef),
netapp_server_hostname => hiera('cinder::backend::netapp::netapp_server_hostname', undef), netapp_server_hostname => hiera('cinder::backend::netapp::netapp_server_hostname', undef),

View File

@ -25,6 +25,10 @@
# (Optional) Name given to the Cinder backend stanza # (Optional) Name given to the Cinder backend stanza
# Defaults to 'tripleo_nfs' # Defaults to 'tripleo_nfs'
# #
# [*backend_availability_zone*]
# (Optional) Availability zone for this volume backend
# Defaults to hiera('cinder::backend::nfs::backend_availability_zone', undef)
#
# [*cinder_nfs_mount_options*] # [*cinder_nfs_mount_options*]
# (Optional) List of mount options for the NFS share # (Optional) List of mount options for the NFS share
# Defaults to '' # Defaults to ''
@ -54,6 +58,7 @@
class tripleo::profile::base::cinder::volume::nfs ( class tripleo::profile::base::cinder::volume::nfs (
$cinder_nfs_servers, $cinder_nfs_servers,
$backend_name = hiera('cinder::backend::nfs::volume_backend_name', 'tripleo_nfs'), $backend_name = hiera('cinder::backend::nfs::volume_backend_name', 'tripleo_nfs'),
$backend_availability_zone = hiera('cinder::backend::nfs::backend_availability_zone', undef),
$cinder_nfs_mount_options = '', $cinder_nfs_mount_options = '',
$cinder_nas_secure_file_operations = $::os_service_default, $cinder_nas_secure_file_operations = $::os_service_default,
$cinder_nas_secure_file_permissions = $::os_service_default, $cinder_nas_secure_file_permissions = $::os_service_default,
@ -64,6 +69,7 @@ class tripleo::profile::base::cinder::volume::nfs (
if $step >= 4 { if $step >= 4 {
package {'nfs-utils': } package {'nfs-utils': }
-> cinder::backend::nfs { $backend_name : -> cinder::backend::nfs { $backend_name :
backend_availability_zone => $backend_availability_zone,
nfs_servers => $cinder_nfs_servers, nfs_servers => $cinder_nfs_servers,
nfs_mount_options => $cinder_nfs_mount_options, nfs_mount_options => $cinder_nfs_mount_options,
nfs_shares_config => '/etc/cinder/shares-nfs.conf', nfs_shares_config => '/etc/cinder/shares-nfs.conf',

View File

@ -33,6 +33,10 @@
# (Optional) Name given to the Cinder backend # (Optional) Name given to the Cinder backend
# Defaults to 'tripleo_nvmeof' # Defaults to 'tripleo_nvmeof'
# #
# [*backend_availability_zone*]
# (Optional) Availability zone for this volume backend
# Defaults to hiera('cinder::backend::nvmeof::backend_availability_zone', undef)
#
# [*volume_driver*] # [*volume_driver*]
# (Optional) Driver to use for volume creation # (Optional) Driver to use for volume creation
# Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver' # Defaults to 'cinder.volume.drivers.lvm.LVMVolumeDriver'
@ -47,26 +51,28 @@ class tripleo::profile::base::cinder::volume::nvmeof (
$target_port, $target_port,
$target_helper, $target_helper,
$target_protocol, $target_protocol,
$target_prefix = 'nvme-subsystem', $target_prefix = 'nvme-subsystem',
$nvmet_port_id = '1', $nvmet_port_id = '1',
$nvmet_ns_id = '10', $nvmet_ns_id = '10',
$volume_backend_name = hiera('cinder::backend::nvmeof::volume_backend_name', 'tripleo_nvmeof'), $volume_backend_name = hiera('cinder::backend::nvmeof::volume_backend_name', 'tripleo_nvmeof'),
$volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', $backend_availability_zone = hiera('cinder::backend::nvmeof::backend_availability_zone', undef),
$step = Integer(hiera('step')), $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver',
$step = Integer(hiera('step')),
) { ) {
include ::tripleo::profile::base::cinder::volume include ::tripleo::profile::base::cinder::volume
if $step >= 4 { if $step >= 4 {
cinder::backend::nvmeof { $volume_backend_name : cinder::backend::nvmeof { $volume_backend_name :
target_ip_address => normalize_ip_for_uri($target_ip_address), target_ip_address => normalize_ip_for_uri($target_ip_address),
target_port => $target_port, target_port => $target_port,
target_helper => $target_helper, target_helper => $target_helper,
target_protocol => $target_protocol, target_protocol => $target_protocol,
target_prefix => $target_prefix, target_prefix => $target_prefix,
nvmet_port_id => $nvmet_port_id, nvmet_port_id => $nvmet_port_id,
nvmet_ns_id => $nvmet_ns_id, nvmet_ns_id => $nvmet_ns_id,
volume_backend_name => $volume_backend_name, volume_backend_name => $volume_backend_name,
volume_driver => $volume_driver, backend_availability_zone => $backend_availability_zone,
volume_driver => $volume_driver,
} }
} }

View File

@ -54,6 +54,7 @@ class tripleo::profile::base::cinder::volume::pure (
if $step >= 4 { if $step >= 4 {
cinder::backend::pure { $backend_name : cinder::backend::pure { $backend_name :
backend_availability_zone => hiera('cinder::backend::pure::backend_availability_zone', undef),
san_ip => hiera('cinder::backend::pure::san_ip', undef), san_ip => hiera('cinder::backend::pure::san_ip', undef),
pure_api_token => hiera('cinder::backend::pure::pure_api_token', undef), pure_api_token => hiera('cinder::backend::pure::pure_api_token', undef),
pure_storage_protocol => hiera('cinder::backend::pure::pure_storage_protocol', undef), pure_storage_protocol => hiera('cinder::backend::pure::pure_storage_protocol', undef),

View File

@ -22,6 +22,10 @@
# (Optional) Name given to the Cinder backend stanza # (Optional) Name given to the Cinder backend stanza
# Defaults to 'tripleo_ceph' # Defaults to 'tripleo_ceph'
# #
# [*backend_availability_zone*]
# (Optional) Availability zone for this volume backend
# Defaults to hiera('cinder::backend::rbd::backend_availability_zone', undef)
#
# [*cinder_rbd_backend_host*] # [*cinder_rbd_backend_host*]
# (Optional) String to use as backend_host in the backend stanza # (Optional) String to use as backend_host in the backend stanza
# Defaults to hiera('cinder::backend_host', hiera('cinder::host', 'hostgroup')) # Defaults to hiera('cinder::backend_host', hiera('cinder::host', 'hostgroup'))
@ -53,34 +57,37 @@
# Defaults to hiera('step') # Defaults to hiera('step')
# #
class tripleo::profile::base::cinder::volume::rbd ( class tripleo::profile::base::cinder::volume::rbd (
$backend_name = hiera('cinder::backend::rbd::volume_backend_name', 'tripleo_ceph'), $backend_name = hiera('cinder::backend::rbd::volume_backend_name', 'tripleo_ceph'),
$cinder_rbd_backend_host = hiera('cinder::backend_host', hiera('cinder::host', 'hostgroup')), $backend_availability_zone = hiera('cinder::backend::rbd::backend_availability_zone', undef),
$cinder_rbd_ceph_conf = hiera('cinder::backend::rbd::rbd_ceph_conf', '/etc/ceph/ceph.conf'), $cinder_rbd_backend_host = hiera('cinder::backend_host', hiera('cinder::host', 'hostgroup')),
$cinder_rbd_pool_name = 'volumes', $cinder_rbd_ceph_conf = hiera('cinder::backend::rbd::rbd_ceph_conf', '/etc/ceph/ceph.conf'),
$cinder_rbd_extra_pools = undef, $cinder_rbd_pool_name = 'volumes',
$cinder_rbd_secret_uuid = undef, $cinder_rbd_extra_pools = undef,
$cinder_rbd_user_name = 'openstack', $cinder_rbd_secret_uuid = undef,
$step = Integer(hiera('step')), $cinder_rbd_user_name = 'openstack',
$step = Integer(hiera('step')),
) { ) {
include ::tripleo::profile::base::cinder::volume include ::tripleo::profile::base::cinder::volume
if $step >= 4 { if $step >= 4 {
cinder::backend::rbd { $backend_name : cinder::backend::rbd { $backend_name :
backend_host => $cinder_rbd_backend_host, backend_availability_zone => $backend_availability_zone,
rbd_ceph_conf => $cinder_rbd_ceph_conf, backend_host => $cinder_rbd_backend_host,
rbd_pool => $cinder_rbd_pool_name, rbd_ceph_conf => $cinder_rbd_ceph_conf,
rbd_user => $cinder_rbd_user_name, rbd_pool => $cinder_rbd_pool_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid, rbd_user => $cinder_rbd_user_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid,
} }
if $cinder_rbd_extra_pools { if $cinder_rbd_extra_pools {
$cinder_rbd_extra_pools.each |$pool_name| { $cinder_rbd_extra_pools.each |$pool_name| {
cinder::backend::rbd { "${backend_name}_${pool_name}" : cinder::backend::rbd { "${backend_name}_${pool_name}" :
backend_host => $cinder_rbd_backend_host, backend_availability_zone => $backend_availability_zone,
rbd_ceph_conf => $cinder_rbd_ceph_conf, backend_host => $cinder_rbd_backend_host,
rbd_pool => $pool_name, rbd_ceph_conf => $cinder_rbd_ceph_conf,
rbd_user => $cinder_rbd_user_name, rbd_pool => $pool_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid, rbd_user => $cinder_rbd_user_name,
rbd_secret_uuid => $cinder_rbd_secret_uuid,
} }
} }
} }

View File

@ -35,6 +35,7 @@ class tripleo::profile::base::cinder::volume::scaleio (
if $step >= 4 { if $step >= 4 {
cinder::backend::scaleio { $backend_name : cinder::backend::scaleio { $backend_name :
backend_availability_zone => hiera('cinder::backend::scaleio::backend_availability_zone', undef),
sio_login => hiera('cinder::backend::scaleio::sio_login', undef), sio_login => hiera('cinder::backend::scaleio::sio_login', undef),
sio_password => hiera('cinder::backend::scaleio::sio_password', undef), sio_password => hiera('cinder::backend::scaleio::sio_password', undef),
sio_server_hostname => hiera('cinder::backend::scaleio::sio_server_hostname', undef), sio_server_hostname => hiera('cinder::backend::scaleio::sio_server_hostname', undef),

View File

@ -38,6 +38,7 @@ class tripleo::profile::base::cinder::volume::veritas_hyperscale (
if $step >= 4 { if $step >= 4 {
cinder::backend::veritas_hyperscale { $backend_name : cinder::backend::veritas_hyperscale { $backend_name :
backend_availability_zone => hiera('cinder::backend::veritas_hyperscale::backend_availability_zone', undef)
} }
} }

View File

@ -0,0 +1,5 @@
---
features:
- |
Add the ability to override the "backend_availability_zone"
parameter in every cinder volume backend.

View File

@ -56,16 +56,21 @@ describe 'tripleo::profile::base::cinder::volume::iscsi' do
end end
end end
context 'with ipv6 address' do context 'with customizations' do
before :each do before :each do
params.merge!({ :cinder_iscsi_address => 'fe80::fc54:ff:fe9e:7846' }) params.merge!(
{
:backend_availability_zone => 'my_zone',
:cinder_iscsi_address => 'fe80::fc54:ff:fe9e:7846',
})
end end
it 'should trigger complete configuration' do it 'should trigger complete configuration' do
is_expected.to contain_class('cinder::setup_test_volume').with( is_expected.to contain_class('cinder::setup_test_volume').with(
:size => '10280M' :size => '10280M'
) )
is_expected.to contain_cinder__backend__iscsi('tripleo_iscsi').with( is_expected.to contain_cinder__backend__iscsi('tripleo_iscsi').with(
:iscsi_ip_address => '[fe80::fc54:ff:fe9e:7846]' :backend_availability_zone => 'my_zone',
:iscsi_ip_address => '[fe80::fc54:ff:fe9e:7846]',
) )
end end
end end

View File

@ -52,6 +52,20 @@ describe 'tripleo::profile::base::cinder::volume::nfs' do
end end
end end
context 'with customizations' do
before :each do
params.merge!(
{
:backend_availability_zone => 'my_zone',
})
end
it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__nfs('tripleo_nfs').with(
:backend_availability_zone => 'my_zone',
)
end
end
context 'with selinux' do context 'with selinux' do
before :each do before :each do
facts.merge!({ :selinux => 'true' }) facts.merge!({ :selinux => 'true' })

View File

@ -46,7 +46,29 @@ describe 'tripleo::profile::base::cinder::volume::nvmeof' do
end end
end end
context 'with customizations' do
before :each do
params.merge!(
{
:backend_availability_zone => 'my_zone',
})
end
it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__nvmeof('tripleo_nvmeof').with(
:backend_availability_zone => 'my_zone',
)
end
end
end end
end end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({ :hostname => 'node.example.com' })
end
it_behaves_like 'tripleo::profile::base::cinder::volume::nvmeof'
end
end
end end

View File

@ -52,36 +52,40 @@ describe 'tripleo::profile::base::cinder::volume::rbd' do
context 'with customizations' do context 'with customizations' do
before :each do before :each do
params.merge!({ params.merge!({
:backend_name => 'poodles', :backend_name => 'poodles',
:cinder_rbd_backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_availability_zone => 'my_zone',
:cinder_rbd_ceph_conf => '/etc/ceph/mycluster.conf', :cinder_rbd_backend_host => 'fe80::fc54:ff:fe9e:7846',
:cinder_rbd_pool_name => 'poolname', :cinder_rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:cinder_rbd_extra_pools => ['aplenty', 'galore'], :cinder_rbd_pool_name => 'poolname',
:cinder_rbd_secret_uuid => 'secretuuid', :cinder_rbd_extra_pools => ['aplenty', 'galore'],
:cinder_rbd_user_name => 'kcatsnepo' :cinder_rbd_secret_uuid => 'secretuuid',
:cinder_rbd_user_name => 'kcatsnepo'
}) })
end end
it 'should trigger complete configuration' do it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__rbd('poodles').with( is_expected.to contain_cinder__backend__rbd('poodles').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf', :backend_availability_zone => 'my_zone',
:rbd_pool => 'poolname', :rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_user => 'kcatsnepo', :rbd_pool => 'poolname',
:rbd_secret_uuid => 'secretuuid' :rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid'
) )
is_expected.to contain_cinder__backend__rbd('poodles_aplenty').with( is_expected.to contain_cinder__backend__rbd('poodles_aplenty').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf', :backend_availability_zone => 'my_zone',
:rbd_pool => 'aplenty', :rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_user => 'kcatsnepo', :rbd_pool => 'aplenty',
:rbd_secret_uuid => 'secretuuid' :rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid'
) )
is_expected.to contain_cinder__backend__rbd('poodles_galore').with( is_expected.to contain_cinder__backend__rbd('poodles_galore').with(
:backend_host => 'fe80::fc54:ff:fe9e:7846', :backend_host => 'fe80::fc54:ff:fe9e:7846',
:rbd_ceph_conf => '/etc/ceph/mycluster.conf', :backend_availability_zone => 'my_zone',
:rbd_pool => 'galore', :rbd_ceph_conf => '/etc/ceph/mycluster.conf',
:rbd_user => 'kcatsnepo', :rbd_pool => 'galore',
:rbd_secret_uuid => 'secretuuid' :rbd_user => 'kcatsnepo',
:rbd_secret_uuid => 'secretuuid'
) )
end end
end end