Add MOS 8.0 support

- The plugin has been totally refactored to accordance with changes in
   OpenStack Liberty and MOS 8.0
 - All documented features of NetApp Cinder Driver are configurable
 - Plugin can change Cinder settings after deployment with wrong
   parameters. It requires manual actions
 - Defined type (backend::netapp) form upstream puppet cinder module is
   not used because is outdated and doesn't support last changes in
   Cinder NetApp driver
 - Added a tasks that deletes not existed cinder services

Change-Id: Ic70ad0a99c41860502e15fe8671e6ca3f11e9f58
This commit is contained in:
Andrey Volochay 2016-03-17 18:38:33 +03:00
parent e29fccef3e
commit d15dbb3704
25 changed files with 488 additions and 700 deletions

6
components.yaml Normal file
View File

@ -0,0 +1,6 @@
- name: 'storage:block:backend:netapp'
label: 'Cinder NetApp'
description: 'Cinder with NetApp backend'
compatible:
- name: 'storage:block:backend:ceph'
- name: 'storage:block:backend:lvm'

View File

@ -0,0 +1,25 @@
notice('MODULAR: netapp-compute')
include nova::params
$cinder_netapp = hiera_hash('cinder_netapp', {})
Nova_config <||> ~> service { "$nova::params::compute_service_name": }
if ($cinder_netapp['netapp_storage_protocol']) == 'iscsi' and ($cinder_netapp['use_multipath_for_image_xfer']) {
package { 'multipath-tools': }
nova_config {
'libvirt/iscsi_use_multipath': value => true;
}
}
if ($cinder_netapp['netapp_storage_protocol']) == 'nfs' {
package { 'nfs-common': }
if $cinder_netapp['nfs_mount_options'] {
nova_config {
'libvirt/nfs_mount_options': value => $cinder_netapp['nfs_mount_options'];
}
}
}

View File

