Added support for DellStorageCenter ISCSI cinder driver

The Dell Storage Center driver manages Storage Center arrays 
through Enterprise Manager. 

Added support to generate the cinder.conf for
the Dell Storage Center iscsi volume driver based on documentation here:
http://docs.openstack.org/kilo/config-reference/content/dell-storagecenter-driver.html

Change-Id: I397777f43dbbd7c86cfa2ca4392ff303030688f9
This commit is contained in:
rajinir 2015-06-08 12:10:34 -05:00 committed by Rajini Ram
parent 4cbfb42ac6
commit c7cd3487e9
4 changed files with 260 additions and 0 deletions

View File

@ -0,0 +1,78 @@
# == define: cinder::backend::dellsc_iscsi
#
# Configure the Dell Storage Center ISCSI Driver for cinder.
#
# === Parameters
#
# [*san_ip*]
# (required) IP address of Enterprise Manager.
#
# [*san_login*]
# (required) Enterprise Manager user name.
#
# [*san_password*]
# (required) Enterprise Manager user password.
#
# [*iscsi_ip_address*]
# (required) The Storage Center iSCSI IP address.
#
# [*dell_sc_ssn*]
# (required) The Storage Center serial number to use.
#
# [*volume_backend_name*]
# (optional) The storage backend name.
# Defaults to the name of the backend
#
# [*dell_sc_api_port*]
# (optional) The Enterprise Manager API port.
# Defaults to 3033
#
# [*dell_sc_server_folder*]
# (optional) Name of the server folder to use on the Storage Center.
# Defaults to 'srv'
#
# [*dell_sc_volume_folder*]
# (optional) Name of the volume folder to use on the Storage Center.
# Defaults to 'vol'
#
# [*iscsi_port*]
# (optional) The ISCSI IP Port of the Storage Center.
# Defaults to 3260
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza.
# Defaults to: {}
# Example:
# { 'dellsc_iscsi_backend/param1' => { 'value' => value1 } }
#
define cinder::backend::dellsc_iscsi (
$san_ip,
$san_login,
$san_password,
$iscsi_ip_address,
$dell_sc_ssn,
$volume_backend_name = $name,
$dell_sc_api_port = 3033,
$dell_sc_server_folder = 'srv',
$dell_sc_volume_folder = 'vol',
$iscsi_port = 3260,
$extra_options = {},
) {
$driver = 'dell.dell_storagecenter_iscsi.DellStorageCenterISCSIDriver'
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}/iscsi_ip_address": value => $iscsi_ip_address;
"${name}/dell_sc_ssn": value => $dell_sc_ssn;
"${name}/dell_sc_api_port": value => $dell_sc_api_port;
"${name}/dell_sc_server_folder": value => $dell_sc_server_folder;
"${name}/dell_sc_volume_folder": value => $dell_sc_volume_folder;
"${name}/iscsi_port": value => $iscsi_port;
}
create_resources('cinder_config', $extra_options)
}

View File

