Add full support of multi backends
- Added full support of multi backends. The plugin does not overwrite "enabled_backends" option that allows to use it with other plugins for Cinder backends. - Since FilterScheduler is default scheduler driver starting Grizzly, it has been deleted from set up. This change allows to set Cinder or Ceph-OSD roles wherever you need. - Added small changes in site.pp to get free allocation of roles - The code has been refactored and commented, slightly. Change-Id: I117fed67553af4065b3ebd3673a17b51cf42dc9a Closes-Bug: #1581960
This commit is contained in:
parent
382a35ced0
commit
c04fc82947
|
@ -27,6 +27,14 @@ Requirements
|
|||
Release Notes
|
||||
-------------
|
||||
|
||||
**4.2.0**
|
||||
|
||||
* Added full support of multi backends
|
||||
|
||||
* The code has been refactored and commented, slightly
|
||||
|
||||
* Added small changes to get free allocation of roles
|
||||
|
||||
**4.1.1**
|
||||
|
||||
* Fix bug with multibackend when Ceph is used (bug: 1581028)
|
||||
|
|
|
@ -4,7 +4,7 @@ include nova::params
|
|||
|
||||
$cinder_netapp = hiera_hash('cinder_netapp', {})
|
||||
|
||||
Nova_config <||> ~> service { "$nova::params::compute_service_name": }
|
||||
Nova_config <||> ~> Service <||>
|
||||
|
||||
if ($cinder_netapp['netapp_storage_protocol']) == 'iscsi' and ($cinder_netapp['use_multipath_for_image_xfer']) {
|
||||
package { 'multipath-tools': }
|
||||
|
@ -23,3 +23,5 @@ if ($cinder_netapp['netapp_storage_protocol']) == 'nfs' {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
service { "$nova::params::compute_service_name": }
|
||||
|
|
|
@ -1,28 +1,19 @@
|
|||
# Since Fuel 8.0 has its own task to set Cinder volume-types. We add our modifications before this task is executed.
|
||||
|
||||
notice('MODULAR: netapp-hiera-override')
|
||||
|
||||
$cinder_netapp = hiera_hash('cinder_netapp', {})
|
||||
$multibackend = $cinder_netapp['multibackend']
|
||||
$cinder_netapp = hiera_hash('cinder_netapp', {})
|
||||
$default_backend = $cinder_netapp['default_backend']
|
||||
|
||||
$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,
|
||||
content => template('plugin_cinder_netapp/cinder_netapp.yaml.erb'),
|
||||
}
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
notice('MODULAR: fuel-plugin-cinder-netapp')
|
||||
|
||||
class { 'plugin_cinder_netapp': }
|
||||
# The manifest is executed on nodes with cinder role or on nodes with controller role when Ceph is used.
|
||||
if ('cinder' in hiera('roles')) or (!empty(filter_nodes(hiera('nodes'), 'role', 'ceph-osd'))) {
|
||||
class { 'plugin_cinder_netapp': }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
define plugin_cinder_netapp::backend::enable_backend (
|
||||
$config_file = $plugin_cinder_netapp::params::config_file
|
||||
) {
|
||||
|
||||
include plugin_cinder_netapp::params
|
||||
|
||||
ini_subsetting {"enable_${name}_backend":
|
||||
ensure => present,
|
||||
section => 'DEFAULT',
|
||||
key_val_separator => '=',
|
||||
path => $config_file,
|
||||
setting => 'enabled_backends',
|
||||
subsetting => $name,
|
||||
subsetting_separator => ',',
|
||||
}
|
||||
}
|
|
@ -1,20 +1,25 @@
|
|||
class plugin_cinder_netapp::backend::iscsi (
|
||||
$volume_group = 'cinder',
|
||||
$iscsi_helper = $cinder::params::iscsi_helper,
|
||||
$iscsi_helper = 'tgtadm',
|
||||
$backend_type,
|
||||
) inherits cinder::params {
|
||||
$backend_name,
|
||||
) {
|
||||
|
||||
# Get IP address in storage subnet
|
||||
$network_scheme = hiera_hash('network_scheme', {})
|
||||
prepare_network_config($network_scheme)
|
||||
|
||||
$storage_address = get_network_role_property('cinder/iscsi', 'ipaddr')
|
||||
|
||||
# Creates separate section for <LVM over iSCSI> backend
|
||||
cinder_config {
|
||||
'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;
|
||||
"$backend_name/volume_backend_name": value => $backend_type;
|
||||
"$backend_name/volume_driver": value => 'cinder.volume.drivers.lvm.LVMVolumeDriver';
|
||||
"$backend_name/iscsi_helper": value => $iscsi_helper;
|
||||
"$backend_name/volume_group": value => $volume_group;
|
||||
"$backend_name/iscsi_ip_address": value => $storage_address;
|
||||
"$backend_name/backend_host": value => $storage_address;
|
||||
}
|
||||
|
||||
# Adds the backend in <enabled_backends> parameter
|
||||
plugin_cinder_netapp::backend::enable_backend { $backend_name: }
|
||||
}
|
||||
|
|
|
@ -1,34 +1,30 @@
|
|||
# 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 (
|
||||
$netapp_backend_name = $name,
|
||||
$cinder_netapp = $plugin_cinder_netapp::params::cinder_netapp,
|
||||
$backend_name = undef,
|
||||
$nfs_shares_config = '/etc/cinder/shares.conf',
|
||||
class plugin_cinder_netapp::backend::netapp (
|
||||
$netapp_backend_name = 'cinder_netapp',
|
||||
$cinder_netapp = $plugin_cinder_netapp::params::cinder_netapp,
|
||||
$nfs_shares_config = '/etc/cinder/shares.conf',
|
||||
$netapp_webservice_path = '/devmgr/v2',
|
||||
) {
|
||||
|
||||
include plugin_cinder_netapp::params
|
||||
include cinder::params
|
||||
|
||||
if ($cinder_netapp['multibackend']) {
|
||||
$enabled_backends = "$backend_name,$netapp_backend_name"
|
||||
} else {
|
||||
$enabled_backends = $netapp_backend_name
|
||||
}
|
||||
|
||||
# Sets correct parameter for <host_type> depending on storage family
|
||||
if ($cinder_netapp['netapp_storage_family']) == 'eseries' {
|
||||
$host_type = $cinder_netapp['netapp_eseries_host_type']
|
||||
} else {
|
||||
$host_type = $cinder_netapp['netapp_host_type']
|
||||
}
|
||||
|
||||
# NetApp driver does not understand boolean types for <lun_space_reservation> parameter
|
||||
if ($cinder_netapp['netapp_lun_space_reservation']) {
|
||||
$lun_space_reservation = 'enabled'
|
||||
} else {
|
||||
$lun_space_reservation = 'disabled'
|
||||
}
|
||||
|
||||
# To set up NFS shares
|
||||
# Sets up NFS shares
|
||||
if ($cinder_netapp['netapp_storage_protocol']) == 'nfs' {
|
||||
package { 'nfs-common': }
|
||||
|
||||
|
@ -40,7 +36,7 @@ define plugin_cinder_netapp::backend::netapp (
|
|||
}
|
||||
}
|
||||
|
||||
# To have an ability to create a root volume during an instance spawning
|
||||
# We need following packages to create a root volume during an instance spawning
|
||||
if ($cinder_netapp['netapp_storage_protocol']) == 'iscsi' {
|
||||
package { 'open-iscsi': }
|
||||
|
||||
|
@ -49,14 +45,13 @@ define plugin_cinder_netapp::backend::netapp (
|
|||
}
|
||||
}
|
||||
|
||||
# Ensure that $ symbol is correctly escaped in netapp password
|
||||
# To be 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 <||> -> Plugin_cinder_netapp::Backend::Enable_backend[$netapp_backend_name] ~> 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'];
|
||||
|
@ -70,7 +65,7 @@ define plugin_cinder_netapp::backend::netapp (
|
|||
"$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/netapp_webservice_path": value => $netapp_webservice_path;
|
||||
"$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'];
|
||||
|
@ -88,4 +83,8 @@ define plugin_cinder_netapp::backend::netapp (
|
|||
"$netapp_backend_name/backend_host": value => 'str:netapp'; # for NetApp HA
|
||||
}
|
||||
|
||||
# Adds the backend in <enabled_backends> parameter
|
||||
plugin_cinder_netapp::backend::enable_backend { $netapp_backend_name: }
|
||||
|
||||
service { $cinder::params::volume_service: }
|
||||
}
|
||||
|
|
|
@ -8,17 +8,21 @@ class plugin_cinder_netapp::backend::rbd (
|
|||
$rbd_max_clone_depth = '5',
|
||||
$glance_api_version = undef,
|
||||
$backend_type,
|
||||
$backend_name,
|
||||
) {
|
||||
|
||||
# Creates separate section for Ceph backend
|
||||
cinder_config {
|
||||
'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/backend_host': value => "rbd:${rbd_pool}";
|
||||
"$backend_name/volume_backend_name": value => $backend_type;
|
||||
"$backend_name/volume_driver": value => 'cinder.volume.drivers.rbd.RBDDriver';
|
||||
"$backend_name/rbd_ceph_conf": value => $rbd_ceph_conf;
|
||||
"$backend_name/rbd_user": value => $rbd_user;
|
||||
"$backend_name/rbd_pool": value => $rbd_pool;
|
||||
"$backend_name/rbd_max_clone_depth": value => $rbd_max_clone_depth;
|
||||
"$backend_name/rbd_flatten_volume_from_snapshot": value => $rbd_flatten_volume_from_snapshot;
|
||||
"$backend_name/backend_host": value => "rbd:${rbd_pool}";
|
||||
}
|
||||
|
||||
# Adds the backend in <enabled_backends> parameter
|
||||
plugin_cinder_netapp::backend::enable_backend { $backend_name: }
|
||||
}
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
class plugin_cinder_netapp (
|
||||
$cinder_netapp = $plugin_cinder_netapp::params::cinder_netapp,
|
||||
$cinder_netapp = $plugin_cinder_netapp::params::cinder_netapp,
|
||||
$backend_name = $plugin_cinder_netapp::params::backend_name,
|
||||
$backend_type = $plugin_cinder_netapp::params::backend_type,
|
||||
$backend_class = $plugin_cinder_netapp::params::backend_class,
|
||||
$netapp_backend_class = $plugin_cinder_netapp::params::netapp_backend_class,
|
||||
) inherits plugin_cinder_netapp::params {
|
||||
|
||||
if ($cinder_netapp['multibackend']) {
|
||||
class { 'plugin_cinder_netapp::multibackend': }
|
||||
} else {
|
||||
plugin_cinder_netapp::backend::netapp { 'cinder_netapp': }
|
||||
if ($cinder_netapp['default_backend']) {
|
||||
|
||||
Class[$backend_class] -> Class[$netapp_backend_class]
|
||||
|
||||
class { $backend_class:
|
||||
backend_type => $backend_type,
|
||||
backend_name => $backend_name,
|
||||
}
|
||||
}
|
||||
|
||||
class { $netapp_backend_class: }
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
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,
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
class plugin_cinder_netapp::params (
|
||||
) {
|
||||
|
||||
$config_file = '/etc/cinder/cinder.conf'
|
||||
|
||||
$cinder_netapp = hiera_hash('cinder_netapp', {})
|
||||
$storage_hash = hiera_hash('storage_hash', {})
|
||||
|
||||
|
@ -16,4 +18,5 @@ class plugin_cinder_netapp::params (
|
|||
$backend_class = 'plugin_cinder_netapp::backend::rbd'
|
||||
}
|
||||
|
||||
$netapp_backend_class = 'plugin_cinder_netapp::backend::netapp'
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
storage_hash:
|
||||
volume_backend_names:
|
||||
netapp: cinder_netapp
|
||||
<% if ! @default_backend -%>
|
||||
volumes_lvm: false
|
||||
volumes_ceph: false
|
||||
<% end -%>
|
|
@ -1,20 +1,23 @@
|
|||
# The task modifies hiera data to have right set cinder-types
|
||||
- id: netapp_hiera_override
|
||||
type: puppet
|
||||
version: 2.0.0
|
||||
groups: [primary-controller, controller]
|
||||
requires: [openstack-cinder, deploy_start]
|
||||
required_for: [create-cinder-types, deploy_end]
|
||||
groups: [primary-controller, controller, cinder]
|
||||
requires: [hiera]
|
||||
required_for: [create-cinder-types]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/hiera_override.pp
|
||||
puppet_modules: /etc/puppet/modules
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 360
|
||||
|
||||
# The task is executed on controller nodes only in particular cases
|
||||
# See site.pp for more details
|
||||
- id: netapp_cinder
|
||||
type: puppet
|
||||
version: 2.0.0
|
||||
groups: [cinder, ceph-osd]
|
||||
requires: [top-role-cinder, top-role-ceph-osd, deploy_start]
|
||||
required_for: [deploy_end]
|
||||
role: [primary-controller, controller, cinder]
|
||||
requires: [post_deployment_start]
|
||||
required_for: [post_deployment_end]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/site.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
|
@ -24,11 +27,11 @@
|
|||
type: puppet
|
||||
version: 2.0.0
|
||||
groups: [compute]
|
||||
requires: [top-role-compute, deploy_start]
|
||||
requires: [top-role-compute]
|
||||
required_for: [deploy_end]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/compute.pp
|
||||
puppet_modules: /etc/puppet/modules
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 360
|
||||
|
||||
- id: deleting_old_cinder_volume_services
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
attributes:
|
||||
metadata:
|
||||
group: 'storage'
|
||||
multibackend:
|
||||
default_backend:
|
||||
value: false
|
||||
label: 'Multibackend Enabled'
|
||||
description: 'NetApp driver will be used as a Cinder Multibackend feature'
|
||||
label: 'MOS Backend Enabled'
|
||||
description: 'If the option is checked, MOS default backend (LVM over iSCSI\Ceph) will be used along with NetApp'
|
||||
weight: 10
|
||||
type: 'checkbox'
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ name: cinder_netapp
|
|||
# Human-readable name for your plugin
|
||||
title: Cinder and NetApp integration
|
||||
# Plugin version
|
||||
version: '4.1.1'
|
||||
version: '4.2.0'
|
||||
# Description
|
||||
description: Enables using NetApp as a Cinder backend
|
||||
# Required fuel version
|
||||
|
|
Loading…
Reference in New Issue