From 796f44e416477a4993661781c5349bbd53d75e0c Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Sat, 27 Sep 2014 00:03:08 -0400 Subject: [PATCH] Bring EMC VNX support for volumes backend - Add a new backend to support EMC VNX direct driver - Updating puppet-cinder refs to have the upstream commit with EMC support - Unit test with a new context - Update the README Note: .fixtures and Puppetfile has been put on a dev branchi for cinder module to debug while the patch is upstream. --- .fixtures.yml | 2 +- Puppetfile | 3 +- README.md | 6 +- manifests/volume/backend/emc_vnx.pp | 72 +++++++++++++++++++++++ manifests/volume/storage.pp | 10 +++- spec/classes/cloud_volume_storage_spec.rb | 25 +++++++- 6 files changed, 113 insertions(+), 5 deletions(-) create mode 100644 manifests/volume/backend/emc_vnx.pp diff --git a/.fixtures.yml b/.fixtures.yml index a16b481f..eff5ee75 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -5,7 +5,7 @@ fixtures: ref: 'c374bed10f8af6000601fa407ebaef0833e1999c' 'cinder': repo: 'git://github.com/enovance/puppet-cinder' - ref: '2da616a4a52d3086fe3a291b9199fc7313575504' + ref: 'ef0aaab38452f46eb2fc1ee1f2c4d85ccb149d52' 'keystone': repo: 'git://github.com/enovance/puppet-keystone.git' ref: 'e381349c1b838301dd730aa3cd146ecacc75aa7c' diff --git a/Puppetfile b/Puppetfile index c5fc5f68..183fef3f 100644 --- a/Puppetfile +++ b/Puppetfile @@ -23,9 +23,10 @@ mod 'openstacklib', mod 'ceilometer', :git => 'git://github.com/enovance/puppet-ceilometer.git', :ref => '957c2120d0ee0b9db08bfddcce996686ba61d97d' +# Custom branch until https://review.openstack.org/#/c/124561/ merged mod 'cinder', :git => 'git://github.com/enovance/puppet-cinder.git', - :ref => '2da616a4a52d3086fe3a291b9199fc7313575504' + :ref => 'ef0aaab38452f46eb2fc1ee1f2c4d85ccb149d52' mod 'glance', :git => 'git://github.com/enovance/puppet-glance.git', :ref => '78042d76c0854e16a55aaf05c03696d4d422e3c5' diff --git a/README.md b/README.md index 0fa043a5..c0284278 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,11 @@ Cinder, Glance and Nova can use Ceph as backend storage, using [puppet-ceph](htt Only KVM and QEMU are supported as hypervisors, for now. Neutron use ML2 plugin with GRE and Open-vSwitch drivers. -Cinder has multi-backend support with Ceph used by default and NetApp as an option. +Cinder has multi-backend support: +* RBD (default) +* NetAPP +* iSCSI +* EMC VNX direct Trove support is now experimental. [Puppet Modules](http://docs.puppetlabs.com/learning/modules1.html#modules) are a collection of related contents that can be used to model the configuration of a discrete service. diff --git a/manifests/volume/backend/emc_vnx.pp b/manifests/volume/backend/emc_vnx.pp new file mode 100644 index 00000000..577eab8f --- /dev/null +++ b/manifests/volume/backend/emc_vnx.pp @@ -0,0 +1,72 @@ +# +# Copyright (C) 2014 eNovance SAS +# +# 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. +# +# Configure EMC VNX backend for Cinder +# +# +# === Parameters +# +# [*volume_backend_name*] +# (optional) Allows for the volume_backend_name to be separate of $name. +# Defaults to: $name +# +# [*san_ip*] +# (required) IP address of SAN controller. +# +# [*san_password*] +# (required) Password of SAN controller. +# +# [*san_login*] +# (optional) Login of SAN controller. +# Defaults to : 'admin' +# +# [*storage_vnx_pool_name*] +# (required) Storage pool name. +# +# [*default_timeout*] +# (optional) Default timeout for CLI operations in minutes. +# Defaults to: '10' +# +# [*max_luns_per_storage_group*] +# (optional) Default max number of LUNs in a storage group. +# Defaults to: '256' +# + +define cloud::volume::backend::emc_vnx ( + $iscsi_ip_address, + $san_ip, + $san_password, + $storage_vnx_pool_name, + $default_timeout = '10', + $max_luns_per_storage_group = '256', + $san_login = 'admin', + $volume_backend_name = $name, +) { + cinder::backend::emc_vnx { $name: + default_timeout => $default_timeout, + iscsi_ip_address => $iscsi_ip_address, + max_luns_per_storage_group => $max_luns_per_storage_group, + san_ip => $san_ip, + san_login => $san_login, + san_password => $san_password, + storage_vnx_pool_name => $storage_vnx_pool_name, + } + + @cinder::type { $volume_backend_name: + set_key => 'volume_backend_name', + set_value => $volume_backend_name, + notify => Service['cinder-volume'] + } +} diff --git a/manifests/volume/storage.pp b/manifests/volume/storage.pp index a1f6b777..702cb29f 100644 --- a/manifests/volume/storage.pp +++ b/manifests/volume/storage.pp @@ -91,8 +91,16 @@ class cloud::volume::storage( $iscsi_backends = { } } + if has_key($cinder_backends, 'emc_vnx') { + $emc_vnx_backends = $cinder_backends['emc_vnx'] + create_resources('cloud::volume::backend::emc_vnx', $emc_vnx_backends) + } + else { + $emc_vnx_backends = { } + } + class { 'cinder::backends': - enabled_backends => keys(merge($rbd_backends, $netapp_backends, $iscsi_backends)) + enabled_backends => keys(merge($rbd_backends, $netapp_backends, $iscsi_backends, $emc_vnx_backends)) } # Manage Volume types. diff --git a/spec/classes/cloud_volume_storage_spec.rb b/spec/classes/cloud_volume_storage_spec.rb index 2a34bea8..b6c9aaf7 100644 --- a/spec/classes/cloud_volume_storage_spec.rb +++ b/spec/classes/cloud_volume_storage_spec.rb @@ -61,6 +61,14 @@ describe 'cloud::volume::storage' do 'iscsi_ip_address' => '10.0.0.1', 'volume_group' => 'fast-vol' } + }, + 'emc_vnx' => { + 'very-fast' => { + 'iscsi_ip_address' => '10.0.0.1', + 'san_ip' => '10.0.0.2', + 'san_password' => 'secrete', + 'storage_vnx_pool_name' => 'emc-volumes', + } } }, :ks_keystone_internal_proto => 'http', @@ -151,6 +159,21 @@ describe 'cloud::volume::storage' do end end + context 'with EMC VNX backend' do + it 'configures EMC VNX volume driver' do + should contain_cinder_config('very-fast/volume_backend_name').with_value('very-fast') + should contain_cinder_config('very-fast/iscsi_ip_address').with_value('10.0.0.1') + should contain_cinder_config('very-fast/san_ip').with_value('10.0.0.2') + should contain_cinder_config('very-fast/san_password').with_value('secrete') + should contain_cinder_config('very-fast/storage_vnx_pool_name').with_value('emc-volumes') + should contain_cinder__type('very-fast').with( + :set_key => 'volume_backend_name', + :set_value => 'very-fast', + :notify => 'Service[cinder-volume]' + ) + end + end + context 'with two RBD backends' do before :each do params.merge!( @@ -204,7 +227,7 @@ describe 'cloud::volume::storage' do context 'with all backends enabled' do it 'configure all cinder backends' do is_expected.to contain_class('cinder::backends').with( - :enabled_backends => ['lowcost', 'premium', 'fast'] + :enabled_backends => ['lowcost', 'premium', 'fast', 'very-fast'] ) end end