Skip to content

Commit

Permalink
Merge pull request #153 from SUSE/feat/susChkSrv
Browse files Browse the repository at this point in the history
add susChkSrv HA/DR provider and make providers configurable
  • Loading branch information
yeoldegrove authored Nov 8, 2023
2 parents 4db963e + ea1816b commit 8d456d8
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 8 deletions.
2 changes: 1 addition & 1 deletion _service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="filename">saphanabootstrap-formula</param>
<param name="versionformat">0.13.1+git.%ct.%h</param>
<param name="versionformat">0.14.0+git.%ct.%h</param>
<param name="revision">%%VERSION%%</param>
</service>

Expand Down
15 changes: 15 additions & 0 deletions form.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ hana:
$type: boolean
$default: false
$help: Enable the node monitoring via exporters which will be installed and configured in all the nodes. Customize the exporter configuration in each node's dedicated sections.
ha_dr_sustkover_enabled:
$name: Enable HANA HA/DR provdider hook susTkOver
$type: boolean
$default: false
$help: See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
ha_dr_suschksrv_enabled:
$name: Enable HANA HA/DR provdider hook susChkSrv
$type: boolean
$default: false
$help: See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
ha_dr_suschksrv_action_on_lost:
$name: Configure "Action on lost" for HANA HA/DR provider hook susChkSrv
$type: select
$values: [stop, fence]
$help: See `man 7 susChkSrv.py` and https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
nodes:
$name: Nodes
$type: edit-group
Expand Down
35 changes: 29 additions & 6 deletions hana/ha_cluster.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
{% if hana.scale_out %}
{% set hook_path = '/usr/share/SAPHanaSR-ScaleOut' %}
{% set sr_hook_multi_target = hook_path + '/SAPHanaSrMultiTarget.py' %}
{% set sr_hook = hook_path + '/SAPHanaSR.py' %}
{% set sustkover_hook = hook_path + '/susTkOver.py' %}
remove_SAPHanaSR:
pkg.removed:
Expand All @@ -21,9 +18,6 @@ install_SAPHanaSR:
{% else %}
{% set hook_path = '/usr/share/SAPHanaSR' %}
{% set sr_hook_multi_target = hook_path + '/SAPHanaSrMultiTarget.py' %}
{% set sr_hook = hook_path + '/SAPHanaSR.py' %}
{% set sustkover_hook = hook_path + '/susTkOver.py' %}
remove_SAPHanaSR:
pkg.removed:
Expand All @@ -38,6 +32,15 @@ install_SAPHanaSR:
- SAPHanaSR-doc
{% endif %}
{% set sr_hook_multi_target = hook_path + '/SAPHanaSrMultiTarget.py' %}
{% set sr_hook = hook_path + '/SAPHanaSR.py' %}
{% set sustkover_hook = hook_path + '/susTkOver.py' %}
{% set suschksrv_hook = hook_path + '/susChkSrv.py' %}
{% set sustkover_hook_enabled = hana.ha_dr_sustkover_enabled|default(False) %}
{% set suschksrv_hook_enabled = hana.ha_dr_suschksrv_enabled|default(False) %}
{% set suschksrv_hook_action_on_lost = hana.ha_dr_suschksrv_action_on_lost|default('stop') %}
# get HANA sites
{% set sites = {} %}
{% for node in hana.nodes %}
Expand Down Expand Up @@ -182,6 +185,26 @@ configure_susTkOver_hook_{{ sap_instance }}:
- pkg: install_SAPHanaSR
- onlyif:
- test -f {{ sustkover_hook }}
- test "True" == "{{ sustkover_hook_enabled }}"
configure_susChkSrv_hook_{{ sap_instance }}:
ini.options_present:
- name: /hana/shared/{{ node.sid.upper() }}/global/hdb/custom/config/global.ini
- separator: '='
- strict: False # do not touch rest of file
- sections:
ha_dr_provider_suschksrv:
provider: 'susChkSrv'
path: '{{ hook_path }}'
execution_order: '3'
action_on_lost: '{{ suschksrv_hook_action_on_lost }}'
trace:
ha_dr_suschksrv: 'info'
- require:
- pkg: install_SAPHanaSR
- onlyif:
- test -f {{ suschksrv_hook }}
- test "True" == "{{ suschksrv_hook_enabled }}"
# Configure system replication operation mode in the primary site
{% for secondary_node in hana.nodes if node.primary is defined and secondary_node.secondary is defined and secondary_node.secondary.remote_host == host %}
Expand Down
2 changes: 1 addition & 1 deletion hana/templates/srCostOptMemConfig_hook.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Set the following variables:
* dbuser Username [ e.g. SYSTEM ]
* dbpwd
* user password [ e.g. SLES4sap ]
* dbport port where db listens for SQL connctions [e.g 30013 or 30015]
* dbport port where db listens for SQL connections [e.g 30013 or 30015]
"""
#
# parameter section
Expand Down
10 changes: 10 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ hana:
# you can customize the exporter configuration in each node in the dedicated sections below
monitoring_enabled: true

# HANA HA/DR provider configuration
# See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
# The SAPHanaSR hook is always enabled.
# enable susTkOver hook (disabled by default)
#ha_dr_sustkover_enabled: true
# enable susChkSrv hook (disabled by default)
#ha_dr_suschksrv_enabled: true
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
#ha_dr_suschksrv_action_on_lost: 'fence'

nodes:
- host: 'hana01'
sid: 'prd'
Expand Down
7 changes: 7 additions & 0 deletions saphanabootstrap-formula.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Nov 6 08:37:35 UTC 2023 - Eike Waldt <[email protected]>

- Version bump 0.14.0
* add susChkSrv HA/DR provider
* make providers configurable

-------------------------------------------------------------------
Mon Nov 7 08:59:19 UTC 2022 - Steven Stringer <[email protected]>

Expand Down

0 comments on commit 8d456d8

Please sign in to comment.