From c71e527f46ffa9898a7def6afacb837d32faae61 Mon Sep 17 00:00:00 2001 From: rajinir Date: Sun, 17 May 2020 18:17:33 -0500 Subject: [PATCH] Support for Dell EMC VXFlexOS Backend Adding support for VXFlexOS Volume Backend Change-Id: I83b4d400947da16229c565c5311ca033b4c76d73 Closes-Bug: 1875176 --- manifests/profile/base/cinder/volume.pp | 14 +++++ .../base/cinder/volume/dellemc_vxflexos.pp | 55 ++++++++++++++++++ .../vxflexos-driver-aec8e372280c44e6.yaml | 3 + ...tripleo_profile_base_cinder_volume_spec.rb | 24 +++++++- ...ipleo_profile_base_cinder_vxflexos_spec.rb | 58 +++++++++++++++++++ 5 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 manifests/profile/base/cinder/volume/dellemc_vxflexos.pp create mode 100644 releasenotes/notes/vxflexos-driver-aec8e372280c44e6.yaml create mode 100644 spec/classes/tripleo_profile_base_cinder_vxflexos_spec.rb diff --git a/manifests/profile/base/cinder/volume.pp b/manifests/profile/base/cinder/volume.pp index d0457da7c..a69e04186 100644 --- a/manifests/profile/base/cinder/volume.pp +++ b/manifests/profile/base/cinder/volume.pp @@ -46,6 +46,10 @@ # (Optional) Whether to enable the vnx backend # Defaults to false # +# [*cinder_enable_dellemc_vxflexos_backend*] +# (Optional) Whether to enable the vxflexos backend +# Defaults to false +# # [*cinder_enable_dellemc_xtremio_backend*] # (Optional) Whether to enable the xtremio backend # Defaults to false @@ -131,6 +135,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_vxflexos_backend = false, $cinder_enable_dellemc_xtremio_backend = false, $cinder_enable_dellemc_xtremio_iscsi_backend = false, $cinder_enable_hpelefthand_backend = false, @@ -237,6 +242,14 @@ class tripleo::profile::base::cinder::volume ( $cinder_dellemc_vnx_backend_name = undef } + if $cinder_enable_dellemc_vxflexos_backend { + include tripleo::profile::base::cinder::volume::dellemc_vxflexos + $cinder_dellemc_vxflexos_backend_name = hiera('cinder::backend::dellemc_vxflexos::volume_backend_name', + 'tripleo_dellemc_vxflexos') + } else { + $cinder_dellemc_vxflexos_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', @@ -339,6 +352,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_vxflexos_backend_name, $cinder_dellemc_xtremio_backend_name, $cinder_dellemc_xtremio_iscsi_backend_name, $cinder_hpelefthand_backend_name, diff --git a/manifests/profile/base/cinder/volume/dellemc_vxflexos.pp b/manifests/profile/base/cinder/volume/dellemc_vxflexos.pp new file mode 100644 index 000000000..87731051e --- /dev/null +++ b/manifests/profile/base/cinder/volume/dellemc_vxflexos.pp @@ -0,0 +1,55 @@ +# 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_vxflexos +# +# Cinder Volume dellemc_vxflexos profile for tripleo +# +# === Parameters +# +# [*backend_name*] +# (Optional) Name given to the Cinder backend stanza +# Defaults to 'tripleo_dellemc_vxflexos' +# +# [*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_vxflexos ( + $backend_name = hiera('cinder::backend::dellemc_vxflexos::volume_backend_name', 'tripleo_dellemc_vxflexos'), + $step = Integer(hiera('step')), +) { + include tripleo::profile::base::cinder::volume + + if $step >= 4 { + cinder::backend::dellemc_vxflexos { $backend_name : + backend_availability_zone => hiera('cinder::backend::dellemc_vxflexos::backend_availability_zone', undef), + san_login => hiera('cinder::backend::dellemc_vxflexos::san_login', undef), + san_password => hiera('cinder::backend::dellemc_vxflexos::san_password', undef), + san_ip => hiera('cinder::backend::dellemc_vxflexos::san_ip', undef), + vxflexos_storage_pools => hiera('cinder::backend::dellemc_vxflexos::vxflexos_storage_pools', undef), + vxflexos_allow_migration_during_rebuild => hiera('cinder::backend::dellemc_vxflexos::vxflexos_allow_migration_during_rebuild', undef), + vxflexos_allow_non_padded_volumes => hiera('cinder::backend::dellemc_vxflexos::vxflexos_allow_non_padded_volumes', undef), + vxflexos_max_over_subscription_ratio => hiera('cinder::backend::dellemc_vxflexos::vxflexos_max_over_subscription_ratio', undef), + vxflexos_rest_server_port => hiera('cinder::backend::dellemc_vxflexos::vxflexos_rest_server_port', undef), + vxflexos_round_volume_capacity => hiera('cinder::backend::dellemc_vxflexos::vxflexos_round_volume_capacity', undef), + vxflexos_server_api_version => hiera('cinder::backend::dellemc_vxflexos::vxflexos_server_api_version', undef), + vxflexos_unmap_volume_before_deletion => hiera('cinder::backend::dellemc_vxflexos::vxflexos_unmap_volume_before_deletion', undef), + san_thin_provision => hiera('cinder::backend::dellemc_vxflexos::san_thin_provision', undef), + driver_ssl_cert_verify => hiera('cinder::backend::dellemc_vxflexos::driver_ssl_cert_verify', undef), + driver_ssl_cert_path => hiera('cinder::backend::dellemc_vxflexos::driver_ssl_cert_path', undef) + } + } +} diff --git a/releasenotes/notes/vxflexos-driver-aec8e372280c44e6.yaml b/releasenotes/notes/vxflexos-driver-aec8e372280c44e6.yaml new file mode 100644 index 000000000..71e840ac2 --- /dev/null +++ b/releasenotes/notes/vxflexos-driver-aec8e372280c44e6.yaml @@ -0,0 +1,3 @@ +--- +features: + - Added support for VxFlexOS backend driver diff --git a/spec/classes/tripleo_profile_base_cinder_volume_spec.rb b/spec/classes/tripleo_profile_base_cinder_volume_spec.rb index 0e7347ba1..b77d0f6b3 100644 --- a/spec/classes/tripleo_profile_base_cinder_volume_spec.rb +++ b/spec/classes/tripleo_profile_base_cinder_volume_spec.rb @@ -195,6 +195,25 @@ describe 'tripleo::profile::base::cinder::volume' do end end + context 'with only vxflexos' do + before :each do + params.merge!({ + :cinder_enable_dellemc_vxflexos_backend => true, + :cinder_enable_iscsi_backend => false, + }) + end + it 'should configure only vxflexos' do + is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_vxflexos') + 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_vxflexos'] + ) + end + end + context 'with only netapp' do before :each do params.merge!({ @@ -300,6 +319,7 @@ describe 'tripleo::profile::base::cinder::volume' do 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::dellemc_powermax') + is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::dellemc_vxflexos') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::netapp') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::veritas_hyperscale') is_expected.to_not contain_class('tripleo::profile::base::cinder::volume::nfs') @@ -324,6 +344,7 @@ describe 'tripleo::profile::base::cinder::volume' do :cinder_enable_dellemc_sc_backend => true, :cinder_enable_dellsc_backend => true, :cinder_enable_dellemc_xtremio_backend => true, + :cinder_enable_dellemc_vxflexos_backend => true, :cinder_enable_netapp_backend => true, :cinder_enable_vrts_hs_backend => true, }) @@ -335,6 +356,7 @@ describe 'tripleo::profile::base::cinder::volume' do 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::dellemc_powermax') + is_expected.to contain_class('tripleo::profile::base::cinder::volume::dellemc_vxflexos') is_expected.to contain_class('tripleo::profile::base::cinder::volume::netapp') is_expected.to contain_class('tripleo::profile::base::cinder::volume::veritas_hyperscale') is_expected.to contain_class('tripleo::profile::base::cinder::volume::nfs') @@ -344,7 +366,7 @@ describe 'tripleo::profile::base::cinder::volume' do is_expected.to contain_class('cinder::volume') is_expected.to contain_class('cinder::backends').with( :enabled_backends => ['tripleo_iscsi', 'tripleo_ceph', 'tripleo_pure', 'tripleo_dellsc', 'tripleo_dellemc_sc','tripleo_dellemc_powermax', - 'tripleo_dellemc_xtremio', 'tripleo_netapp','tripleo_nfs','Veritas_HyperScale'] + 'tripleo_dellemc_vxflexos', 'tripleo_dellemc_xtremio', 'tripleo_netapp','tripleo_nfs','Veritas_HyperScale'] ) end end diff --git a/spec/classes/tripleo_profile_base_cinder_vxflexos_spec.rb b/spec/classes/tripleo_profile_base_cinder_vxflexos_spec.rb new file mode 100644 index 000000000..9ce8bf340 --- /dev/null +++ b/spec/classes/tripleo_profile_base_cinder_vxflexos_spec.rb @@ -0,0 +1,58 @@ +# +# 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_vxflexos' do + shared_examples_for 'tripleo::profile::base::cinder::volume::dellemc_vxflexos' 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_vxflexos') + 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_vxflexos('tripleo_dellemc_vxflexos') + end + end + + context 'with step 4' do + let(:params) { { + :step => 4, + } } + + it 'should trigger complete configuration' do + # TODO(aschultz): check hiera parameters + is_expected.to contain_cinder__backend__dellemc_vxflexos('tripleo_dellemc_vxflexos') + 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_vxflexos' + end + end +end