Merge "Support for Dell EMC XtremIO Volume Config" into stable/train

This commit is contained in:
Zuul 2020-05-30 02:41:27 +00:00 committed by Gerrit Code Review
commit e08061b570
6 changed files with 206 additions and 10 deletions

View File

@ -42,6 +42,10 @@
# (Optional) Whether to enable the vnx backend
# Defaults to false
#
# [*cinder_enable_dellemc_xtremio_backend*]
# (Optional) Whether to enable the xtremio backend
# Defaults to false
#
# [*cinder_enable_dellemc_xtremio_iscsi_backend*]
# (Optional) Whether to enable the extremio iscsi backend
# Defaults to false
@ -126,6 +130,7 @@ class tripleo::profile::base::cinder::volume (
$cinder_enable_dellemc_powermax_backend = false,
$cinder_enable_dellemc_vmax_iscsi_backend = false,
$cinder_enable_dellemc_vnx_backend = false,
$cinder_enable_dellemc_xtremio_backend = false,
$cinder_enable_dellemc_xtremio_iscsi_backend = false,
$cinder_enable_hpelefthand_backend = false,
$cinder_enable_dellps_backend = false,
@ -225,6 +230,14 @@ class tripleo::profile::base::cinder::volume (
$cinder_dellemc_vnx_backend_name = undef
}
if $cinder_enable_dellemc_xtremio_backend {
include tripleo::profile::base::cinder::volume::dellemc_xtremio
$cinder_dellemc_xtremio_backend_name = hiera('cinder::backend::dellemc_xtremio::volume_backend_name',
'tripleo_dellemc_xtremio')
} else {
$cinder_dellemc_xtremio_backend_name = undef
}
if $cinder_enable_dellemc_xtremio_iscsi_backend {
include ::tripleo::profile::base::cinder::volume::dellemc_xtremio_iscsi
$cinder_dellemc_xtreamio_iscsi_backend_name = hiera('cinder::backend::dellemc_extremio_iscsi::volume_backend_name',
@ -326,6 +339,7 @@ class tripleo::profile::base::cinder::volume (
$cinder_dellemc_powermax_backend_name,
$cinder_dellemc_vmax_iscsi_backend_name,
$cinder_dellemc_vnx_backend_name,
$cinder_dellemc_xtremio_backend_name,
$cinder_dellemc_xtremio_iscsi_backend_name,
$cinder_hpelefthand_backend_name,
$cinder_netapp_backend_name,

View File

@ -0,0 +1,71 @@
# Copyright (c) 2020 Dell Inc, or its subsidiaries.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# == Class: tripleo::profile::base::cinder::volume::dellemc_xtremio
#
# Cinder Volume dellemc_xtremio profile for tripleo
#
# === Parameters
#
# [*backend_name*]
# (Optional) Name given to the Cinder backend stanza
# Defaults to 'tripleo_dellemc_xtremio'
#
# [*multi_config*]
# (Optional) A config hash when multiple backends are used.
# Defaults to hiera('cinder::backend::dellemc_xtremio::volume_multi_config', {})
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::cinder::volume::dellemc_xtremio (
$backend_name = hiera('cinder::backend::dellemc_xtremio::volume_backend_name', ['tripleo_dellemc_xtremio']),
$multi_config = hiera('cinder::backend::dellemc_xtremio::volume_multi_config', {}),
$step = Integer(hiera('step')),
) {
include tripleo::profile::base::cinder::volume
if $step >= 4 {
$backend_defaults = {
'CinderXtremioAvailabilityZone' => hiera('cinder::backend::dellemc_xtremio::backend_availability_zone', undef),
'CinderXtremioSanIp' => hiera('cinder::backend::dellemc_xtremio::san_ip', undef),
'CinderXtremioSanLogin' => hiera('cinder::backend::dellemc_xtremio::san_login', undef),
'CinderXtremioSanPassword' => hiera('cinder::backend::dellemc_xtremio::san password', undef),
'CinderXtremioStorageProtocol' => hiera('cinder::backend::dellemc_xtremio::xtremio_storage_protocol', undef),
'CinderXtremioClusterName' => hiera('cinder::backend::dellemc_xtremio::xtremio_cluster_name', undef),
'CinderXtremioArrayBusyRetryCount' => hiera('cinder::backend::dellemc_xtremio::xtremio_array_busy_retry_count', undef),
'CinderXtremioArrayBusyRetryInterval'=> hiera('cinder::backend::dellemc_xtremio::xtremio_array_busy_retry_interval', undef),
'CinderXtremioVolumesPerGlanceCache' => hiera('cinder::backend::dellemc_xtremio::xtremio_volumes_per_glance_cache', undef),
}
any2array($backend_name).each |String $backend| {
$backend_config = merge($backend_defaults, pick($multi_config[$backend], {}))
cinder::backend::dellemc_xtremio { $backend :
backend_availability_zone => $backend_config['CinderXtremioAvailabilityZone'],
san_ip => $backend_config['CinderXtremioSanIp'],
san_login => $backend_config['CinderXtremioSanLogin'],
san_password => $backend_config['CinderXtremioSanPassword'],
xtremio_storage_protocol => $backend_config['CinderXtremioStorageProtocol'],
xtremio_cluster_name => $backend_config['CinderXtremioSSN'],
xtremio_array_busy_retry_count => $backend_config['CinderXtremioArrayBusyRetryCount'],
xtremio_array_busy_retry_interval => $backend_config['CinderXtremioArrayBusyRetryInterval'],
xtremio_volumes_per_glance_cache => $backend_config['CinderXtremioVolumesPerGlanceCache'],
}
}
}
}

View File

@ -0,0 +1,5 @@
---
features:
- Add Dell EMC XtremIO backend Cinder driver options.
Supports both iSCSI and FC volume drivers and
multiple backends as well

View File

@ -92,6 +92,34 @@ describe 'tripleo::profile::base::cinder::volume' do
end
end
context 'with only xtremio' do
before :each do
params.merge!({
:cinder_enable_dellemc_xtremio_backend => true,
:cinder_enable_iscsi_backend => false,
})
end
it 'should configure only xtremio' do
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_xtremio')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::iscsi')
is_expected.to contain_class('tripleo::profile::base::cinder::volume')
is_expected.to contain_class('tripleo::profile::base::cinder')
is_expected.to contain_class('cinder::volume')
is_expected.to contain_class('cinder::backends').with(
:enabled_backends => ['tripleo_dellemc_xtremio']
)
end
context 'with multiple xtremio backends' do
# Step 5's hiera specifies two xtremio backend names
let(:params) { { :step => 5 } }
it 'should enable each backend' do
is_expected.to contain_class('cinder::backends').with(
:enabled_backends => ['tripleo_dellemc_xtremio_1', 'tripleo_dellemc_xtremio_2']
)
end
end
end
context 'with only powermax' do
before :each do
params.merge!({
@ -259,6 +287,7 @@ describe 'tripleo::profile::base::cinder::volume' do
it 'should configure only user backend' do
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::iscsi')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::pure')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellemc_xtremio')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellsc')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellps')
is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::netapp')
@ -277,19 +306,21 @@ describe 'tripleo::profile::base::cinder::volume' do
context 'with all tripleo backends' do
before :each do
params.merge!({
:cinder_enable_nfs_backend => true,
:cinder_enable_rbd_backend => true,
:cinder_enable_iscsi_backend => true,
:cinder_enable_pure_backend => true,
:cinder_enable_dellsc_backend => true,
:cinder_enable_dellps_backend => true,
:cinder_enable_netapp_backend => true,
:cinder_enable_vrts_hs_backend => true,
:cinder_enable_nfs_backend => true,
:cinder_enable_rbd_backend => true,
:cinder_enable_iscsi_backend => true,
:cinder_enable_pure_backend => true,
:cinder_enable_dellps_backend => true,
:cinder_enable_dellsc_backend => true,
:cinder_enable_dellemc_xtremio_backend => true,
:cinder_enable_netapp_backend => true,
:cinder_enable_vrts_hs_backend => true,
})
end
it 'should configure all backends' do
is_expected.to contain_class('tripleo::profile::base::cinder::volume::iscsi')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::pure')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_xtremio')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellsc')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellps')
is_expected.to contain_class('tripleo::profile::base::cinder::volume::netapp')
@ -300,8 +331,8 @@ describe 'tripleo::profile::base::cinder::volume' do
is_expected.to contain_class('tripleo::profile::base::cinder')
is_expected.to contain_class('cinder::volume')
is_expected.to contain_class('cinder::backends').with(
:enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_pure', 'tripleo_dellps',
'tripleo_dellsc', 'tripleo_netapp','tripleo_nfs','Veritas_HyperScale']
:enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_pure','tripleo_dellps', 'tripleo_dellsc', 'tripleo_dellemc_xtremio',
'tripleo_netapp','tripleo_nfs','Veritas_HyperScale']
)
end
end

