ocf_suse_SAPHanaTopology(7)

NAME
SAPHanaTopology - Helps to manage two SAP HANA databases with system replication.

SYNOPSYS
SAPHanaTopology [start | stop | status | monitor | meta-data | validate-all | methods | usage ]

DESCRIPTION
SAPHanaTopology is a resource agent (RA) that analyzes the SAP HANA topology and "sends" all findings via the node status attributes to all nodes in the cluster. These attributes are taken by the SAPHanaController RA to control the SAP HANA databases. In addition it starts and monitors the local saphostagent.

The resource agent uses the following interfaces provided by SAP:

1. landscapeHostConfiguration.py
landscapeHostConfiguration.py has some detailed output about HANA system status and node roles. For our monitor the overall status is relevant. This overall status is reported by the return code of the script: 0: Internal Fatal 1: ERROR 2: WARNING 3: INFO (maybe a switch of the resource running) 4: OK
The SAPHanaTopology resource agent will interpret return codes 1 as NOT-RUNNING (or 1 failure) and return codes 2+3+4 as RUNNING. SAPHanaTopology scans the output table of landscapeHostConfiguration.py to identify the roles of the cluster node. Roles means configured and current role of the nameserver as well as the indexserver.

2. hdbnsutil
The interface hdbnsutil is used to check the "topology" of the system replication as well as the current configuration (primary/secondary) of a SAP HANA database. A second task of the interface is the posibility to run a system replication take-over (sr_takeover) or to register a former primary to a newer one (sr_register). In scale-out setups, hdbnsutil sometimes might take some time. SAPHanaTopology uses only task one. SAPHanaController or SAPHana are using all three tasks.

3. saphostctrl
The interface saphostctrl uses the function ListInstances to figure out the virtual host name of the SAP HANA instance. This is typically the hostname used during the HANA installation.

Please notice that the method to "send" the findings via the node status attributes might change in a next version. So please do not think about those attributes as an "API". Also do not adjust those automatically set node attributes manulally in normal operation. Names and semantics of the attributes can change in next versions.

Please see also the REQUIREMENTS section below.

SUPPORTED PARAMETERS
This resource agent supports the following parameters:

SID
    SAP System Identifier. Has to be same on both instances. Example "SID=SLE".

InstanceNumber
    Number of the SAP HANA database. For system replication also Instance Number+1 is blocked. Example "InstanceNumber=00".

HANA_CALL_TIMEOUT
    Define timeout how long a call to HANA to receive information can take. This could be e.g. landscapeHostConfiguration.py. There are some specific calls to HANA which have their own timeout values. For example the sr_takeover command does not timeout (inf). If the timeout is reached, the return code will be 124. If you increase the timeouts for HANA calls you should also adjust the operation timeouts of your Linux cluster resources.
    Optional. Default value: 120.

SUPPORTED PROPERTIES
hana_${sid}_glob_filter
    Global cluster property hana_${sid}_glob_filter . This property should only be set if requested by support engineers. The default is sufficient for normal operation.

SUPPORTED ACTIONS
This resource agent supports the following actions (operations):

start
    Sets the status of the clone to "started".

stop
    Sets the status of the clone to "stopped".

status
    Reports whether the HANA instance is running. Suggested minimum timeout: 60.

monitor
    Analyses the nodes HANA roles and landscape status. Suggested minimum timeout: 600. Suggested interval: 10.

validate-all
    Reports whether the parameters are valid. Suggested minimum timeout: 5.

meta-data
    Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5.

methods
    Suggested minimum timeout: 5.

RETURN CODES
The return codes are defined by the OCF cluster framework. Please refer to the OCF definition on the website mentioned below.

EXAMPLES
* This is an example configuration for a SAPHanaTopology resource for HANA scale-up.
In addition, a SAPHana resource is needed to make this work.

    primitive rsc_SAPHanaTop_SLE_HDB00 ocf:suse:SAPHanaTopology \
    op start interval="0" timeout="600" \
    op stop interval="0" timeout="600" \
    op monitor interval="10" timeout="600" \
    params SID="SLE" InstanceNumber="00"

    clone cln_SAPHanaTop_SLE_HDB00 rsc_SAPHanaTop_SLE_HDB00 \
    notify="true" interleave="true" clone-node-max="1"

* Below is an example configuration for a SAPHanaTopology resource for HANA scale-out.
The HANA consists of two sites with five nodes each. An additional cluster node is used as majority maker for split brain situations. In addition, a SAPHanaController resource is needed to make this work.

    primitive rsc_SAPHanaTop_SLE_HDB00 ocf:suse:SAPHanaTopology \
    op start interval="0" timeout="600" \
    op stop interval="0" timeout="600" \
    op monitor interval="10" timeout="600" \
    params SID="SLE" InstanceNumber="00"

    clone cln_SAPHanaTop_SLE_HDB00 rsc_SAPHanaTop_SLE_HDB00 \
    notify="true" interleave="true" clone-node-max="1"

    location SAPHanaTop_not_on_majority_maker cln_SAPHanaTop_HAE_HDB00 -inf: vm-majority

    order SAPHanaTop_first 1000: cln_SAPHanaTop_SLE_HDB00 msl_SAPHC_SLE_HDB00

FILES

/usr/lib/ocf/resource.d/suse/SAPHana
        the resource agent for scale-up

/usr/lib/ocf/resource.d/suse/SAPHanaController
        the resource agent for scale-out

/usr/lib/ocf/resource.d/suse/SAPHanaTopology
        the topology resource agent itself

$HA_RSCTMP/SAPHana/SAPTopologyON.$SID
        the RA's status file (subject to change)

/usr/sap/$SID/$InstanceName/exe
        default path for DIR_EXECUTABLE

/usr/sap/$SID/SYS/profile
        default path for DIR_PROFILE

REQUIREMENTS
For the current version of the SAPHanaTopology resource agent that comes with the software package SAPHanaSR or SAPHanaSR-ScaleOut, the support is limited to the scenarios and parameters described in the respective manual page SAPHanaSR(7) or SAPHanaSR-ScaleOut(7).

SEE ALSO
ocf_suse_SAPHana(7) , ocf_suse_SAPHanaController(7) , SAPHanaSR-monitor(8) , SAPHanaSR-showAttr(8) , SAPHanaSR(7) , SAPHanaSR-ScaleOut(7) , ntp.conf(5) , stonith(8)
https://www.suse.com/products/sles-for-sap/resource-library/sap-best-practices.html ,
https://www.susecon.com/doc/2015/sessions/TUT19921.pdf ,
http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/s-ocf-return-codes.html ,
http://scn.sap.com/community/hana-in-memory/blog/2014/04/04/fail-safe-operation-of-sap-hana-suse-extends-its-high-availability-solution ,
http://scn.sap.com/docs/DOC-60334 ,
http://scn.sap.com/docs/DOC-65899

AUTHORS
F.Herschel, L.Pinne.

COPYRIGHT
(c) 2014 SUSE Linux Products GmbH, Germany.
(c) 2015-2017 SUSE Linux GmbH, Germany.
SAPHanaTopology comes with ABSOLUTELY NO WARRANTY.
For details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html