Code refactoring. Simplified plugin configuration from UI.
Change-Id: I74a7e0f7fea3e19658ed58a66d0e7cc72c072ae8
This commit is contained in:
parent
e9768080bf
commit
7902f8d75f
|
@ -2,6 +2,11 @@ $scaleio = hiera('scaleio')
|
||||||
|
|
||||||
if $scaleio['metadata']['enabled'] {
|
if $scaleio['metadata']['enabled'] {
|
||||||
notify{'ScaleIO plugin enabled': }
|
notify{'ScaleIO plugin enabled': }
|
||||||
|
|
||||||
|
if $::osfamily != 'RedHat' {
|
||||||
|
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports osfamily RedHat")
|
||||||
|
}
|
||||||
|
|
||||||
#TODO: Check that Storage pool has enough space
|
#TODO: Check that Storage pool has enough space
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
class scaleio_fuel::params
|
class scaleio_fuel::params
|
||||||
{
|
{
|
||||||
if $::osfamily != 'RedHat' {
|
# ScaleIO config parameters
|
||||||
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} currently only supports osfamily RedHat")
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get input parameters from the web UI
|
|
||||||
$scaleio = $::fuel_settings['scaleio']
|
$scaleio = $::fuel_settings['scaleio']
|
||||||
$admin_password = $scaleio['password']
|
$admin_password = $scaleio['password']
|
||||||
$gw_password = $scaleio['gw_password']
|
$gw_password = $scaleio['gw_password']
|
||||||
$version = $scaleio['version']
|
$version = 'latest'
|
||||||
$cluster_name = $scaleio['cluster_name']
|
$cluster_name = 'cluster1'
|
||||||
$protection_domain = $scaleio['protection_domain']
|
$protection_domain = 'pd1'
|
||||||
$storage_pool = $scaleio['storage_pool']
|
$storage_pool = 'sp1'
|
||||||
$pool_size = $scaleio['pool_size']
|
$pool_size = "${scaleio['pool_size']}GB"
|
||||||
$device = '/var/sio_device1'
|
$device = '/var/sio_device1'
|
||||||
|
|
||||||
$nodes_hash = $::fuel_settings['nodes']
|
$nodes_hash = $::fuel_settings['nodes']
|
||||||
|
@ -20,9 +16,8 @@ class scaleio_fuel::params
|
||||||
$controller_hashes = nodes_to_hash($controller_nodes,'name','internal_address')
|
$controller_hashes = nodes_to_hash($controller_nodes,'name','internal_address')
|
||||||
$controller_ips = ipsort(values($controller_hashes))
|
$controller_ips = ipsort(values($controller_hashes))
|
||||||
|
|
||||||
notice("controller_nodes: ${controller_nodes}")
|
notify {"Controller Nodes: ${controller_nodes}": }
|
||||||
notice("controller_hashes: ${controller_hashes}")
|
notify {"Controller IPs: ${controller_ips}": }
|
||||||
notice("controller_ips: ${controller_ips}")
|
|
||||||
|
|
||||||
if size($controller_nodes) < 3 {
|
if size($controller_nodes) < 3 {
|
||||||
fail('ScaleIO plugin needs at least 3 controller nodes')
|
fail('ScaleIO plugin needs at least 3 controller nodes')
|
||||||
|
@ -35,29 +30,22 @@ class scaleio_fuel::params
|
||||||
$node_ip = join(values(
|
$node_ip = join(values(
|
||||||
nodes_to_hash($current_node,'name','internal_address')))
|
nodes_to_hash($current_node,'name','internal_address')))
|
||||||
|
|
||||||
notice("Current Node: ${current_node}")
|
notify {"Current Node: ${current_node}": }
|
||||||
|
|
||||||
#TODO: refactor needed
|
case $node_ip {
|
||||||
if $node_ip == $mdm_ip[0] {
|
$mdm_ip[0]: { $role = 'mdm' }
|
||||||
$role = 'mdm'
|
$mdm_ip[1]: { $role = 'mdm' }
|
||||||
}
|
$tb_ip: { $role = 'tb' }
|
||||||
elsif $node_ip == $mdm_ip[1] {
|
default: { $role = 'sds' }
|
||||||
$role = 'mdm'
|
|
||||||
}
|
|
||||||
elsif $node_ip == $tb_ip {
|
|
||||||
$role = 'tb'
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$role = 'sds'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
notice("Node role: ${role}, IP: ${node_ip}, FQDN: ${::fqdn}")
|
notify {"Node role: ${role}, IP: ${node_ip}, FQDN: ${::fqdn}": }
|
||||||
|
|
||||||
$sio_sds_device = get_sds_devices(
|
$sio_sds_device = get_sds_devices(
|
||||||
$nodes_hash, $device, $protection_domain,
|
$nodes_hash, $device, $protection_domain,
|
||||||
$pool_size, $storage_pool)
|
$pool_size, $storage_pool)
|
||||||
|
|
||||||
notice("sio_sds_device: ${sio_sds_device}")
|
notify {"SDS devices: ${sio_sds_device}": }
|
||||||
|
|
||||||
#TODO: Get callhome information from UI
|
#TODO: Get callhome information from UI
|
||||||
$callhome_cfg = {
|
$callhome_cfg = {
|
||||||
|
|
|
@ -7,15 +7,8 @@ attributes:
|
||||||
label: "Admin password"
|
label: "Admin password"
|
||||||
description: "Type ScaleIO Admin password"
|
description: "Type ScaleIO Admin password"
|
||||||
regex:
|
regex:
|
||||||
source: '^[\S]{4,}$'
|
source: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$'
|
||||||
error: "You must provide a password with at least 4 characters"
|
error: "You must provide a password with between 8 and 15 characters, one uppercase, and one number"
|
||||||
|
|
||||||
version:
|
|
||||||
type: "text"
|
|
||||||
weight: 20
|
|
||||||
value: "latest"
|
|
||||||
label: "Version"
|
|
||||||
description: "ScaleIO version"
|
|
||||||
|
|
||||||
gw_password:
|
gw_password:
|
||||||
type: "password"
|
type: "password"
|
||||||
|
@ -24,45 +17,15 @@ attributes:
|
||||||
label: "Gateway password"
|
label: "Gateway password"
|
||||||
description: "Type a password for the gateway"
|
description: "Type a password for the gateway"
|
||||||
regex:
|
regex:
|
||||||
source: '^[\S]{4,}$'
|
source: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$'
|
||||||
error: "You must provide a password with at least 4 characters"
|
error: "You must provide a password with between 8 and 15 characters, one uppercase, and one number"
|
||||||
|
|
||||||
cluster_name:
|
|
||||||
type: "text"
|
|
||||||
weight: 40
|
|
||||||
value: "cluster1"
|
|
||||||
label: "Cluster name"
|
|
||||||
description: "Name of the ScaleIO cluster"
|
|
||||||
regex:
|
|
||||||
source: '\S'
|
|
||||||
error: "Cluster name cannot be empty"
|
|
||||||
|
|
||||||
protection_domain:
|
|
||||||
type: "text"
|
|
||||||
value: "pd1"
|
|
||||||
label: "ScaleIO protection domain"
|
|
||||||
description: "Protection domain for ScaleIO"
|
|
||||||
weight: 45
|
|
||||||
regex:
|
|
||||||
source: '\S'
|
|
||||||
error: "Protection Domain cannot be empty"
|
|
||||||
|
|
||||||
storage_pool:
|
|
||||||
type: "text"
|
|
||||||
value: "sp1"
|
|
||||||
label: "ScaleIO storage pool"
|
|
||||||
description: "First storage pool for ScaleIO"
|
|
||||||
weight: 50
|
|
||||||
regex:
|
|
||||||
source: '\S'
|
|
||||||
error: "Storage Pool cannot be empty"
|
|
||||||
|
|
||||||
pool_size:
|
pool_size:
|
||||||
type: "text"
|
type: "text"
|
||||||
value: "100GB"
|
value: "100"
|
||||||
label: "Storage pool size"
|
label: "Storage pool size (in GB)"
|
||||||
description: "Size of the Storage Pool."
|
description: "Amount in GB that each node will contribute to the storage pool. Please make sure all nodes have enough disk space to allocate the provided amount."
|
||||||
weight: 55
|
weight: 55
|
||||||
# regex:
|
regex:
|
||||||
# source: '(?<sizevalue>\p{N}+)(?:\s*)(?<sizetype>(?:MB|KB|GB|B)\b)'
|
source: '^([1-9]\d\d|[1-9]\d{3,})$'
|
||||||
# error: 'You must provide a valid size unit (B, KB, MB, GB). E.g.: 100GB'
|
error: 'You must provide a number greater than 100'
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
# Plugin name
|
# Plugin name
|
||||||
name: scaleio
|
name: scaleio
|
||||||
# Human-readable name for your plugin
|
# Human-readable name for your plugin
|
||||||
title: Fuel plugin for ScaleIO
|
title: ScaleIO plugin
|
||||||
# Plugin version
|
# Plugin version
|
||||||
version: '0.2.7'
|
version: '0.2.8'
|
||||||
# Description
|
# Description
|
||||||
description: Enable ScaleIO as a storage backend
|
description: Deploy and enable EMC ScaleIO as the block storage backend
|
||||||
# Required fuel version
|
# Required fuel version
|
||||||
fuel_version: ['6.1']
|
fuel_version: ['6.1']
|
||||||
# Specify license of your plugin
|
# Specify license of your plugin
|
||||||
licenses: ['Apache License Version 2.0']
|
licenses: ['Apache License Version 2.0']
|
||||||
# Specify author or company name
|
# Specify author or company name
|
||||||
authors: ['EMC Code']
|
authors: ['Adrian Moreno Martinez, EMC', 'Magdy Salem, EMC']
|
||||||
# A link to the plugin's page
|
# A link to the plugin's page
|
||||||
homepage: 'https://github.com/openstack/fuel-plugin-scaleio'
|
homepage: 'https://github.com/openstack/fuel-plugin-scaleio'
|
||||||
# Specify a group which your plugin implements, possible options:
|
# Specify a group which your plugin implements, possible options:
|
||||||
# network, storage, storage::cinder, storage::glance, hypervisor
|
# network, storage, storage::cinder, storage::glance, hypervisor
|
||||||
groups: []
|
groups: ['storage']
|
||||||
|
|
||||||
# The plugin is compatible with releases in the list
|
# The plugin is compatible with releases in the list
|
||||||
releases:
|
releases:
|
||||||
|
|
Loading…
Reference in New Issue