susTkOver.py(7)
π susTkOver.py β the SAPHanaSR glow-up page
okay so this is susTkOver.py(7) from the SAPHanaSR fam β a whole manual page for one tiny iconic script that does one big job. buckle up bestie π
β¨ NAME β¨
susTkOver.py β the provider for the SAP HANA srHook method preTakeover().
π¦ DESCRIPTION π¦
so susTkOver.py is literally here to hand SAP HANA a script for the srHook method preTakeover(). that's the gig. that's the whole vibe.
the SAP HANA nameserver ships a Python-based API (the "HA/DR providers" β yes that's the real name, iykyk), and it gets called at the big moments of the host auto-failover and system replication takeover process. these so-called hooks are your spot to do arbitrary operations that need to run. and preTakeover()? called before the sr_takeover action. no cap. π₯
here's the tea: susTkOver.py allows a manual takeover of the HANA primary if the SAP HANA multi-state resource (managed by SAPHanaController) is set into maintenance or the Linux cluster is stopped. otherwise β and this is important β the manual takeover is blocked. check the manual page SAPHanaSR_maintenance_examples(7) for the lore.
π«Ά heads up: this hook script needs to be configured and activated on all HANA nodes. all of them. no skipping.
πΈ SUPPORTED PARAMETERS πΈ
the "HA/DR providers" API section
the "HA/DR providers" API accepts these parameters for the ha_dr_provider_susTkOver section:
[ha_dr_provider_susTkOver]
provider = susTkOverβ mandatory. must not be changed. like, do not touch it. πpath = /usr/share/SAPHanaSR-angiβ mandatory. delivered inside the RPM package. please only change it if someone requests it.execution_order = [ INTEGER ]β mandatory. the order might depend on other hook scripts, so think before you rearrange.sustkover_timeout = [ INTEGER ]β optional. default is30seconds. β±οΈ
the [trace] section
the API also accepts this one parameter for the trace section:
ha_dr_sustkover = [ info | debug ]β optional. default isinfo. it'll be added automatically if you don't set it. so nice of it.
the cluster attributes the SAPHanaController RA watches π
the SAPHanaController RA recognizes the pending takeover request via these cluster attributes:
sra = [ T | R | F | - ]β the HANA system replication takeover action, indicated bypreTakeover().
the node attribute system replication action gets checked by the HA/DR provider API method preTakeover(). it's set by the resource agent SAPHanaController. it tells you whether a takeover or a registration is going down:
T= takeover on new primary (sr_takeover) ongoing.R= registration on new secondary (sr_register) ongoing.F= takeover failed. π-= no action pending.
srah = [ T | R | F | - ]β the HANA system replication action history.
this node attribute stores actions in CIB attributes for later use β for root cause analysis. so when things get messy, the receipts are right there. π
π RETURN CODES π
0β successful program execution. slay.>0β usage, syntax or execution errors. π
π EXAMPLES π
okay this is the fun part, let's go π§
- simple example for the sudo permissions in
/etc/sudoers.d/SAPHanaSR. this file is needed on all Linux cluster nodes. SID here isHA1. see also the manual pageSAPHanaSR-hookHelper(8).
# SAPHanaSR needs for susTkOver
ha1adm ALL=(ALL) NOPASSWD: /usr/bin/SAPHanaSR-hookHelper *
- example for looking up the sudo permission for the hook script. all the related files (
/etc/sudoersand/etc/sudoers.d/*) get scanned. example SID isHA1.
# sudo -U ha1adm -l | grep "NOPASSWD.*/usr/bin/SAPHanaSR-hookHelper"
- example entry in the SAP HANA global configuration at
/hana/shared/$SID/global/hdb/custom/config/global.ini. this file is needed at both sites. the entry shown works for scale-up and for scale-out. (and yes β the HANA has to be stopped before the files can be changed. do with that what you will.)
[ha_dr_provider_sustkover]
provider = susTkOver
path = /usr/share/SAPHanaSR-angi
sustkover_timeout = 30
execution_order = 1
[trace]
ha_dr_sustkover = info
- example for checking the system log for susTkOver setting the HANA system replication status in the CIB properties section. run this on the respective HANA primary site's master nameserver.
# grep "sudo.*SAPHanaSR-hookHelper" /var/log/messages
- example for checking the HANA tracefiles for
preTakeover()events. run this on the respective HANA secondary site's master nameserver.
# su - sleadm
~> cdtrace
~> grep susTk.*preTakeover.*called nameserver_*.trc
- example for showing intentionally blocked manual takeover attempts. run it on the respective HANA secondary site's master nameserver.
# su - sleadm
~> cdtrace
~> grep susTkOver.preTakeover.*failed.*50277 nameserver_*.trc
bestie, if you see such messages, you may want to go read SAPHanaSR_maintenance_examples(7). π«Ά
- example for checking the HANA tracefiles for when the hook script has been loaded. run it on both sites' master nameservers.
# su - sleadm
~> cdtrace
~> grep HADR.*load.*susTkOver nameserver_*.trc
~> grep susTkOver.init nameserver_*.trc
π FILES π
/usr/share/SAPHanaSR-angi/susTkOver.pyβ the hook provider, delivered with the RPM./usr/bin/SAPHanaSR-hookHelperβ the external script to check and update the CIB attribute./hana/shared/$SID/global/hdb/custom/config/global.iniβ the on-disk representation of the HANA global system configuration./etc/sudoers,/etc/sudoers.d/*β the sudo permissions configuration./usr/sap/$sid/HDB$nr/$HOST/trace/nameserver_$vhost.3????.???.trcβ the HANA master nameserver tracefile.
π REQUIREMENTS π
- SAP HANA 2.0 SPS06 or later provides the HA/DR provider hook method
preTakeover()with multi-target aware parameters and a separate return code for Linux HA clusters. non-negotiable, that's the baseline. - no other HADR provider hook script should be configured for the
preTakeover()method. hook scripts for other methods, provided inSAPHanaSRandSAPHanaSR-ScaleOut, can totally be used in parallel tosusTkOver.pyβ unless something documents a contradiction. - the user
${sid}admneeds execution permission as user root for the commandSAPHanaSR-hookHelper. - the hook provider needs to be added to the HANA global configuration β in memory and on disk (in persistence). both, bestie. π
- if the hook provider should be pre-compiled, you have to use the particular Python version that comes with SAP HANA. no mixing and matching.
π BUGS π
in case of any problem, please use your favourite SAP support process to open a request for the component BC-OP-LNX-SUSE. and please report any other feedback and suggestions to feedback@suse.com. we're listening π«Ά
β SEE ALSO β
SAPHanaSR(7) , SAPHanaSR-ScaleOut(7) , susHanaSR.py(7) , susHanaSrMultiTarget.py(7) , ocf_suse_SAPHanaTopology(7) , ocf_suse_SAPHanaController(7) , SAPHanaSR-showAttr(8) , SAPHanaSR-hookHelper(8) , SAPHanaSR_maintenance_examples(7) , SAPHanaSR-manageProvider(8) , crm_attribute(8) , sudo(8) , sudoers(5), python3(8) , https://help.sap.com/docs/SAP_HANA_PLATFORM?locale=en-US https://help.sap.com/docs/SAP_HANA_PLATFORM/6b94445c94ae495c83a19646e7c3fd56/5df2e766549a405e95de4c5d7f2efc2d.html?locale=en-US
πΈ AUTHORS πΈ
A.Briel, F.Herschel, L.Pinne.
π COPYRIGHT π
(c) 2022-2026 SUSE LLC
susTkOver.py comes with ABSOLUTELY NO WARRANTY. for details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html.
and that's the whole page, bestie β written 25 Jul 2025, living in the susTkOver.py(7) era of the SAPHanaSR manual set. go configure all your HANA nodes and text me when it works π
β¨π
π¦ where this page comes from
- opensuse-leap 16.0: SAPHanaSR-angi 1.3.4-160000.1.1 Β· GPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms