From 69be0c2ae7131af20385b4f11a8190ed9fba32c7 Mon Sep 17 00:00:00 2001
From: rajinir <rajini_ram@dell.com>
Date: Mon, 10 Apr 2017 13:32:06 -0500
Subject: [PATCH] Dell SC: Add secondary DSM support

Adds support for a secondary DSM in case the primary becomes
unavailable.

Change-Id: I0887e15a7e1c90a4f333bef6cdbb5d43ba0cd838
Closes-Bug: #1681492
Depends-On: I331466e4f254b2b8ff7891b796e78cd30c2c87f7
---
 environments/cinder-dellsc-config.yaml     | 10 +++++++---
 puppet/services/cinder-backend-dellsc.yaml | 16 ++++++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/environments/cinder-dellsc-config.yaml b/environments/cinder-dellsc-config.yaml
index 617d640c42..99e517bf6e 100644
--- a/environments/cinder-dellsc-config.yaml
+++ b/environments/cinder-dellsc-config.yaml
@@ -9,9 +9,13 @@ parameter_defaults:
   CinderDellScSanIp: ''
   CinderDellScSanLogin: 'Admin'
   CinderDellScSanPassword: ''
-  CinderDellScSsn: '64702'
+  CinderDellScSsn: 64702
   CinderDellScIscsiIpAddress: ''
-  CinderDellScIscsiPort: '3260'
-  CinderDellScApiPort: '3033'
+  CinderDellScIscsiPort: 3260
+  CinderDellScApiPort: 3033
   CinderDellScServerFolder: 'dellsc_server'
   CinderDellScVolumeFolder: 'dellsc_volume'
+  CinderDellScSecondarySanIp: ''
+  CinderDellScSecondarySanLogin: 'Admin'
+  CinderDellScSecondarySanPassword: ''
+  CinderDellScSecondaryScApiPort: 3033
diff --git a/puppet/services/cinder-backend-dellsc.yaml b/puppet/services/cinder-backend-dellsc.yaml
index 6a6196ac0e..cd20725780 100644
--- a/puppet/services/cinder-backend-dellsc.yaml
+++ b/puppet/services/cinder-backend-dellsc.yaml
@@ -49,6 +49,18 @@ parameters:
   CinderDellScVolumeFolder:
     type: string
     default: 'dellsc_volume'
+  CinderDellScSecondarySanIp:
+    type: string
+    default: ''
+  CinderDellScSecondarySanLogin:
+    type: string
+    default: 'Admin'
+  CinderDellScSecondarySanPassword:
+    type: string
+    hidden: true
+  CinderDellScSecondaryScApiPort:
+    type: number
+    default: 3033
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -81,5 +93,9 @@ outputs:
                 cinder::backend::dellsc_iscsi::dell_sc_api_port: {get_param: CinderDellScApiPort}
                 cinder::backend::dellsc_iscsi::dell_sc_server_folder: {get_param: CinderDellScServerFolder}
                 cinder::backend::dellsc_iscsi::dell_sc_volume_folder: {get_param: CinderDellScVolumeFolder}
+                cinder::backend::dellsc_iscsi::secondary_san_ip: {get_param: CinderDellScSecondarySanIp}
+                cinder::backend::dellsc_iscsi::secondary_san_login: {get_param: CinderDellScSecondarySanLogin}
+                cinder::backend::dellsc_iscsi::secondary_san_password: {get_param: CinderDellScSecondarySanPassword}
+                cinder::backend::dellsc_iscsi::secondary_sc_api_port: {get_param: CinderDellScSecondaryScApiPort}
       step_config: |
         include ::tripleo::profile::base::cinder::volume