How does the `IS_ERS` attribute work on a SAP NetWeaver cluster with Standalone Enqueue Server (ENSA1 and ENSA2)?
Environment
Red Hat Enterprise Linux 7 and 8 with High-Availability Add-on
SAP NetWeaver with Standalone Enqueue Server (ENSA1 and ENSA2)
Issue
- We would like to know the purpose of configuring the attribute
IS_ERSwhen creating theSAPInstanceresource for ERS in a Pacemaker cluster - Is it mandatory to configure the attribute
IS_ERS=truefor the ERSSAPInstanceresource in ENSA1 and/or ENSA2 deployments? - What is the purpose of
runs_ers_SIDcluster node attribute in cluster runningSAPInstanceresource?
Resolution
The usage of the IS_ERS parameter for the SAPInstance resource was introduced with the ENSA1 architecture. When enabled the cluster uses node's runs_ers_SID attribute to decide where to place the ASCS resource in the cluster configured for ENSA1 architecture, via the location constraint. In other words, defining IS_ERS=true for the ERS SAPInstance resource is mandatory for ENSA1 deployments.
For ENSA2 architecture, the cluster does not use the aforementioned runs_ers_SID node's attribute to decide where to place the resources. Thus, defining IS_ERS=true for the ERS SAPInstance resource is not mandatory for ENSA2 deployments.
Root Cause
The attribute IS_ERS of the SAPInstance resource internally set up the local variable is_ers during the initialization:
# less /usr/lib/ocf/resource.d/heartbeat/SAPInstance
...
# sapinstance_init : Define global variables with default values, if optional parameters are not set
#
#
sapinstance_init() {
if [ -z "$OCF_RESKEY_IS_ERS" ]; then
is_ers="no"
else
is_ers="$OCF_RESKEY_IS_ERS"
fi
Based on the value of this variable, the node's attribute runs_ers_SID changes its value (between 0 and 1) when the start or stop operations are executed against the ERS SAPInstance resource:
# less /usr/lib/ocf/resource.d/heartbeat/SAPInstance
...
# sapinstance_start : Start the SAP instance
#
sapinstance_start() {
if [ $startrc -eq 0 ]
then
ocf_log info "SAP Instance $SID-$InstanceName started: $output"
rc=$OCF_SUCCESS
sapuserexit POST_START_USEREXIT "$OCF_RESKEY_POST_START_USEREXIT"
if ocf_is_true $is_ers; then crm_attribute -n runs_ers_${SID} -v 1 -l reboot; fi
else
ocf_log err "SAP Instance $SID-$InstanceName start failed: $output"
rc=$OCF_NOT_RUNNING
if ocf_is_true $is_ers; then crm_attribute -n runs_ers_${SID} -v 0 -l reboot; fi
fi
return $rc
}
...
#
# sapinstance_stop: Stop the SAP instance
#
sapinstance_stop() {
...
sapuserexit POST_STOP_USEREXIT "$OCF_RESKEY_POST_STOP_USEREXIT"
if ocf_is_true $is_ers; then crm_attribute -n runs_ers_${SID} -v 0 -l reboot; fi
return $rc
}
This is valid for both ENSA1 and ENSA2 architectures.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.