@ -0,0 +1,28 @@
notice('MODULAR: netapp-hiera-override')
$cinder_netapp = hiera_hash('cinder_netapp', {})
$multibackend = $cinder_netapp['multibackend']
$hiera_dir = '/etc/hiera/plugins'
$plugin_yaml = 'cinder_netapp.yaml'
$plugin_name = 'cinder_netapp'
$content = inline_template('
storage_hash:
volume_backend_names:
netapp: cinder_netapp
<% if ! @multibackend -%>
volumes_lvm: false
volumes_ceph: false
<% end -%>
')
file { $hiera_dir:
ensure => directory,
}
file { "${hiera_dir}/${plugin_yaml}":
ensure => file,
content => $content,
}

View File

@ -0,0 +1,3 @@
notice('MODULAR: fuel-plugin-cinder-netapp')
class { 'plugin_cinder_netapp': }

View File

@ -1,2 +0,0 @@
$fuel_settings = parseyaml($astute_settings_yaml)
class { 'plugin_cinder_netapp::cinder': }

View File

@ -1,2 +0,0 @@
$fuel_settings = parseyaml($astute_settings_yaml)
class { 'plugin_cinder_netapp::compute': }

View File

@ -1,2 +0,0 @@
$fuel_settings = parseyaml($astute_settings_yaml)
class { 'plugin_cinder_netapp::controller': }

View File

@ -0,0 +1,13 @@
module Puppet::Parser::Functions
newfunction(:get_nfs_shares, :type => :rvalue) do |args|
data = args[0]
nb_share = data['nb_share'].to_i
ip = data['nfs_server_ip']
shares = ''
nb_share.downto(1) { |share|
shares += ip + ':' + data['nfs_server_share' + share.to_s] + "\n"
}
return shares
end
end

View File

@ -1,28 +1,20 @@
# this can be used to insert into cinder_iscsi section lvm configuration parameters
#
# [iscsi_ip_address] The IP address that the iSCSI daemon is listening on
# [iscsi_helper] iSCSI target user-land tool to use
# [volume_group] Name for the VG that will contain exported volumes
#
# === Examples
#
# class { 'plugin_cinder_netapp::backend::iscsi':
# $iscsi_ip_address = '127.0.0.1',
# $iscsi_helper,
# $volume_group = 'cinder' ,
# }
#
class plugin_cinder_netapp::backend::iscsi (
$volume_group = 'cinder',
$iscsi_ip_address = $::internal_address,
$iscsi_helper = $::cinder::params::iscsi_helper,
) {
$volume_group = 'cinder',
$iscsi_helper = $cinder::params::iscsi_helper,
$backend_type,
) inherits cinder::params {
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$storage_address = get_network_role_property('cinder/iscsi', 'ipaddr')
cinder_config {
'cinder_iscsi/volume_backend_name': value => 'cinder_iscsi';
'cinder_iscsi/iscsi_ip_address': value => $iscsi_ip_address;
'cinder_iscsi/volume_backend_name': value => $backend_type;
'cinder_iscsi/volume_driver': value => 'cinder.volume.drivers.lvm.LVMVolumeDriver';
'cinder_iscsi/iscsi_helper': value => $iscsi_helper;
'cinder_iscsi/volume_group': value => $volume_group;
'cinder_iscsi/iscsi_ip_address': value => $storage_address;
'cinder_iscsi/backend_host': value => $storage_address;
}
}

View File

@ -1,66 +1,91 @@
# this can be used to create a netapp volume backend for cinder
#
# [section] name of the section of cinder.conf on which netapp parameters should be inserted
# [backends] name of the other backends in a multibackend config (optional)
#
# === Examples
#
# plugin_cinder_netapp::backend::netapp{ 'netapp':
# backends => Lvm1,
# }
#
# Defined type form upstream puppet cinder module is not used because is outdated and doesn't support last changes in Cinder NetApp driver.
define plugin_cinder_netapp::backend::netapp (
$section = $name,
$backends = '',
$backend_name = 'cinder_netapp',
$mutlibackends = false,
$cinder_node = false,
$netapp_backend_name = $name,
$cinder_netapp = $plugin_cinder_netapp::params::cinder_netapp,
$backend_name = undef,
$nfs_shares_config = '/etc/cinder/shares.conf',
) {
include cinder::client
include plugin_cinder_netapp::params
include cinder::params
# Ensure that $ symbole is correctly escaped in netapp password
$netapp_password = regsubst($::fuel_settings['cinder_netapp']['netapp_password'],'\$','$$','G')
cinder::backend::netapp { $backend_name:
volume_backend_name => $section,
netapp_login => $::fuel_settings['cinder_netapp']['netapp_login'],
netapp_password => $netapp_password,
netapp_server_hostname => $::fuel_settings['cinder_netapp']['netapp_server_hostname'],
netapp_server_port => $::fuel_settings['cinder_netapp']['netapp_server_port'],
netapp_transport_type => $::fuel_settings['cinder_netapp']['netapp_transport_type'],
netapp_storage_family => $::fuel_settings['cinder_netapp']['netapp_storage_family'],
netapp_storage_protocol => $::fuel_settings['cinder_netapp']['netapp_storage_protocol'],
netapp_vserver => $::fuel_settings['cinder_netapp']['netapp_vserver'],
netapp_controller_ips => $::fuel_settings['cinder_netapp']['netapp_controller_ips'],
netapp_sa_password => $::fuel_settings['cinder_netapp']['netapp_sa_password'],
netapp_storage_pools => $::fuel_settings['cinder_netapp']['netapp_storage_pools'],
netapp_size_multiplier => $::fuel_settings['cinder_netapp']['netapp_size_multiplier'],
netapp_vfiler => $::fuel_settings['cinder_netapp']['netapp_vfiler'],
netapp_volume_list => $::fuel_settings['cinder_netapp']['netapp_volume_list'],
expiry_thres_minutes => $::fuel_settings['cinder_netapp']['expiry_thres_minutes'],
thres_avl_size_perc_start => $::fuel_settings['cinder_netapp']['thres_avl_size_perc_start'],
thres_avl_size_perc_stop => $::fuel_settings['cinder_netapp']['thres_avl_size_perc_stop'],
netapp_copyoffload_tool_path => $::fuel_settings['cinder_netapp']['netapp_copyoffload_tool_path'],
nfs_mount_options => $::fuel_settings['cinder_netapp']['nfs_mount_options'],
}
$index = $::fuel_settings['cinder_netapp']['nb_share']
if $mutlibackends {
cinder_config {
'DEFAULT/enabled_backends': value => "${backends},${backend_name}";
}
if ($cinder_netapp['multibackend']) {
$enabled_backends = "$backend_name,$netapp_backend_name"
} else {
cinder_config {
'DEFAULT/enabled_backends': value => "${backend_name}";
$enabled_backends = $netapp_backend_name
}
if ($cinder_netapp['netapp_storage_family']) == 'eseries' {
$host_type = $cinder_netapp['netapp_eseries_host_type']
} else {
$host_type = $cinder_netapp['netapp_host_type']
}
if ($cinder_netapp['netapp_lun_space_reservation']) {
$lun_space_reservation = 'enabled'
} else {
$lun_space_reservation = 'disabled'
}
# To set up NFS shares
if ($cinder_netapp['netapp_storage_protocol']) == 'nfs' {
package { 'nfs-common': }
$shares = get_nfs_shares($cinder_netapp)
file { $nfs_shares_config:
content => $shares,
notify => Service["$cinder::params::volume_service"],
}
}
if $cinder_node {
plugin_cinder_netapp::backend::share{ "share-${index}":
index => $index
# To have an ability to create a root volume during an instance spawning
if ($cinder_netapp['netapp_storage_protocol']) == 'iscsi' {
package { 'open-iscsi': }
if ($cinder_netapp['use_multipath_for_image_xfer']) {
package { 'multipath-tools': }
}
}
# Ensure that $ symbol is correctly escaped in netapp password
$netapp_password = regsubst($cinder_netapp['netapp_password'],'\$','$$','G')
Cinder_config <||> ~> service { "$cinder::params::scheduler_service": } ~> service { "$cinder::params::volume_service": }
cinder_config {
'DEFAULT/enabled_backends': value => $enabled_backends;
'DEFAULT/scheduler_driver': value => 'cinder.scheduler.filter_scheduler.FilterScheduler';
"$netapp_backend_name/volume_backend_name": value => 'cinder_netapp';
"$netapp_backend_name/volume_driver": value => 'cinder.volume.drivers.netapp.common.NetAppDriver';
"$netapp_backend_name/netapp_login": value => $cinder_netapp['netapp_login'];
"$netapp_backend_name/netapp_password": value => $netapp_password;
"$netapp_backend_name/netapp_server_hostname": value => $cinder_netapp['netapp_server_hostname'];
"$netapp_backend_name/netapp_server_port": value => $cinder_netapp['netapp_server_port'];
"$netapp_backend_name/netapp_transport_type": value => $cinder_netapp['netapp_transport_type'];
"$netapp_backend_name/netapp_storage_family": value => $cinder_netapp['netapp_storage_family'];
"$netapp_backend_name/netapp_storage_protocol": value => $cinder_netapp['netapp_storage_protocol'];
"$netapp_backend_name/netapp_vserver": value => $cinder_netapp['netapp_vserver'];
"$netapp_backend_name/netapp_vfiler": value => $cinder_netapp['netapp_vfiler'];
"$netapp_backend_name/netapp_controller_ips": value => $cinder_netapp['netapp_controller_ips'];
"$netapp_backend_name/netapp_sa_password": value => $cinder_netapp['netapp_sa_password'];
"$netapp_backend_name/netapp_webservice_path": value => '/devmgr/v2';
"$netapp_backend_name/nfs_shares_config": value => $nfs_shares_config;
"$netapp_backend_name/thres_avl_size_perc_start": value => $cinder_netapp['thres_avl_size_perc_start'];
"$netapp_backend_name/thres_avl_size_perc_stop": value => $cinder_netapp['thres_avl_size_perc_stop'];
"$netapp_backend_name/expiry_thres_minutes": value => $cinder_netapp['expiry_thres_minutes'];
"$netapp_backend_name/netapp_copyoffload_tool_path": value => $cinder_netapp['netapp_copyoffload_tool_path'];
"$netapp_backend_name/netapp_host_type": value => $host_type;
"$netapp_backend_name/netapp_lun_space_reservation": value => $lun_space_reservation;
"$netapp_backend_name/netapp_lun_ostype": value => $cinder_netapp['netapp_lun_ostype'];
"$netapp_backend_name/use_multipath_for_image_xfer": value => $cinder_netapp['use_multipath_for_image_xfer'];
"$netapp_backend_name/netapp_enable_multiattach": value => $cinder_netapp['netapp_enable_multiattach'];
"$netapp_backend_name/netapp_pool_name_search_pattern": value => $cinder_netapp['netapp_pool_name_search_pattern'];
"$netapp_backend_name/reserved_percentage": value => $cinder_netapp['reserved_percentage'];
"$netapp_backend_name/max_oversubscription_ratio": value => $cinder_netapp['max_oversubscription_ratio'];
"$netapp_backend_name/nfs_mount_options": value => $cinder_netapp['nfs_mount_options'];
"$netapp_backend_name/backend_host": value => 'str:netapp'; # for NetApp HA
}
}

View File

@ -1,29 +1,3 @@
# this can be used to insert into cinder_rbd section rbd configuration parameters
#
# [rbd_pool] The RADOS pool where rbd volumes are stored
# [rbd_user] The RADOS client name for accessing rbd volumes
# [rbd_ceph_conf] Path to the ceph configuration file
# [rbd_flatten_volume_from_snapshot] Flatten volumes created from snapshots to remove dependency
# [rbd_secret_uuid] The libvirt uuid of the secret for the rbd_user volumes
# [volume_tmp_dir] Directory where temporary image files are stored when the
# volume driver does not write them directly to the volume)
# [rbd_max_clone_depth] Maximum number of nested volume clones that are taken before
# a flatten occurs. Set to 0 to disable cloning.
# [glance_api_version] Version of the glance API to use
#
# === Examples
#
# class { 'plugin_cinder_netapp::backend::rbdi':
# $rbd_pool = 'volumes',
# $rbd_user = 'volumes',
# $rbd_ceph_conf = '/etc/ceph/ceph.conf',
# $rbd_flatten_volume_from_snapshot = false,
# $rbd_secret_uuid = 'a5d0dd94-57c4-ae55-ffe0-7e3732a24455',
# $volume_tmp_dir = false,
# $rbd_max_clone_depth = '5',
# $glance_api_version = undef,
# }
#
class plugin_cinder_netapp::backend::rbd (
$rbd_pool = 'volumes',
$rbd_user = 'volumes',
@ -33,17 +7,18 @@ class plugin_cinder_netapp::backend::rbd (
$volume_tmp_dir = false,
$rbd_max_clone_depth = '5',
$glance_api_version = undef,
$backend_type,
) {
cinder_config {
'cinder_rbd/volume_backend_name': value => 'cinder_rbd';
'cinder_rbd/volume_backend_name': value => $backend_type;
'cinder_rbd/volume_driver': value => 'cinder.volume.drivers.rbd.RBDDriver';
'cinder_rbd/rbd_ceph_conf': value => $rbd_ceph_conf;
'cinder_rbd/rbd_user': value => $rbd_user;
'cinder_rbd/rbd_pool': value => $rbd_pool;
'cinder_rbd/rbd_max_clone_depth': value => $rbd_max_clone_depth;
'cinder_rbd/rbd_flatten_volume_from_snapshot': value => $rbd_flatten_volume_from_snapshot;
'cinder_rbd/host': value => "rbd:${rbd_pool}";
'cinder_rbd/backend_host': value => "rbd:${rbd_pool}";
}
}

View File

@ -1,34 +0,0 @@
# this can be used to create recursively in shares for netapp volume backend
# [index] index of the current share
# [shares] shares previously created of the following format <ip>:<share1>\n><ip>:<share2>\n....
#
# === Examples
#
# plugin_cinder_netapp::backend::share{ 'share1':
# index => 1,
# shares => 192.168.0.3:/vol1\n
# }
#
define plugin_cinder_netapp::backend::share (
$index,
$shares = '',
) {
$ip = $::fuel_settings['cinder_netapp']['nfs_server_ip']
$share = $::fuel_settings['cinder_netapp']["nfs_server_share${index}"]
$minus1 = inline_template('<%= index.to_i - 1 %>')
if ($minus1 == '0') {
# last share is reached, write information into shares.conf
file { '/etc/cinder/shares.conf':
content => "${ip}:${share}\n${shares}"
} ~>
service { $::cinder::params::volume_service: }
} else {
# recurse until index 1 is reached
plugin_cinder_netapp::backend::share { "share-${minus1}":
index => $minus1,
shares => "${ip}:${share}\n${shares}",
}
}
}

View File

@ -1,22 +0,0 @@
# The plugin_cinder_netapp class is able to inder to use netapp as a storage backend
# (7Mode and cluster mode storage familly). If the multibackend option is checked
# cinder will used the netapp backend and the ceph or lvm (according to intial configuration)
# as multibackend storage
#
class plugin_cinder_netapp::cinder (
$cinder_hash = $::fuel_settings['cinder'],
) {
include plugin_cinder_netapp::params
if $::fuel_settings['cinder_netapp']['multibackend'] {
class { 'plugin_cinder_netapp::multibackend_cinder': }
} else {
$section = 'DEFAULT'
plugin_cinder_netapp::backend::netapp{ 'cinder_netapp':
section => $section,
cinder_node => true,
}
}
}

View File

@ -1,82 +0,0 @@
# ==Define: plugin_cinder_netapp::cinder::type
#
# #TODO to remove when https://bugs.launchpad.net/fuel/+bug/1461485 will be fix
# Creates cinder type and assigns backends.
#
# === Parameters
#
# [*os_password*]
# (required) The keystone tenant:username password.
#
# [*set_key*]
# (optional) Must be used with set_value. Accepts a single string be used
# as the key in type_set
#
# [*set_value*]
# (optional) Accepts list of strings or singular string. A list of values
# passed to type_set
#
# [*os_tenant_name*]
# (optional) The keystone tenant name. Defaults to 'admin'.
#
# [*os_username*]
# (optional) The keystone user name. Defaults to 'admin.
#
# [*os_auth_url*]
# (optional) The keystone auth url. Defaults to 'http://127.0.0.1:5000/v2.0/'.
#
# [*os_region_name*]
# (optional) The keystone region name. Default is unset.
#
# Author: Andrew Woodward <awoodward@mirantis.com>
define plugin_cinder_netapp::cinder::type (
$os_password,
$volume_name = $name,
$set_key = undef,
$set_value = undef,
$os_tenant_name = 'admin',
$os_username = 'admin',
$os_auth_url = 'http://127.0.0.1:5000/v2.0/',
$os_region_name = undef,
) {
# TODO: (xarses) This should be moved to a ruby provider so that among other
# reasons, the credential discovery magic can occur like in neutron.
$cinder_env = [
"OS_TENANT_NAME=${os_tenant_name}",
"OS_USERNAME=${os_username}",
"OS_PASSWORD=${os_password}",
"OS_AUTH_URL=${os_auth_url}",
]
if $os_region_name {
$region_env = ["OS_REGION_NAME=${os_region_name}"]
}
else {
$region_env = []
}
exec { "cinder type-create ${volume_name}":
command => "cinder type-create ${volume_name}",
unless => "cinder type-list | grep -qP '\\b${volume_name}\\b'",
environment => concat($cinder_env, $region_env),
require => Package['python-cinderclient'],
path => ['/usr/bin', '/bin'],
}
if ($set_value and $set_key) {
Exec["cinder type-create ${volume_name}"] ->
plugin_cinder_netapp::cinder::type_set { $set_value:
type => $volume_name,
key => $set_key,
os_password => $os_password,
os_tenant_name => $os_tenant_name,
os_username => $os_username,
os_auth_url => $os_auth_url,
os_region_name => $os_region_name,
}
}
}

View File

@ -1,67 +0,0 @@
# ==Define: plugin_cinder_netapp::cinder::type_set
#
# #TODO to remove when https://bugs.launchpad.net/fuel/+bug/1461485 will be fix
# Assigns keys after the volume type is set.
#
# === Parameters
#
# [*os_password*]
# (required) The keystone tenant:username password.
#
# [*type*]
# (required) Accepts single name of type to set.
#
# [*key*]
# (required) the key name that we are setting the value for.
#
# [*os_tenant_name*]
# (optional) The keystone tenant name. Defaults to 'admin'.
#
# [*os_username*]
# (optional) The keystone user name. Defaults to 'admin.
#
# [*os_auth_url*]
# (optional) The keystone auth url. Defaults to 'http://127.0.0.1:5000/v2.0/'.
#
# [*os_region_name*]
# (optional) The keystone region name. Default is unset.
#
# Author: Andrew Woodward <awoodward@mirantis.com>
define plugin_cinder_netapp::cinder::type_set (
$type,
$key,
$os_password,
$os_tenant_name = 'admin',
$os_username = 'admin',
$os_auth_url = 'http://127.0.0.1:5000/v2.0/',
$os_region_name = undef,
) {
# TODO: (xarses) This should be moved to a ruby provider so that among other
# reasons, the credential discovery magic can occur like in neutron.
$cinder_env = [
"OS_TENANT_NAME=${os_tenant_name}",
"OS_USERNAME=${os_username}",
"OS_PASSWORD=${os_password}",
"OS_AUTH_URL=${os_auth_url}",
]
if $os_region_name {
$region_env = ["OS_REGION_NAME=${os_region_name}"]
}
else {
$region_env = []
}
exec {"cinder type-key ${type} set ${key}=${name}":
path => ['/usr/bin', '/bin'],
command => "cinder type-key ${type} set ${key}=${name}",
unless => "cinder extra-specs-list | grep -Eq '\\b${type}\\b.*\\b${key}\\b.*\\b${name}\\b'",
environment => concat($cinder_env, $region_env),
require => Package['python-cinderclient']
}
}

View File

@ -1,37 +0,0 @@
# This can be used to install on compute required depedencies to use netapp volume
#
class plugin_cinder_netapp::compute {
include cinder::params
$cinder_hash = $::fuel_settings['cinder']
case $::osfamily {
'Debian': {
package { 'nfs-common':
}
}
'RedHat': {
package { 'nfs-utils': } ->
service {'rpcbind':
ensure => running,
} ->
service {'rpcidmapd':
ensure => running,
} ->
service {'nfs':
ensure => running,
}
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports osfamily RedHat and Debian")
}
}
if $::fuel_settings['cinder_netapp']['nfs_mount_options'] {
nova_config {
'DEFAULT/nfs_mount_options': value => $::fuel_settings['cinder_netapp']['nfs_mount_options'];
}
}
}

View File

@ -1,28 +0,0 @@
# The plugin_cinder_netapp class is able to cinder to use netapp as a storage backend
# (7Mode and cluster mode storage familly). If the multibackend option is checked
# cinder will used the netapp backend and the ceph or lvm (according to intial configuration)
# as multibackend storage
#
class plugin_cinder_netapp::controller {
include plugin_cinder_netapp::params
cinder_config {
'DEFAULT/host': value => 'str:netapp';
}
$cinder_hash = $::fuel_settings['cinder']
if $::fuel_settings['cinder_netapp']['multibackend'] {
class { 'plugin_cinder_netapp::multibackend_controller':
cinder_user_password => $cinder_hash['user_password'],
auth_host => hiera('management_vip', undef),
}
} else {
$section = 'DEFAULT'
plugin_cinder_netapp::backend::netapp{ 'cinder_netapp':
section => $section,
}
}
}

View File

@ -0,0 +1,11 @@
class plugin_cinder_netapp (
$cinder_netapp = $plugin_cinder_netapp::params::cinder_netapp,
) inherits plugin_cinder_netapp::params {
if ($cinder_netapp['multibackend']) {
class { 'plugin_cinder_netapp::multibackend': }
} else {
plugin_cinder_netapp::backend::netapp { 'cinder_netapp': }
}
}

View File

@ -0,0 +1,14 @@
class plugin_cinder_netapp::multibackend (
$backend_name = $plugin_cinder_netapp::params::backend_name,
$backend_type = $plugin_cinder_netapp::params::backend_type,
$backend_class = $plugin_cinder_netapp::params::backend_class,
) inherits plugin_cinder_netapp::params {
class { $backend_class:
backend_type => $backend_type,
} ->
plugin_cinder_netapp::backend::netapp { 'cinder_netapp':
backend_name => $backend_name,
}
}

View File

@ -1,16 +0,0 @@
# this can be used to insert into cinder_iscsi section lvm configuration parameters
#
class plugin_cinder_netapp::multibackend_cinder {
include plugin_cinder_netapp::params
include cinder::params
class { $plugin_cinder_netapp::params::backend_class: } ->
plugin_cinder_netapp::backend::netapp{ 'cinder_netapp':
backends => $plugin_cinder_netapp::params::backends,
mutlibackends => true,
cinder_node => true,
}
}

View File

@ -1,59 +0,0 @@
# this can be used to insert into cinder_iscsi section lvm configuration parameters
# and setup multibackend configuration controller
#
# [$cinder_user_password] password of the cinder user
# [$keystone_tenant] tenant services
# [$keystone_user] name of the cinder user
# [$keystone_auth_protocol] auth protocol for keystone
# [$auth_host] ip/hostname for authentication endpoint
# [$keystone_auth_port] port for keystone
#
# === Examples
#
# class { 'plugin_cinder_netapp::backend::iscsi':
# $cinder_user_password = 'password',
# $keystone_tenant = 'services',
# $keystone_user = 'cinder',
# $keystone_auth_protocol = 'http',
# $auth_host = '127.0.0.1',
# $keystone_auth_port = '35357', ,
# }
#
class plugin_cinder_netapp::multibackend_controller (
$cinder_user_password,
$auth_host,
$keystone_tenant = 'services',
$keystone_user = 'cinder',
$keystone_auth_protocol = 'http',
$keystone_auth_port = '35357',
$os_region_name = 'RegionOne',
$os_auth_url = "${keystone_auth_protocol}://${auth_host}:${keystone_auth_port}/v2.0/",
) {
include plugin_cinder_netapp::params
include cinder::params
Plugin_cinder_netapp::Cinder::Type {
os_password => $cinder_user_password,
os_tenant_name => $keystone_tenant,
os_username => $keystone_user,
os_auth_url => $os_auth_url,
os_region_name => $os_region_name,
}
#TODO use type from cinder module when bug 1461485 is fix
class { $plugin_cinder_netapp::params::backend_class: } ->
plugin_cinder_netapp::backend::netapp{ 'cinder_netapp':
backends => $plugin_cinder_netapp::params::backends,
mutlibackends => true,
} ->
plugin_cinder_netapp::cinder::type { 'netapp':
set_key => 'volume_backend_name',
set_value => 'cinder_netapp',
} ->
plugin_cinder_netapp::cinder::type { $plugin_cinder_netapp::params::backends:
set_key => 'volume_backend_name',
set_value => $plugin_cinder_netapp::params::backends,
}
}

View File

@ -1,38 +1,19 @@
class plugin_cinder_netapp::params {
class plugin_cinder_netapp::params (
) {
include cinder::params
$cinder_netapp = hiera_hash('cinder_netapp', {})
$storage_hash = hiera_hash('storage_hash', {})
$cinder_hash = $::fuel_settings['cinder']
$storage_hash = $::fuel_settings['storage']
case $::osfamily {
'Debian': {
package { 'nfs-common':
before => Cinder::Backend::Netapp['cinder_netapp'],
}
}
'RedHat': {
package { 'nfs-utils': } ->
service {'rpcbind':
ensure => running,
} ->
service {'rpcidmapd':
ensure => running,
} ->
service {'nfs':
ensure => running,
before => Cinder::Backend::Netapp['cinder_netapp'],
}
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports osfamily RedHat and Debian")
}
}
if ($storage_hash['volumes_lvm']) {
$backends = 'cinder_iscsi'
$backend_class = 'plugin_cinder_netapp::backend::iscsi'
} elsif ($storage_hash['volumes_ceph']) {
$backends = 'cinder_rbd'
$backend_class = 'plugin_cinder_netapp::backend::rbd'
if ($storage_hash['volume_backend_names']['volumes_lvm']) {
$backend_type = $storage_hash['volume_backend_names']['volumes_lvm']
$backend_name = 'cinder_iscsi'
$volume_backend_name = 'volumes_lvm'
$backend_class = 'plugin_cinder_netapp::backend::iscsi'
} elsif ($storage_hash['volume_backend_names']['volumes_ceph']) {
$backend_type = $storage_hash['volume_backend_names']['volumes_ceph']
$backend_name = 'cinder_rbd'
$volume_backend_name = 'volumes_ceph'
$backend_class = 'plugin_cinder_netapp::backend::rbd'
}
}

View File

@ -1,30 +1,44 @@
# Deployment tasks
- id: controller-netapp
- id: netapp_hiera_override
type: puppet
role: [primary-controller, controller]
required_for: [post_deployment_end]
requires: [post_deployment_start]
version: 2.0.0
groups: [primary-controller, controller]
requires: [openstack-cinder, deploy_start]
required_for: [create-cinder-types, deploy_end]
parameters:
puppet_manifest: puppet/manifests/site_controller.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
puppet_manifest: puppet/manifests/hiera_override.pp
puppet_modules: /etc/puppet/modules
timeout: 360
- id: compute-netapp
- id: netapp_cinder
type: puppet
role: [compute]
required_for: [post_deployment_end]
requires: [post_deployment_start]
version: 2.0.0
groups: [cinder]
requires: [top-role-cinder, deploy_start]
required_for: [deploy_end]
parameters:
puppet_manifest: puppet/manifests/site_compute.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
puppet_manifest: puppet/manifests/site.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 360
- id: cinder-netapp
- id: netapp_compute
type: puppet
role: [cinder]
required_for: [post_deployment_end]
requires: [post_deployment_start]
version: 2.0.0
groups: [compute]
requires: [top-role-compute, deploy_start]
required_for: [deploy_end]
parameters:
puppet_manifest: puppet/manifests/site_cinder.pp
puppet_modules: "puppet/modules/:/etc/puppet/modules/"
puppet_manifest: puppet/manifests/compute.pp
puppet_modules: /etc/puppet/modules
timeout: 360
- id: deleting_old_cinder_volume_services
type: shell
version: 2.0.0
role: [primary-controller]
requires: [post_deployment_start]
required_for: [post_deployment_end]
parameters:
cmd: . /root/openrc && for host in $(cinder service-list | grep 'cinder-volume.*enabled.*down' | awk '{ print $4}'); do cinder-manage service remove cinder-volume $host; done
retries: 3
interval: 20
timeout: 180

View File

@ -1,264 +1,320 @@
attributes:
metadata:
group: 'storage'
multibackend:
value: false
label: 'Multibackend enabled'
label: 'Multibackend Enabled'
description: 'NetApp driver will be used as a Cinder Multibackend feature'
weight: 35
type: "checkbox"
weight: 10
type: 'checkbox'
# Storage Type
netapp_storage_family:
value: "ontap_cluster"
value: 'ontap_cluster'
values:
- data: "ontap_cluster"
label: "Ontap Cluster"
description: "Data ONTAP operating in Clustered storage family"
- data: "ontap_7mode"
label: "Ontap 7mode"
description: "Data ONTAP operating in 7Mode storage family"
- data: "eseries"
label: "E-Series"
description: "E-Series storage family"
label: "Netapp storage family"
weight: 40
type: "radio"
- data: 'ontap_cluster'
label: 'Ontap Cluster'
description: 'Data ONTAP operating in Clustered storage family'
- data: 'ontap_7mode'
label: 'Ontap 7-Mode'
description: 'Data ONTAP operating in 7-Mode storage family'
- data: 'eseries'
label: 'E-Series'
description: 'E-Series storage family'
label: 'Netapp Storage Family'
weight: 11
type: 'radio'
netapp_storage_protocol:
value: "iscsi"
value: 'iscsi'
values:
- data: "iscsi"
label: "iscsi"
description: ""
- data: "nfs"
label: "nfs"
description: ""
- data: 'iscsi'
label: 'iSCSI'
description: ''
- data: 'nfs'
label: 'NFS'
description: ''
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value == 'eseries'"
action: "hide"
label: "Netapp storage protocol"
action: 'hide'
label: 'Netapp Storage Protocol'
description: 'The storage protocol to be used on the data path with the storage system'
weight: 42
type: "radio"
weight: 12
type: 'radio'
# Authorisation
netapp_login:
value: ''
label: 'Username'
description: 'Administrative user account name used to access the storage system or proxy server.'
weight: 45
type: "text"
description: 'Administrative user account name used to access the storage system or proxy server'
weight: 21
type: 'text'
netapp_password:
value: ''
label: 'Password'
description: 'Password for the administrative user account specified in the netapp_login option.'
weight: 46
type: "password"
description: 'Password for the administrative user account'
weight: 22
type: 'password'
# Connection
netapp_server_hostname:
value: ''
label: 'NetApp Hostname/IP'
description: 'The hostname (or IP address) for the storage system or proxy server.'
weight: 55
type: "text"
label: 'NetApp Hostname'
description: 'The hostname or IP address for the storage system or proxy server'
weight: 31
type: 'text'
netapp_server_port:
value: ''
label: 'NetApp server port'
description: 'The TCP port to use for communication with the storage system or proxy server. If not specified, Data ONTAP drivers will use 80 for HTTP and 443 for HTTPS; E-Series will use 8080 for HTTP and 8443 for HTTPS.'
weight: 56
type: "text"
label: 'NetApp Server Port'
description: 'The TCP port to use for communication with the storage system or proxy server. If not specified, Data ONTAP drivers will use 80 for HTTP and 443 for HTTPS; E-Series will use 8080 for HTTP and 8443 for HTTPS'
weight: 32
type: 'text'
netapp_transport_type:
value: "http"
value: 'http'
values:
- data: "http"
label: "http"
description: ""
- data: "https"
label: "https"
description: ""
label: "Netapp transport type"
- data: 'http'
label: 'http'
description: ''
- data: 'https'
label: 'https'
description: ''
label: 'Netapp Transport Type'
description: 'The transport protocol used for communication with the storage system or proxy server'
weight: 57
type: "radio"
weight: 33
type: 'radio'
# NFS
# NFS Shares
nfs_server_ip:
value: ''
label: 'NetApp NFS server'
description: 'The hostname (or IP address) for NFS server started on NetApp apliance'
weight: 70
type: "text"
description: 'The hostname or IP address for NFS server started on NetApp apliance'
weight: 41
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
action: 'hide'
nb_share:
type: "select"
weight: 71
value: "1"
label: "NFS shares"
description: "Number of Netapp NFS shares"
type: 'select'
weight: 42
value: '1'
label: 'NFS shares'
description: 'Number of Netapp NFS shares'
values:
- data: "1"
label: "1"
- data: "2"
label: "2"
- data: "3"
label: "3"
- data: "4"
label: "4"
- data: '1'
label: '1'
- data: '2'
label: '2'
- data: '3'
label: '3'
- data: '4'
label: '4'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
action: 'hide'
nfs_server_share1:
value: ''
label: 'NFS share'
description: 'The NFS share path (e.g. /vol2)'
weight: 72
type: "text"
description: 'The NFS share path (e.g. /vol1)'
weight: 43
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
action: 'hide'
nfs_server_share2:
value: ''
label: 'NFS share 2'
description: 'The NFS share path (e.g. /vol2)'
weight: 73
type: "text"
weight: 44
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs' or settings:cinder_netapp.nb_share.value != '2' and settings:cinder_netapp.nb_share.value != '3' and settings:cinder_netapp.nb_share.value != '4'"
action: "hide"
action: 'hide'
nfs_server_share3:
value: ''
label: 'NFS share 3'
description: 'The NFS share path (e.g. /vol2)'
weight: 74
type: "text"
description: 'The NFS share path (e.g. /vol3)'
weight: 45
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs' or settings:cinder_netapp.nb_share.value != '3' and settings:cinder_netapp.nb_share.value != '4'"
action: "hide"
nfs_server_share4:
value: ''
label: 'NFS share 4'
description: 'The NFS share path (e.g. /vol2)'
weight: 75
type: "text"
description: 'The NFS share path (e.g. /vol4)'
weight: 46
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs' or settings:cinder_netapp.nb_share.value != '4'"
action: "hide"
expiry_thres_minutes:
value: '720'
label: 'NFS expiry thres minutes'
description: 'This option specifies the threshold for last access time for images in the NFS image cache (NFS protocol only)'
weight: 76
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
thres_avil_size_perc_start:
value: '20'
label: 'NFS thres avl size perc start'
description: 'The percentage of available space from which the NFS image cache will be cleaned (NFS protocol only)'
weight: 77
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
thres_avil_size_perc_stop:
value: '60'
label: 'NFS thres avl size perc stop'
description: 'The percentage of available space from which the driver will stop cleaning the NFS image cache (NFS protocol only)'
weight: 78
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
nfs_mount_options:
value: ''
label: 'NFS mount options'
description: '(Optional) Will be used when mouning shares on the Storage and Compute nodes'
weight: 79
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
action: 'hide'
# Ontap Cluster
netapp_vserver:
value: ''
label: 'CMode vserver'
description: 'This option specifies the virtual storage server (Vserver) name on the storage cluster on which provisioning of block storage volumes should occur. (Cluster-Mode only and mandatory for NFS Storage protocol)'
weight: 80
type: "text"
label: 'Vserver'
description: 'This option specifies the virtual storage server (Vserver) name on the storage cluster on which provisioning of block storage volumes should occur'
weight: 51
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'ontap_cluster'"
action: "hide"
action: 'hide'
# Ontap Cluster with NFS
netapp_copyoffload_tool_path:
value: ''
label: 'CMode copyoffload tool path'
description: '(Optionnal) This option specifies the path of the Netapp copy offload tool binary (NFS protocol only)'
weight: 81
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs' or settings:cinder_netapp.netapp_storage_family.value != 'ontap_cluster'"
action: "hide"
# Ontap 7Mode with iSCSI
# 7-Mode
netapp_vfiler:
value: ''
label: '7Mode vfiler'
description: '(Optionnal) The vFiler unti on which provisioning of block storage volumes will be done (iSCSI configuration in 7-Mode only)'
weight: 81
type: "text"
label: 'vFiler'
description: '(Optionnal) The vFiler unit on which provisioning of block storage volumes will be done'
weight: 51
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi' or settings:cinder_netapp.netapp_storage_family.value != 'ontap_7mode'"
action: "hide"
netapp_volume_list:
value: ''
label: '7Mode volume list'
description: '(Optionnal) This option is used to restrict provisionning to the specified controller volumes (iSCSI configuration in 7-Mode only)'
weight: 82
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi' or settings:cinder_netapp.netapp_storage_family.value != 'ontap_7mode'"
action: "hide"
# Ontap Cluster or 7Mode with iSCSI
netapp_size_multiplier:
value: '1.2'
label: 'NetApp size multiplier'
description: 'Mutiplication factor used to chack available space on the virtual storage server (iSCSI configuration only)'
weight: 83
type: "text"
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi' or settings:cinder_netapp.netapp_storage_family.value == 'eseries'"
action: "hide"
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'ontap_7mode'"
action: 'hide'
# E-Series
netapp_controller_ips:
value: ''
label: 'E-Series controller IPs'
description: 'This option is used to restrict provisioning to the specified controllers. Specify the value of this option to be a comma separated list of controller hostnames or IP addresses to be used for provisioning.'
weight: 80
type: "text"
label: 'Controller IPs'
description: 'This option is used to restrict provisioning to the specified controllers. Specify the value of this option to be a comma separated list of controller management hostnames or IP addresses to be used for provisioning'
weight: 51
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries' or settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi'"
action: "hide"
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries'"
action: 'hide'
netapp_sa_password:
value: ''
label: 'E-Series storage array password'
description: 'Password for the NetApp E-Series storage array.'
weight: 81
type: "password"
label: 'Storage Array Password'
description: 'Password for the NetApp E-Series storage array'
weight: 52
type: 'password'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries' or settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi'"
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries'"
action: 'hide'
netapp_eseries_host_type:
value: 'linux_dm_mp'
label: 'Host Type'
description: '(Optionnal) This option defines the type of operating system for all initiators that can access a LUN'
weight: 62
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries'"
action: 'hide'
netapp_enable_multiattach:
value: false
label: 'Multiattach'
description: '(Optionnal) This option specifies whether the driver should allow operations that require multiple attachments to a volume'
weight: 63
type: 'checkbox'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries'"
action: "hide"
netapp_storage_pools:
# NFS Options
nfs_mount_options:
value: ''
label: 'E-Series storage pools'
description: 'This option is used to restrict provisioning to the specified storage pools. Only dynamic disk pools are currently supported. Specify the value of this option to be a comma separated list of disk pool names to be used for provisioning.'
weight: 82
type: "text"
label: 'NFS Mount Options'
description: '(Optional) Will be used when mouning shares on the Storage and Compute nodes'
weight: 61
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_family.value != 'eseries' or settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi'"
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: 'hide'
thres_avl_size_perc_start:
value: '20'
label: 'Thres Avl Size Perc Start'
description: '(Optionnal) If the percentage of available space for an NFS share has dropped below the value specified by this option, the NFS image cache will be cleaned'
weight: 62
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: "hide"
thres_avl_size_perc_stop:
value: '60'
label: 'Thres Avl Size Perc Stop'
description: '(Optionnal) When the percentage of available space on an NFS share has reached the percentage specified by this option, the driver will stop clearing files from the NFS image cache'
weight: 63
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: 'hide'
expiry_thres_minutes:
value: '720'
label: 'Expiry Thres Minutes'
description: '(Optionnal) This option specifies the threshold for last access time for images in the NFS image cache'
weight: 64
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs'"
action: 'hide'
# Ontap Cluster with NFS
netapp_copyoffload_tool_path:
value: ''
label: 'Copyoffload Tool Path'
description: '(Optionnal) This option specifies the path of the NetApp copy offload tool binary'
weight: 65
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'nfs' or settings:cinder_netapp.netapp_storage_family.value != 'ontap_cluster'"
action: 'hide'
# iSCSI
netapp_pool_name_search_pattern:
value: '(.+)'
label: 'Pool Search Pattern'
description: '(Optionnal) It is used to restrict provisioning to the specified volume groups or disk pools. Specify the value of this option as a regular expression which will be applied to the names of volume groups or disk pools from the storage backend which represent pools in Cinder'
weight: 61
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi'"
action: "hide"
use_multipath_for_image_xfer:
value: true
label: 'Multipath for Image Xfer'
description: '(Optionnal) Using this option will permit Cinder to use multiple paths for increased bandwidth. It affects Nova settings'
weight: 65
type: 'checkbox'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi'"
action: 'hide'
# iSCSI with ONTAP
netapp_host_type:
value: 'linux'
label: 'Host Type'
description: '(Optionnal) This option defines the type of operating system for all initiators that can access a LUN'
weight: 62
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi' or settings:cinder_netapp.netapp_storage_family.value == 'eseries'"
action: "hide"
netapp_lun_ostype:
value: 'linux'
label: 'LUN OS type'
description: '(Optionnal) This option defines the type of operating system that will access a LUN exported from Data ONTAP'
weight: 63
type: 'text'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi' or settings:cinder_netapp.netapp_storage_family.value == 'eseries'"
action: 'hide'
netapp_lun_space_reservation:
value: true
label: 'LUN Space Reservation'
description: '(Optionnal) This option specifies whether space will be reserved when creating Cinder volumes on NetApp backends using the iSCSI protocol'
weight: 64
type: 'checkbox'
restrictions:
- condition: "settings:cinder_netapp.netapp_storage_protocol.value != 'iscsi' or settings:cinder_netapp.netapp_storage_family.value == 'eseries'"
action: 'hide'
# Common
reserved_percentage:
value: '0'
label: 'Reserved Percentage'
description: '(Optionnal) This option represents the amount of total capacity of a storage pool that will be reserved and cannot be utilized for provisioning Cinder volumes'
weight: 71
type: 'text'
max_oversubscription_ratio:
value: '1.0'
label: 'Oversubscription Ratio'
description: '(Optionnal) This option is defined as a float, and specifies the amount of over-provisioning to allow when thin provisioning is being used in the storage pool. A value of 1.0 will mean that the provisioned capacity will not be able to exceed the total capacity, while larger values will result in increased levels of allowed over-provisioning'
weight: 72
type: 'text'

View File

@ -3,30 +3,26 @@ name: cinder_netapp
# Human-readable name for your plugin
title: Cinder and NetApp integration
# Plugin version
version: 3.2.1
version: '4.0.0'
# Description
description: Enable to use NetApp nfs driver as a Cinder backend
description: Enables using NetApp as a Cinder backend
# Required fuel version
fuel_version: ['7.0']
fuel_version: ['8.0']
authors: ['Mirantis Inc','Orange']
authors: ['Mirantis','Orange']
licenses: ['Apache License Version 2.0']
homepage: 'https://github.com/openstack/fuel-plugin-cinder-netapp'
groups: ['storage::cinder']
groups: ['storage::cinder']
is_hotpluggable: true
# The plugin is compatible with releases in the list
releases:
- os: ubuntu
version: 2015.1.0-7.0
mode: ['ha', 'multinode']
version: liberty-8.0
mode: ['ha']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
- os: centos
version: 2015.1.0-7.0
mode: ['ha', 'multinode']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/centos
# Version of plugin package
package_version: '3.0.0'
package_version: '4.0.0'