OCF_HEARTBEAT_SAPINS(7)
π
ocf_heartbeat_SAPInstance β like, the manual page for OCF_HEARTBEAT_SAPINS(7) bestie β¨
π NAME π
ocf_heartbeat_SAPInstance β she manages a SAP instance as an HA resource, and she does it flawlessly. Periodt.
π¦ SYNOPSIS π¦
SAPInstance [start | stop | status | monitor | promote | demote |
meta-data | validate-all]
πΈ DESCRIPTION πΈ
Okay so picture this: a SAP system is usually one database plus at least one or more SAP instances (sometimes called application servers, iykyk). And here's the thing β one SAP instance is defined by having exactly one instance profile. Those instance profiles? You'll usually find them chilling in /sapmnt/SID/profile. Every single instance has to be configured as its own resource in the cluster config. No sharing, no merging, one resource each. π
This resource agent is besties with these SAP versions:
- SAP WebAS ABAP Release 6.20 - 7.40
- SAP WebAS Java Release 6.40 - 7.40
- SAP WebAS ABAP + Java Add-In Release 6.20 - 7.40 (Java is not monitored by the cluster in that case)
π«Ά Heads up bestie: when you're using a SAP Kernel 6.40, please check and implement the actions from the section "Manual postprocessing" from SAP note 995116 (http://sdn.sap.com). Other versions may also work with this agent, but they have not been verified. So like, don't come for me if it's weird.
All operations of the SAPInstance resource agent are done by using the startup framework called SAP Management Console or sapstartsrv, which was introduced with SAP kernel release 6.40. Want more info about the SAP Management Console? SAP note 1014480, go read it. π
Using this framework defines a clear interface for the Heartbeat cluster β like, how it sees the SAP system, that's the whole vibe. And the monitoring options are so much better than other methods, like just watching the ps command for running processes or doing some pings to the application. sapstartsrv uses SOAP messages to request the status of running SAP processes. So it can actually ask a process itself what its status is β independent from other problems that might exist at the same time. Main character energy, honestly. π
So sapstartsrv knows 4 status colours:
- GREEN = everything is fine β¨
- YELLOW = something is wrong, but the service is still working π
- RED = the service does not work π
- GRAY = the service has not been started
The SAPInstance resource agent will interpret GREEN and YELLOW as OK. Which means minor problems will not be reported to the Heartbeat cluster β and that's on purpose, because it prevents the cluster from doing an unwanted failover. Slay. The statuses RED and GRAY are reported as NOT_RUNNING to the cluster. Depending on the status the cluster expects from the resource, it will do a restart, failover or just nothing. Resonates. π
β¨ SUPPORTED PARAMETERS β¨
InstanceNameβ The full qualified SAP instance name, e.g.P01_DVEBMGS00_sapp01ci. Usually this is the name of the SAP instance profile.(unique, required, string, no default)DIR_EXECUTABLEβ The full qualified path where to findsapstartsrvandsapcontrol. Specify this parameter if you changed the SAP kernel directory location after the default SAP installation.(optional, string, no default)DIR_PROFILEβ The full qualified path where to find the SAP START profile. Specify this parameter if you changed the SAP profile directory location after the default SAP installation.(optional, string, no default)START_PROFILEβ The name of the SAP START profile. Specify this parameter if you changed the name of the SAP START profile after the default SAP installation. And listen β as SAP release 7.10 does not have a START profile anymore, you need to specify the Instance Profile then. π«‘(unique, optional, string, no default)START_WAITTIMEβ After that time in seconds, a monitor operation is executed by the resource agent. Does the monitor returnSUCCESS, the start is handled asSUCCESS. This is useful to resolve timing problems with e.g. the J2EE-Addin instance.
Usually the resource agent waits until all services are started and the SAP Management Console reports a GREEN status. A double stack installation (ABAP + Java AddIn) consists of an ABAP dispatcher and a JAVA instance. Normally the start of the JAVA instance takes much longer than the start of the ABAP instance. For a JAVA Instance you may need to configure a much higher timeout for the start operation of the resource in Heartbeat. The disadvantage here is that the discovery of a failed start by the cluster takes longer. Somebody might say: "For me it is important that the ABAP instance is up and running, a failure of the JAVA instance shall not cause a failover of the SAP instance." And actually the SAP MC reports a YELLOW status if the JAVA instance of a double stack system fails. From the resource agent point of view, YELLOW means: everything is OK. Setting START_WAITTIME to a lower value determines the resource agent to check the status of the instance during a start operation after that time. As it would normally wait for a GREEN status, now it reports SUCCESS to the cluster in case of a YELLOW status already after the specified time.
That is only useful for double stack systems. πββοΈ
(optional, string, default "3600")
AUTOMATIC_RECOVERβ The SAPInstance resource agent tries to recover a failed start attempt automatically one time. This is done by killing running instance processes, removing thekill.sapfile and executingcleanipc. Sometimes a crashed SAP instance leaves some processes and/or shared memory segments behind. Setting this option totruewill try to remove those leftovers during a start operation β which is to reduce manual work for the administrator. You're welcome. π«Ά(optional, boolean, default false)MONITOR_SERVICESβ Within a SAP instance there can be several services. Usually you will find the defined services in the START profile of the related instance (Attention: with SAP Release 7.10 the START profile content was moved to the instance profile). Not all of those services are worth monitoring by the cluster β for example, you probably do not want to failover your SAP instance just because the central syslog collector daemon failed. Like, be serious. π
These services are monitored within the SAPInstance resource agent:
disp+workmsg_serverenserver(ENSA1)enq_server(ENSA2)enrepserver(ENSA1)enq_replicator(ENSA2)jcontroljstart
Some other services could be monitored as well. They have to be given with the parameter MONITOR_SERVICES, e.g.:
sapwebdispTREXDaemon.x
Those names match the strings used in the output of the command sapcontrol -nr [Instance-Nr] -function GetProcessList. The default should fit most cases where you want to manage a SAP Instance from the cluster. You may change this with this parameter if you like to monitor more/less or other services that sapstartsrv supports. You may specify multiple services separated by a | (pipe) sign in this parameter: disp+work|msg_server|enserver
(optional, string, default "disp+work|msg_server|enserver|enrepserver|jcontrol|jstart|enq_server|enq_replicator")
SHUTDOWN_METHODβ Usually a SAP Instance is stopped by the commandsapcontrol -nr InstanceNr -function Stop. SettingSHUTDOWN_METHOD=KILLmeans to kill the SAP Instance using OS commands: SAP processes of the instance are terminated withkill -9, shared memory is deleted withcleanipc, and thekill.sapfile will be deleted. That method is much faster than the graceful stop, but the instance does not have the chance to say goodbye to other SAP instances in the same system. π₯Ί
β οΈ USE AT YOUR OWN RISK !! β like, for real, bestie. π
(optional, string, default "normal")
ERS_InstanceNameβ Only used in a Promotable resource configuration. The full qualified SAP enqueue replication instance name, e.g.P01_ERS02_sapp01ers. Usually this is the name of the SAP instance profile. The enqueue replication instance must be installed before you want to configure a promotable cluster resource. π
The promotable configuration in the cluster must use this properties: clone_max = 2 clone_node_max = 1 master_node_max = 1 master_max = 1
(unique, optional, string, no default)
ERS_START_PROFILEβ Only used in a Promotable resource configuration; the parameterERS_InstanceNamemust also be set in this configuration. The name of the SAP START profile. Specify this parameter if you changed the name of the SAP START profile after the default SAP installation. As SAP release 7.10 does not have a START profile anymore, you need to specify the Instance Profile then. π(unique, optional, string, no default)PRE_START_USEREXITβ The full qualified path where to find a script or program which should be executed before this resource gets started.(optional, string, no default)POST_START_USEREXITβ The full qualified path where to find a script or program which should be executed after this resource got started.(optional, string, no default)PRE_STOP_USEREXITβ The full qualified path where to find a script or program which should be executed before this resource gets stopped.(optional, string, no default)POST_STOP_USEREXITβ The full qualified path where to find a script or program which should be executed after this resource got stopped.(optional, string, no default)IS_ERSβ Only used for ASCS/ERS SAP Netweaver installations without implementing a promotable resource, to allow the ASCS to 'find' the ERS running on another cluster node after a resource failure. This parameter should be set totrue'only' for the ERS instance for implementations following the SAP NetWeaver 7.40 HA certification (NW-HA-CLU-740). This includes also systems for NetWeaver less than 7.40, if you like to implement the NW-HA-CLU-740 scenario. π(optional, boolean, default false)MINIMAL_PROBEβ SettingMINIMAL_PROBE=trueforces the resource agent to do only a minimal check during a probe. This is needed for special file system setups.
The MINIMAL_PROBE=true is only supported, if requested either by your vendor's support or if described in an architecture document from your HA vendor. π
(optional, boolean, default false)
π¬ SUPPORTED ACTIONS π¬
okay so this resource agent supports these actions (operations) β each one comes with its own suggested minimum timeout, and the monitors also have suggested intervals, bestie:
startβ starts the resource. Suggested minimum timeout:180s.stopβ stops the resource. Suggested minimum timeout:240s.statusβ performs a status check. Suggested minimum timeout:60s.monitorβ performs a detailed status check. Suggested minimum timeout:60s. Suggested interval:120s.monitor(Unpromoted role) β performs a detailed status check. Suggested minimum timeout:60s. Suggested interval:121s.monitor(Promoted role) β performs a detailed status check. Suggested minimum timeout:60s. Suggested interval:119s.promoteβ promotes the resource to the Master role. Suggested minimum timeout:320s.demoteβ demotes the resource to the Slave role. Suggested minimum timeout:320s.reloadβ suggested minimum timeout:320s.validate-allβ performs a validation of the resource configuration. Suggested minimum timeout:5s.meta-dataβ retrieves resource agent metadata (internal use only). Suggested minimum timeout:5s.methodsβ suggested minimum timeout:5s.
π§ͺ EXAMPLE CRM SHELL π§ͺ
The following is an example configuration for a SAPInstance resource using the crm(8) shell:
primitive p_SAPInstance ocf:heartbeat:SAPInstance \
params \
InstanceName=string \
op monitor depth="0" timeout="60s" interval="120s" \
op monitor depth="0" timeout="60s" interval="121s" role="Unpromoted" \
op monitor depth="0" timeout="60s" interval="119s" role="Promoted"
ms ms_SAPInstance p_SAPInstance \
meta notify="true" interleave="true"
π§ EXAMPLE PCS π§
The following is an example configuration for a SAPInstance resource using pcs(8):
pcs resource create p_SAPInstance ocf:heartbeat:SAPInstance \
InstanceName=string \
op monitor OCF_CHECK_LEVEL="0" timeout="60s" interval="120s" \
op monitor OCF_CHECK_LEVEL="0" timeout="60s" interval="121s" role="Unpromoted" \
op monitor OCF_CHECK_LEVEL="0" timeout="60s" interval="119s" role="Promoted" promotable
π SEE ALSO π
βοΈ AUTHOR βοΈ
ClusterLabs contributors (see the resource agent source for information about individual authors).
later bestie β this page is brought to you by resource-agents UNKNOWN, dated 10/01/2026 π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms