VNX driver: Improve parameter coverage
This change update the resource type to set up VNX driver parameters so that all available parameters can be configured by the resource type. Change-Id: I788cd48c077aae74bd156d2bea6c99fafbf6444a
This commit is contained in:
parent
a8eb386af0
commit
8b3503d38a
@ -55,11 +55,43 @@
|
||||
# (optional) Which storage protocol to use.
|
||||
# Defaults to 'iscsi'
|
||||
#
|
||||
# [*destroy_empty_storage_group*]
|
||||
# (optional) Destroy storage group when the last LUN is removed from it.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*iscsi_initiators*]
|
||||
# (optional) Mapping betwene hostname and its iSCSI initiator IP addresses.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*io_port_list*]
|
||||
# (optional) List of iSCSI or FC ports to be used in Nova or Cinder.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*initiator_auto_registration*]
|
||||
# (optinal) Automatically register initiators.
|
||||
# (optional) Automatically register initiators.
|
||||
# Boolean value.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*initiator_auto_deregistration*]
|
||||
# (optional) Automatically deregister initiators after the related storage
|
||||
# group is destroyed.
|
||||
# Boolean value.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*force_delete_lun_in_storagegroup*]
|
||||
# (optional) Delete a LUN even if it is in Storage Groups.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*ignore_pool_full_threshold*]
|
||||
# (optional) Force LUN creation even if the full threshold of pool is
|
||||
# reached.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*vnx_async_migrate*]
|
||||
# (optional) Always use asynchronous migration during volume cloning and
|
||||
# creating from snapshot.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*storage_vnx_auth_type*]
|
||||
# (optional) VNX authentication scope type.
|
||||
# Defaults to $::os_service_default
|
||||
@ -83,40 +115,54 @@ define cinder::backend::emc_vnx (
|
||||
$san_ip,
|
||||
$san_password,
|
||||
$storage_vnx_pool_names,
|
||||
$default_timeout = '10',
|
||||
$max_luns_per_storage_group = '256',
|
||||
$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',
|
||||
$initiator_auto_registration = $::os_service_default,
|
||||
$storage_vnx_auth_type = $::os_service_default,
|
||||
$storage_vnx_security_file_dir = $::os_service_default,
|
||||
$naviseccli_path = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
$default_timeout = '10',
|
||||
$max_luns_per_storage_group = '256',
|
||||
$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',
|
||||
$destroy_empty_storage_group = $::os_service_default,
|
||||
$iscsi_initiators = $::os_service_default,
|
||||
$io_port_list = $::os_service_default,
|
||||
$initiator_auto_registration = $::os_service_default,
|
||||
$initiator_auto_deregistration = $::os_service_default,
|
||||
$force_delete_lun_in_storagegroup = $::os_service_default,
|
||||
$ignore_pool_full_threshold = $::os_service_default,
|
||||
$vnx_async_migrate = $::os_service_default,
|
||||
$storage_vnx_auth_type = $::os_service_default,
|
||||
$storage_vnx_security_file_dir = $::os_service_default,
|
||||
$naviseccli_path = $::os_service_default,
|
||||
$manage_volume_type = false,
|
||||
) {
|
||||
|
||||
include cinder::deps
|
||||
include cinder::params
|
||||
|
||||
cinder_config {
|
||||
"${name}/default_timeout": value => $default_timeout;
|
||||
"${name}/max_luns_per_storage_group": value => $max_luns_per_storage_group;
|
||||
"${name}/naviseccli_path": value => $naviseccli_path;
|
||||
"${name}/san_ip": value => $san_ip;
|
||||
"${name}/san_login": value => $san_login;
|
||||
"${name}/san_password": value => $san_password, secret => true;
|
||||
"${name}/storage_vnx_pool_names": value => join(any2array($storage_vnx_pool_names), ',');
|
||||
"${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;
|
||||
"${name}/storage_vnx_authentication_type": value => $storage_vnx_auth_type;
|
||||
"${name}/storage_vnx_security_file_dir": value => $storage_vnx_security_file_dir;
|
||||
"${name}/default_timeout": value => $default_timeout;
|
||||
"${name}/max_luns_per_storage_group": value => $max_luns_per_storage_group;
|
||||
"${name}/naviseccli_path": value => $naviseccli_path;
|
||||
"${name}/san_ip": value => $san_ip;
|
||||
"${name}/san_login": value => $san_login;
|
||||
"${name}/san_password": value => $san_password, secret => true;
|
||||
"${name}/storage_vnx_pool_names": value => join(any2array($storage_vnx_pool_names), ',');
|
||||
"${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}/destroy_empty_storage_group": value => $destroy_empty_storage_group;
|
||||
"${name}/iscsi_initiators": value => $iscsi_initiators;
|
||||
"${name}/io_port_list": value => join(any2array($io_port_list), ',');
|
||||
"${name}/initiator_auto_registration": value => $initiator_auto_registration;
|
||||
"${name}/initiator_auto_deregistration": value => $initiator_auto_deregistration;
|
||||
"${name}/force_delete_lun_in_storagegroup": value => $force_delete_lun_in_storagegroup;
|
||||
"${name}/ignore_pool_full_threshold": value => $ignore_pool_full_threshold;
|
||||
"${name}/vnx_async_migrate": value => $vnx_async_migrate;
|
||||
"${name}/storage_vnx_authentication_type": value => $storage_vnx_auth_type;
|
||||
"${name}/storage_vnx_security_file_dir": value => $storage_vnx_security_file_dir;
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
|
13
releasenotes/notes/vnx-opts-0f54da4879ed8084.yaml
Normal file
13
releasenotes/notes/vnx-opts-0f54da4879ed8084.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The ``cinder::backend::emc_vnx`` resource type now supports the following
|
||||
parameters of EMC VNX driver.
|
||||
|
||||
- ``destroy_empty_storage_group``
|
||||
- ``iscsi_initiators``
|
||||
- ``io_port_list``
|
||||
- ``initiator_auto_deregistration``
|
||||
- ``force_delete_lun_in_storagegroup``
|
||||
- ``ignore_pool_full_threshold``
|
||||
- ``vnx_async_migrate``
|
@ -5,10 +5,10 @@ describe 'cinder::backend::emc_vnx' do
|
||||
|
||||
let :req_params do
|
||||
{
|
||||
:san_ip => '127.0.0.2',
|
||||
:san_login => 'emc',
|
||||
:san_password => 'password',
|
||||
:storage_vnx_pool_names => 'emc-storage-pool'
|
||||
:san_ip => '127.0.0.2',
|
||||
:san_login => 'emc',
|
||||
:san_password => 'password',
|
||||
:storage_vnx_pool_names => 'emc-storage-pool'
|
||||
}
|
||||
end
|
||||
|
||||
@ -25,7 +25,14 @@ describe 'cinder::backend::emc_vnx' do
|
||||
is_expected.to contain_cinder_config('emc/san_login').with_value('emc')
|
||||
is_expected.to contain_cinder_config('emc/san_password').with_value('password').with_secret(true)
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_pool_names').with_value('emc-storage-pool')
|
||||
is_expected.to contain_cinder_config('emc/destroy_empty_storage_group').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/iscsi_initiators').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/io_port_list').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/initiator_auto_registration').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/initiator_auto_deregistration').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/force_delete_lun_in_storagegroup').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/ignore_pool_full_threshold').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/vnx_async_migrate').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_authentication_type').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_security_file_dir').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_cinder_config('emc/naviseccli_path').with_value('<SERVICE DEFAULT>')
|
||||
@ -36,20 +43,34 @@ describe 'cinder::backend::emc_vnx' do
|
||||
context 'emc vnx backend overriding some parameters' do
|
||||
before :each do
|
||||
params.merge!({
|
||||
:storage_vnx_pool_names => ['emc-storage-pool1', 'emc-storage-pool2'],
|
||||
:initiator_auto_registration => true,
|
||||
:storage_vnx_auth_type => 'global',
|
||||
:storage_vnx_security_file_dir => '/etc/secfile/array1',
|
||||
:naviseccli_path => '/opt/Navisphere/bin/naviseccli',
|
||||
:manage_volume_type => true,
|
||||
:storage_protocol => 'fc',
|
||||
:backend_availability_zone => 'my_zone',
|
||||
:storage_vnx_pool_names => ['emc-storage-pool1', 'emc-storage-pool2'],
|
||||
:destroy_empty_storage_group => false,
|
||||
:iscsi_initiators => '{"host1":["10.0.0.1", "10.0.0.2"]}',
|
||||
:io_port_list => ['a-1', 'B-3'],
|
||||
:initiator_auto_registration => true,
|
||||
:initiator_auto_deregistration => false,
|
||||
:force_delete_lun_in_storagegroup => false,
|
||||
:ignore_pool_full_threshold => false,
|
||||
:vnx_async_migrate => true,
|
||||
:storage_vnx_auth_type => 'global',
|
||||
:storage_vnx_security_file_dir => '/etc/secfile/array1',
|
||||
:naviseccli_path => '/opt/Navisphere/bin/naviseccli',
|
||||
:manage_volume_type => true,
|
||||
:storage_protocol => 'fc',
|
||||
:backend_availability_zone => 'my_zone',
|
||||
})
|
||||
end
|
||||
|
||||
it {
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_pool_names').with_value(params[:storage_vnx_pool_names].join(','))
|
||||
is_expected.to contain_cinder_config('emc/destroy_empty_storage_group').with_value(params[:destroy_empty_storage_group])
|
||||
is_expected.to contain_cinder_config('emc/iscsi_initiators').with_value(params[:iscsi_initiators])
|
||||
is_expected.to contain_cinder_config('emc/io_port_list').with_value(params[:io_port_list].join(','))
|
||||
is_expected.to contain_cinder_config('emc/initiator_auto_registration').with_value(params[:initiator_auto_registration])
|
||||
is_expected.to contain_cinder_config('emc/initiator_auto_deregistration').with_value(params[:initiator_auto_deregistration])
|
||||
is_expected.to contain_cinder_config('emc/force_delete_lun_in_storagegroup').with_value(params[:force_delete_lun_in_storagegroup])
|
||||
is_expected.to contain_cinder_config('emc/ignore_pool_full_threshold').with_value(params[:ignore_pool_full_threshold])
|
||||
is_expected.to contain_cinder_config('emc/vnx_async_migrate').with_value(params[:vnx_async_migrate])
|
||||
is_expected.to contain_cinder_config('emc/storage_vnx_authentication_type').with_value(params[:storage_vnx_auth_type])
|
||||
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])
|
||||
|
Loading…
Reference in New Issue
Block a user