View File

@ -0,0 +1,72 @@
# Copyright (c) 2020 Dell Inc, or its subsidiaries
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
require 'spec_helper'
describe 'tripleo::profile::base::cinder::volume::dellemc_xtremio' do
shared_examples_for 'tripleo::profile::base::cinder::volume::dellemc_xtremio' do
before :each do
facts.merge!({ :step => params[:step] })
end
context 'with step less than 4' do
let(:params) { { :step => 3 } }
it 'should do nothing' do
is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_xtremio')
is_expected.to contain_class('tripleo::profile::base::cinder::volume')
is_expected.to contain_class('tripleo::profile::base::cinder')
is_expected.to_not contain_cinder__backend__dellemc_xtremio('tripleo_dellemc_xtremio')
end
end
context 'with step 4' do
let(:params) { {
:step => 4,
} }
it 'should trigger complete configuration' do
is_expected.to contain_cinder__backend__dellemc_xtremio('tripleo_dellemc_xtremio')
end
context 'with multiple backends' do
let(:params) { {
:backend_name => ['tripleo_dellemc_xtremio_1', 'tripleo_dellemc_xtremio_2'],
:multi_config => { 'tripleo_dellemc_xtremio_2' => { 'CinderXtremioStorageProtocol' => 'FC' }},
:step => 4,
} }
it 'should configure each backend' do
is_expected.to contain_cinder__backend__dellemc_xtremio('tripleo_dellemc_xtremio_1')
is_expected.to contain_cinder_config('tripleo_dellemc_xtremio_1/volume_driver')
.with_value('cinder.volume.drivers.dell_emc.xtremio.XtremIOISCSIDriver')
is_expected.to contain_cinder__backend__dellemc_xtremio('tripleo_dellemc_xtremio_2')
is_expected.to contain_cinder_config('tripleo_dellemc_xtremio_2/volume_driver')
.with_value('cinder.volume.drivers.dell_emc.xtremio.XtremIOFCDriver')
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::dellemc_xtremio'
end
end
end

View File

@ -9,3 +9,6 @@ cinder::backend::pure::volume_backend_name:
cinder::backend::dellemc_powermax::volume_backend_name:
- 'tripleo_dellemc_powermax_1'
- 'tripleo_dellemc_powermax_2'
cinder::backend::dellemc_xtremio::volume_backend_name:
- 'tripleo_dellemc_xtremio_1'
- 'tripleo_dellemc_xtremio_2'