From 7edcc84aa93628a4eeb3b0d2fc541f211dbe6e86 Mon Sep 17 00:00:00 2001 From: Adrian Moreno Date: Wed, 18 Nov 2015 09:26:54 -0800 Subject: [PATCH] Fixed bug in SIO gateway configuration Change-Id: Ib2f9cfbd82720051d3e0c722f13ff45a8fe6aed4 --- deployment_scripts/puppet/modules/scaleio | 2 +- .../parser/functions/get_sds_devices.rb | 19 ++++++------- .../scaleio_fuel/manifests/controller.pp | 28 +++++++++++-------- .../modules/scaleio_fuel/manifests/params.pp | 27 ++++++++++-------- metadata.yaml | 2 +- 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/deployment_scripts/puppet/modules/scaleio b/deployment_scripts/puppet/modules/scaleio index 876d33a..45ec7c7 160000 --- a/deployment_scripts/puppet/modules/scaleio +++ b/deployment_scripts/puppet/modules/scaleio @@ -1 +1 @@ -Subproject commit 876d33ab14c37527d0e164f228b1d74106fc840b +Subproject commit 45ec7c75f060200cc726f6498b59c2fc5f8c7b43 diff --git a/deployment_scripts/puppet/modules/scaleio_fuel/lib/puppet/parser/functions/get_sds_devices.rb b/deployment_scripts/puppet/modules/scaleio_fuel/lib/puppet/parser/functions/get_sds_devices.rb index 52f9d4e..1ce9553 100644 --- a/deployment_scripts/puppet/modules/scaleio_fuel/lib/puppet/parser/functions/get_sds_devices.rb +++ b/deployment_scripts/puppet/modules/scaleio_fuel/lib/puppet/parser/functions/get_sds_devices.rb @@ -6,21 +6,18 @@ module Puppet::Parser::Functions protection_domain = args[2] pool_size = args[3] storage_pool = args[4] - gw_ip = args[5] nodes.each do |node| - if node["internal_address"] != gw_ip - result[node["fqdn"]] = { - "ip" => node["internal_address"], - "protection_domain" => protection_domain, - "devices" => { - device => { - "size" => pool_size, - "storage_pool" => storage_pool - } + result[node["fqdn"]] = { + "ip" => node["internal_address"], + "protection_domain" => protection_domain, + "devices" => { + device => { + "size" => pool_size, + "storage_pool" => storage_pool } } - end + } end return result end diff --git a/deployment_scripts/puppet/modules/scaleio_fuel/manifests/controller.pp b/deployment_scripts/puppet/modules/scaleio_fuel/manifests/controller.pp index fb8cf98..2284bfb 100644 --- a/deployment_scripts/puppet/modules/scaleio_fuel/manifests/controller.pp +++ b/deployment_scripts/puppet/modules/scaleio_fuel/manifests/controller.pp @@ -1,7 +1,12 @@ class scaleio_fuel::controller inherits scaleio_fuel::params { - notice("Configuring Controller node for ScaleIO integration") + $mdm_ip = $scaleio_fuel::params::mdm_ip + $gw_password = $scaleio_fuel::params::gw_password + $protection_domain = $scaleio_fuel::params::protection_domain + $storage_pool = $scaleio_fuel::params::storage_pool + + notice('Configuring Controller node for ScaleIO integration') $services = ['openstack-cinder-volume', 'openstack-cinder-api', 'openstack-cinder-scheduler', 'openstack-nova-scheduler'] @@ -25,12 +30,12 @@ inherits scaleio_fuel::params { # 3. Create config for ScaleIO $cinder_scaleio_config = "[scaleio] -rest_server_ip=$gw_ip +rest_server_ip=${mdm_ip[0]} rest_server_username=admin -rest_server_password=$gw_password -protection_domain_name=$protection_domain -storage_pools=$protection_domain:$storage_pool -storage_pool_name=$storage_pool +rest_server_password=${gw_password} +protection_domain_name=${protection_domain} +storage_pools=${protection_domain}:${storage_pool} +storage_pool_name=${storage_pool} round_volume_capacity=True force_delete=True verify_server_certificate=False @@ -80,13 +85,14 @@ verify_server_certificate=False section => 'ScaleIO', setting => 'volume_backend_name', value => 'ScaleIO', - }~> + } ~> service { $services: ensure => running, - } -> - - class {'scaleio_fuel::ha': - controllers => $controller_nodes, } + # -> + # + # class {'scaleio_fuel::ha': + # controllers => $controller_nodes, + # } } diff --git a/deployment_scripts/puppet/modules/scaleio_fuel/manifests/params.pp b/deployment_scripts/puppet/modules/scaleio_fuel/manifests/params.pp index f6dab96..bee2442 100644 --- a/deployment_scripts/puppet/modules/scaleio_fuel/manifests/params.pp +++ b/deployment_scripts/puppet/modules/scaleio_fuel/manifests/params.pp @@ -32,7 +32,8 @@ class scaleio_fuel::params $tb_ip = $controller_ips[2] $current_node = filter_nodes($nodes_hash,'uid', $::fuel_settings['uid']) - $node_ip = join(values(nodes_to_hash($current_node,'name','internal_address'))) + $node_ip = join(values( + nodes_to_hash($current_node,'name','internal_address'))) notice("Current Node: ${current_node}") @@ -52,21 +53,23 @@ class scaleio_fuel::params notice("Node role: ${role}, IP: ${node_ip}, FQDN: ${::fqdn}") - $sio_sds_device = get_sds_devices($nodes_hash, $device, $protection_domain, $pool_size, $storage_pool, $gw_ip) + $sio_sds_device = get_sds_devices( + $nodes_hash, $device, $protection_domain, + $pool_size, $storage_pool) notice("sio_sds_device: ${sio_sds_device}") #TODO: Get callhome information from UI $callhome_cfg = { - 'email_to' => "emailto@address.com", - 'email_from' => "emailfrom@address.com", - 'username' => "monitor_username", - 'password' => "monitor_password", - 'customer' => "customer_name", - 'smtp_host' => "smtp_host", - 'smtp_port' => "smtp_port", - 'smtp_user' => "smtp_user", - 'smtp_password' => "smtp_password", - 'severity' => "error", + 'email_to' => 'emailto@address.com', + 'email_from' => 'emailfrom@address.com', + 'username' => 'monitor_username', + 'password' => 'monitor_password', + 'customer' => 'customer_name', + 'smtp_host' => 'smtp_host', + 'smtp_port' => 'smtp_port', + 'smtp_user' => 'smtp_user', + 'smtp_password' => 'smtp_password', + 'severity' => 'error', } } diff --git a/metadata.yaml b/metadata.yaml index 95bf405..d5cee79 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -3,7 +3,7 @@ name: scaleio # Human-readable name for your plugin title: Fuel plugin for ScaleIO # Plugin version -version: '0.2.3' +version: '0.2.4' # Description description: Enable ScaleIO as a storage backend # Required fuel version