Blame SOURCES/bz1466187-SAPInstance-IS_ERS-parameter-for-ASCS-ERS-Netweaver.patch

bb196a
From 2118e5324917938ee2e00926778cfe5159043165 Mon Sep 17 00:00:00 2001
bb196a
From: Fabian Herschel <fabian.herschel@suse.com>
bb196a
Date: Thu, 27 Apr 2017 12:47:37 +0200
bb196a
Subject: [PATCH] Medium: SAPInstance: Add IS_ERS parameter (bsc#1036486)
bb196a
bb196a
If IS_ERS is true, mark a per cluster attribute for a
bb196a
specific ASCS/ERS pair describing which node is the
bb196a
best place to failover a failed ASCS.
bb196a
---
bb196a
 heartbeat/SAPInstance | 19 +++++++++++++++++++
bb196a
 1 file changed, 19 insertions(+)
bb196a
bb196a
diff --git a/heartbeat/SAPInstance b/heartbeat/SAPInstance
bb196a
index 49e60aa30..871cbcf3d 100755
bb196a
--- a/heartbeat/SAPInstance
bb196a
+++ b/heartbeat/SAPInstance
bb196a
@@ -31,6 +31,7 @@
bb196a
 #	OCF_RESKEY_POST_START_USEREXIT	(optional, lists a script which can be executed after the resource is started)
bb196a
 #	OCF_RESKEY_PRE_STOP_USEREXIT	(optional, lists a script which can be executed before the resource is stopped)
bb196a
 #	OCF_RESKEY_POST_STOP_USEREXIT	(optional, lists a script which can be executed after the resource is stopped)
bb196a
+#	OCF_RESKEY_IS_ERS               (needed for ENQ/REPL NW 740)
bb196a
 #
bb196a
 #  TODO: - Option to shutdown sapstartsrv for non-active instances -> that means: do probes only with OS tools (sapinstance_status)
bb196a
 #        - Option for better standalone enqueue server monitoring, using ensmon (test enque-deque)
bb196a
@@ -195,6 +196,15 @@ The name of the SAP START profile. Specify this parameter, if you have changed t
bb196a
   <shortdesc lang="en">Path to a post-start script</shortdesc>
bb196a
   <content type="string" default="" />
bb196a
  </parameter>
bb196a
+ <parameter name="IS_ERS" unique="0" required="0">
bb196a
+  <longdesc lang="en">Only used for ASCS/ERS SAP Netweaver installations without implementing a master/slave resource to
bb196a
+    allow the ASCS to 'find' the ERS running on an other cluster node after a resource failure. This parameter should be set
bb196a
+    to true 'only' for the ERS instance for implementations following the SAP NetWeaver 7.40 HA certification (NW-HA-CLU-740). This includes also
bb196a
+    systems for NetWeaver less than 7.40, if you like to impelemnt the NW-HA-CLU-740 scenario.
bb196a
+  </longdesc>
bb196a
+  <shortdesc lang="en">Mark SAPInstance as ERS instance</shortdesc>
bb196a
+  <content type="boolean" default="false" />
bb196a
+ </parameter>
bb196a
 </parameters>
bb196a
 
bb196a
 <actions>
bb196a
@@ -342,6 +352,12 @@ sapinstance_init() {
bb196a
     currentSTART_PROFILE=$OCF_RESKEY_START_PROFILE
bb196a
   fi
bb196a
 
bb196a
+  if [ -z "$OCF_RESKEY_IS_ERS" ]; then
bb196a
+      is_ers="no"
bb196a
+  else
bb196a
+      is_ers="$OCF_RESKEY_IS_ERS"
bb196a
+  fi
bb196a
+
bb196a
   if [ -z "$currentSTART_PROFILE" ]
bb196a
   then
bb196a
     SAPSTARTPROFILE="$DIR_PROFILE/START_${InstanceName}_${SAPVIRHOST}"
bb196a
@@ -568,9 +584,11 @@ sapinstance_start() {
bb196a
     ocf_log info "SAP Instance $SID-$InstanceName started: $output"
bb196a
     rc=$OCF_SUCCESS
bb196a
     sapuserexit POST_START_USEREXIT "$OCF_RESKEY_POST_START_USEREXIT"
bb196a
+    if ocf_is_true $is_ers; then crm_attribute -n runs_ers_${SID} -v 1 -l reboot; fi
bb196a
   else
bb196a
     ocf_log err "SAP Instance $SID-$InstanceName start failed: $output"
bb196a
     rc=$OCF_NOT_RUNNING
bb196a
+    if ocf_is_true $is_ers; then crm_attribute -n runs_ers_${SID} -v 0 -l reboot; fi
bb196a
   fi
bb196a
 
bb196a
   return $rc
bb196a
@@ -628,6 +646,7 @@ sapinstance_stop() {
bb196a
   fi
bb196a
 
bb196a
   sapuserexit POST_STOP_USEREXIT "$OCF_RESKEY_POST_STOP_USEREXIT"
bb196a
+  if ocf_is_true $is_ers; then crm_attribute -n runs_ers_${SID} -v 0 -l reboot;  fi
bb196a
 
bb196a
   return $rc
bb196a
 }