Add support for Veritas HyperScale backend
Adding support to deploy Veritas HyperScale backend in Cinder. Change-Id: I316b22f4f7f9f68fe5c46075dc348a70e437fb1d Signed-off-by: abhishek.kane <abhishek.kane@veritas.com>
This commit is contained in:
parent
d358650d6b
commit
c9cd80685e
53
manifests/backend/veritas_hyperscale.pp
Normal file
53
manifests/backend/veritas_hyperscale.pp
Normal file
@ -0,0 +1,53 @@
|
||||
# == define: cinder::backend::veritas_hyperscale
|
||||
#
|
||||
# Configures Cinder to use the Veritas HyperScale Block Storage driver
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*volume_backend_name*]
|
||||
# (optional) The name of the cinder::backend::veritas_hyperscale ressource
|
||||
# Defaults to $name.
|
||||
#
|
||||
# [*extra_options*]
|
||||
# (optional) Hash of extra options to pass to the backend
|
||||
# Defaults to: {}
|
||||
# Example :
|
||||
# { 'veritas_hyperscale_backend/param1' => { 'value' => value1 } }
|
||||
#
|
||||
# [*manage_volume_type*]
|
||||
# (Optional) Whether or not manage Cinder Volume type.
|
||||
# If set to true, a Cinde Volume type will be created
|
||||
# with volume_backend_name=$volume_backend_name key/value.
|
||||
# Defaults to false.
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Abhishek Kane <abhishek.kane@veritas.com>
|
||||
#
|
||||
# === Copyright
|
||||
#
|
||||
# Copyright (c) 2017 Veritas Technologies LLC.
|
||||
#
|
||||
|
||||
define cinder::backend::veritas_hyperscale (
|
||||
$volume_backend_name = $name,
|
||||
$extra_options = {},
|
||||
$manage_volume_type = false,
|
||||
) {
|
||||
|
||||
include ::cinder::deps
|
||||
|
||||
cinder_config {
|
||||
"${name}/volume_backend_name": value => $volume_backend_name;
|
||||
"${name}/volume_driver": value => 'cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver';
|
||||
}
|
||||
|
||||
if $manage_volume_type {
|
||||
cinder_type { $name:
|
||||
ensure => present,
|
||||
properties => ["volume_backend_name=${name}"],
|
||||
}
|
||||
}
|
||||
|
||||
create_resources('cinder_config', $extra_options)
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Add support for Veritas hyperscale backend
|
55
spec/defines/cinder_backend_veritas_hyperscale_spec.rb
Normal file
55
spec/defines/cinder_backend_veritas_hyperscale_spec.rb
Normal file
@ -0,0 +1,55 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'cinder::backend::veritas_hyperscale' do
|
||||
|
||||
let (:title) { 'Veritas_HyperScale' }
|
||||
|
||||
let :params do {
|
||||
:manage_volume_type => true,
|
||||
}
|
||||
end
|
||||
|
||||
shared_examples_for 'veritas_hyperscale volume driver' do
|
||||
it 'configures veritas_hyperscale volume driver' do
|
||||
should contain_cinder_config("#{title}/volume_driver").with_value(
|
||||
'cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver')
|
||||
should contain_cinder_config("#{title}/volume_backend_name").with_value(
|
||||
"#{title}")
|
||||
end
|
||||
|
||||
describe 'veritas_hyperscale backend with additional configuration' do
|
||||
before do
|
||||
params.merge!({:extra_options => {"#{title}/param1" => {'value' => 'value1'}}})
|
||||
end
|
||||
|
||||
it 'configure veritas_hyperscale backend with additional configuration' do
|
||||
is_expected.to contain_cinder_config("#{title}/param1").with({
|
||||
:value => 'value1',
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'veritas_hyperScale backend with cinder type' do
|
||||
before :each do
|
||||
params.merge!({:manage_volume_type => true})
|
||||
end
|
||||
it 'should create type with properties' do
|
||||
should contain_cinder_type("#{title}").with(
|
||||
:ensure => :present, :properties => ["volume_backend_name=#{title}"])
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_configures 'veritas_hyperscale volume driver'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user