@ -0,0 +1,68 @@
# == define: cinder::volume::dellsc_iscsi
#
# Configure the Dell Storage Center ISCSI driver for cinder.
#
# === Parameters
#
# [*san_ip*]
# (required) IP address of Enterprise Manager.
#
# [*san_login*]
# (required) Enterprise Manager user name.
#
# [*san_password*]
# (required) Enterprise Manager user password.
#
# [*iscsi_ip_address*]
# (required) The Storage Center iSCSI IP address.
#
# [*dell_sc_ssn*]
# (required) The Storage Center serial number to use.
#
# [*dell_sc_api_port*]
# (optional) The Enterprise Manager API port.
# Defaults to 3033
#
# [*dell_sc_server_folder*]
# (optional) Name of the server folder to use on the Storage Center.
# Defaults to 'srv'
#
# [*dell_sc_volume_folder*]
# (optional) Name of the volume folder to use on the Storage Center.
# Defaults to 'vol'
#
# [*iscsi_port*]
# (optional) The Storage Center iSCSI IP port.
# Defaults to 3260
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza.
# Defaults to: {}
# Example:
# { 'dellsc_iscsi_backend/param1' => { 'value' => value1 } }
#
class cinder::volume::dellsc_iscsi (
$san_ip,
$san_login,
$san_password,
$iscsi_ip_address,
$dell_sc_ssn,
$dell_sc_api_port = 3033,
$dell_sc_server_folder = 'srv',
$dell_sc_volume_folder = 'vol',
$iscsi_port = 3260,
$extra_options = {},
) {
cinder::backend::dellsc_iscsi { 'DEFAULT':
san_ip => $san_ip,
san_login => $san_login,
san_password => $san_password,
iscsi_ip_address => $iscsi_ip_address,
dell_sc_ssn => $dell_sc_ssn,
dell_sc_api_port => $dell_sc_api_port,
dell_sc_server_folder => $dell_sc_server_folder,
dell_sc_volume_folder => $dell_sc_volume_folder,
iscsi_port => $iscsi_port,
extra_options => $extra_options,
}
}

View File

@ -0,0 +1,57 @@
require 'spec_helper'
describe 'cinder::volume::dellsc_iscsi' do
let :params do
{
:san_ip => '172.23.8.101',
:san_login => 'Admin',
:san_password => '12345',
:iscsi_ip_address => '192.168.0.20',
:dell_sc_ssn => '64720',
}
end
let :default_params do
{
:dell_sc_api_port => 3033,
:dell_sc_server_folder => 'srv',
:dell_sc_volume_folder => 'vol',
:iscsi_port => 3260,
}
end
shared_examples_for 'dellsc_iscsi volume driver' do
let :params_hash do
default_params.merge(params)
end
it 'configures cinder volume driver' do
params_hash.each_pair do |config,value|
is_expected.to contain_cinder_config("DEFAULT/#{config}").with_value( value )
end
end
it 'marks san_password as secret' do
is_expected.to contain_cinder_config('DEFAULT/san_password').with_secret( true )
end
end
context 'with parameters' do
it_configures 'dellsc_iscsi volume driver'
end
context 'dellsc_iscsi volume driver with additional configuration' do
before :each do
params.merge!({:extra_options => { 'dellsc_iscsi_backend/param1' => {'value' => 'value1'}}})
end
it 'configure dellsc_iscsi volume with additional configuration' do
should contain_cinder__backend__dellsc_iscsi('DEFAULT').with({
:extra_options => {'dellsc_iscsi_backend/param1' => {'value' => 'value1'}}
})
end
end
end

View File

@ -0,0 +1,57 @@
require 'spec_helper'
describe 'cinder::backend::dellsc_iscsi' do
let (:config_group_name) { 'dellsc_iscsi' }
let (:title) { config_group_name }
let :params do
{
:san_ip => '172.23.8.101',
:san_login => 'Admin',
:san_password => '12345',
:iscsi_ip_address => '192.168.0.20',
:dell_sc_ssn => '64720',
}
end
let :default_params do
{
:dell_sc_api_port => 3033,
:dell_sc_server_folder => 'srv',
:dell_sc_volume_folder => 'vol',
:iscsi_port => 3260,
}
end
shared_examples_for 'dellsc_iscsi volume driver' do
let :params_hash do
default_params.merge(params)
end
it 'configures cinder volume driver' do
params_hash.each_pair do |config,value|
is_expected.to contain_cinder_config("dellsc_iscsi/#{config}").with_value( value )
end
end
end
context 'with parameters' do
it_configures 'dellsc_iscsi volume driver'
end
context 'dellsc_iscsi backend with additional configuration' do
before do
params.merge!({:extra_options => {'dellsc_iscsi/param1' => { 'value' => 'value1' }}})
end
it 'configure dellsc_iscsi backend with additional configuration' do
should contain_cinder_config('dellsc_iscsi/param1').with({
:value => 'value1'
})
end
end
end