Skip to content

Commit

Permalink
Merge pull request #51 from varkoly/SLE-15-SP5
Browse files Browse the repository at this point in the history
Sle 15 sp5
  • Loading branch information
varkoly authored Jan 29, 2025
2 parents 6f2bbf2 + 1055167 commit 97522b2
Show file tree
Hide file tree
Showing 17 changed files with 284 additions and 5 deletions.
4 changes: 3 additions & 1 deletion package/yast2-sap-ha.changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
-------------------------------------------------------------------
Mon Nov 4 21:34:50 UTC 2024 - Peter Varkoly <[email protected]>
Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly <[email protected]>

- yast-sap-ha does not support SAPHanaSR-angi (bsc#1232807)
- Adapt to new SAPHanaSR-angi
- #458 [doc] Issue in "Constraints for SAPHanaSR-angi"
https://github.com/SUSE/suse-best-practices/issues/458
- 4.5.12

-------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion package/yast2-sap-ha.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# spec file for package yast2-sap-ha
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand Down
2 changes: 2 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_NON_PROD.angi.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[memorymanager]
global_allocation_limit = <%= @production_constraints[:global_alloc_limit_non] -%>
2 changes: 2 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_NON_PROD.classic.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[memorymanager]
global_allocation_limit = <%= @production_constraints[:global_alloc_limit_non] -%>
7 changes: 7 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SAPHANA_SR.angi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ha_dr_provider_susHanaSR]
provider = susHanaSR
path = /usr/share/SAPHanaSR-angi
execution_order = 1

[trace]
ha_dr_sushanasr = info
7 changes: 7 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SAPHANA_SR.classic
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ha_dr_provider_saphanasr]
provider = SAPHanaSR
path = /usr/share/SAPHanaSR/
execution_order = 1

[trace]
ha_dr_saphanasr = info
8 changes: 8 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SUS_CHKSRV.angi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[ha_dr_provider_suschksrv]
provider = susChkSrv
path = /usr/share/SAPHanaSR-angi/
execution_order = 3
action_on_lost=stop

[trace]
ha_dr_suschksrv = info
8 changes: 8 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SUS_CHKSRV.classic
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[ha_dr_provider_suschksrv]
provider = susChkSrv
path = /usr/share/SAPHanaSR/
execution_order = 3
action_on_lost=stop

[trace]
ha_dr_suschksrv = info
14 changes: 14 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SUS_COSTOPT.angi.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[memorymanager]
global_allocation_limit = <%= @production_constraints[:global_alloc_limit_prod] -%>

[system_replication]
preload_column_tables = <%= @production_constraints[:preload_column_tables] -%>

[ha_dr_provider_suscostopt]
provider = susCostOpt
path = /usr/share/SAPHanaSR-angi
userkey = sus_<%= @system_id -%>_costopt
execution_order = 2

[trace]
ha_dr_suscostopt = info
14 changes: 14 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SUS_COSTOPT.classic.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[memorymanager]
global_allocation_limit = <%= @production_constraints[:global_alloc_limit_prod] -%>

[system_replication]
preload_column_tables = <%= @production_constraints[:preload_column_tables] -%>

[ha_dr_provider_suscostopt]
provider = susCostOpt
path = /usr/share/SAPHanaSR/
userkey = sus_<%= @system_id -%>_costopt
execution_order = 2

[trace]
ha_dr_suscostopt = info
8 changes: 8 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SUS_TKOVER.angi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[ha_dr_provider_sustkover]
provider = susTkOver
path = /usr/share/SAPHanaSR-angi/
sustkover_timeout = 30
execution_order = 2

[trace]
ha_dr_sustkover = info
7 changes: 7 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_SUS_TKOVER.classic
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ha_dr_provider_sustkover]
provider = susTkOver
path = /usr/share/SAPHanaSR/
execution_order = 2

[trace]
ha_dr_sustkover = info
3 changes: 3 additions & 0 deletions src/data/sap_ha/SUDOERS_HANASR.angi.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SAPHanaSR-ScaleUp entries for writing srHook cluster attribute
<%= @system_id -%>adm ALL=(ALL) NOPASSWD: /usr/bin/SAPHanaSR-hookHelper --sid=<%= @system_id -%> *
<%= @system_id -%>adm ALL=(ALL) NOPASSWD: /usr/sbin/crm_attribute -n hana_<%= @system_id -%>_site_srHook_*
File renamed without changes.
101 changes: 101 additions & 0 deletions src/data/sap_ha/tmpl_cluster_config.angi.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#
# defaults
#

property cib-bootstrap-options: \
have-watchdog="true" \
stonith-enabled="true" \
stonith-action="reboot" \
stonith-timeout="150s"

rsc_defaults rsc-options: \
resource-stickiness="1000" \
migration-threshold="3"

op_defaults op-options: \
timeout="600" \
record-pending=true

#
# production HANA
#

primitive rsc_SAPHanaTop_<%= @system_id -%>_HDB<%= @instance -%> ocf:suse:SAPHanaTopology \
op start interval=0 timeout=600 \
op stop interval=0 timeout=600 \
op monitor interval=50 timeout=600 \
params SID="<%= @system_id -%>" InstanceNumber="<%= @instance -%>"

clone cln_SAPHanaTop_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHanaTop_<%= @system_id -%>_HDB<%= @instance -%> \
meta clone-node-max="1" interleave="true"

primitive rsc_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> ocf:suse:SAPHanaController \
op start interval=0 timeout=3600 \
op stop interval=0 timeout=3600 \
op promote interval=0 timeout=3600 \
op monitor interval=60 role=Promoted timeout=700 \
op monitor interval=61 role=Unpromoted timeout=700 \
params SID="<%= @system_id -%>" InstanceNumber="<%= @instance -%>" PREFER_SITE_TAKEOVER="<%= @prefer_takeover -%>" \
DUPLICATE_PRIMARY_TIMEOUT=600 AUTOMATED_REGISTER="<%= @auto_register -%>" \
meta priority="100"

clone mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%> \
meta clone-max=2 clone-node-max=1 interleave=true promotable=true

primitive rsc_ip_<%= @system_id -%>_HDB<%= @instance -%> ocf:heartbeat:IPaddr2 \
op monitor interval="10" timeout="20" \
params ip="<%= @virtual_ip %>" cidr_netmask="<%= @virtual_ip_mask %>"

<% if @global_config.platform == "azure" %>

#
# Azure only
#

primitive rsc_nc_<%= @system_id -%>_HDB<%= @instance -%> azure-lb port=625<%= @instance -%> \
op monitor timeout=20s interval=10 \
meta resource-stickiness=0

group g_ip_<%= @system_id -%>_HDB<%= @instance -%> rsc_ip_<%= @system_id -%>_HDB<%= @instance -%> rsc_nc_<%= @system_id -%>_HDB<%= @instance -%>

#
# End azure only
#

colocation col_saphana_ip_<%= @system_id -%>_HDB<%= @instance -%> <%= @additional_instance ? "3000" : "2000" -%>: g_ip_<%= @system_id -%>_HDB<%= @instance -%>:Started \
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>:Master

<% else %>

colocation col_saphana_ip_<%= @system_id -%>_HDB<%= @instance -%> <%= @additional_instance ? "3000" : "2000" -%>: rsc_ip_<%= @system_id -%>_HDB<%= @instance -%>:Started \
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>:Master

<% end %>

order ord_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> Optional: cln_SAPHanaTop_<%= @system_id -%>_HDB<%= @instance -%> \
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>

<% if @additional_instance %>

#
# non-production HANA and constraints
#

primitive rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%> ocf:heartbeat:SAPInstance \
params InstanceName="<%= @np_system_id -%>_HDB<%= @np_instance -%>_<%= secondary_host_name -%>" \
MONITOR_SERVICES="hdbindexserver|hdbnameserver" \
START_PROFILE="/usr/sap/QAS/SYS/profile/<%= @np_system_id -%>_HDB<%= @np_instance -%>_<%= secondary_host_name -%>" \
op start interval="0" timeout="600" \
op monitor interval="120" timeout="700" \
op stop interval="0" timeout="300"

location loc_<%= @np_system_id -%>_never_<%= primary_host_name -%> rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%> -inf: <%= primary_host_name -%>

colocation col_<%= @np_system_id -%>_never_with_<%= @system_id -%>ip -inf: rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%>:Started \
rsc_ip_<%= @system_id -%>_HDB<%= @instance -%>

order ord_<%= @np_system_id -%>_stop_before_<%= @system_id -%>-promote mandatory: \
rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%>:stop \
mst_SAPHanaCon_<%= @system_id -%>_HDB<%= @instance -%>:promote

<% end %>
93 changes: 93 additions & 0 deletions src/data/sap_ha/tmpl_cluster_config.classic.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#
# defaults
#

property cib-bootstrap-options: \
have-watchdog="true" \
stonith-enabled="true" \
stonith-action="reboot" \
stonith-timeout="150s"

rsc_defaults rsc-options: \
resource-stickiness="1000" \
migration-threshold="3"

op_defaults op-options: \
timeout="600" \
record-pending=true

#
# production HANA
#

primitive rsc_SAPHanaTopology_<%= @system_id -%>_HDB<%= @instance -%> ocf:suse:SAPHanaTopology \
op monitor interval="10" timeout="600" \
op start interval="0" timeout="600" \
op stop interval="0" timeout="300" \
params SID="<%= @system_id -%>" InstanceNumber="<%= @instance -%>"

clone cln_SAPHanaTopology_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHanaTopology_<%= @system_id -%>_HDB<%= @instance -%> \
meta clone-node-max="1" interleave="true"

primitive rsc_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> ocf:suse:SAPHana \
op start interval="0" timeout="3600" \
op stop interval="0" timeout="3600" \
op promote interval="0" timeout="3600" \
op monitor interval="60" role="Master" timeout="700" \
op monitor interval="61" role="Slave" timeout="700" \
params SID="<%= @system_id -%>" InstanceNumber="<%= @instance -%>" PREFER_SITE_TAKEOVER="<%= @prefer_takeover -%>" \
DUPLICATE_PRIMARY_TIMEOUT="7200" AUTOMATED_REGISTER="<%= @auto_register -%>" \
meta priority="100"

ms msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> \
meta clone-max="2" clone-node-max="1" interleave="true" maintenance="true"

primitive rsc_ip_<%= @system_id -%>_HDB<%= @instance -%> ocf:heartbeat:IPaddr2 \
op monitor interval="10" timeout="20" \
params ip="<%= @virtual_ip %>" cidr_netmask="<%= @virtual_ip_mask %>"

<% if @global_config.platform == "azure" %>

primitive rsc_nc_<%= @system_id -%>_HDB<%= @instance -%> azure-lb port=625<%= @instance -%> \
op monitor timeout=20s interval=10 \
meta resource-stickiness=0

group g_ip_<%= @system_id -%>_HDB<%= @instance -%> rsc_ip_<%= @system_id -%>_HDB<%= @instance -%> rsc_nc_<%= @system_id -%>_HDB<%= @instance -%>

colocation col_saphana_ip_<%= @system_id -%>_HDB<%= @instance -%> <%= @additional_instance ? "3000" : "2000" -%>: g_ip_<%= @system_id -%>_HDB<%= @instance -%>:Started \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>:Master

<% else %>

colocation col_saphana_ip_<%= @system_id -%>_HDB<%= @instance -%> <%= @additional_instance ? "3000" : "2000" -%>: rsc_ip_<%= @system_id -%>_HDB<%= @instance -%>:Started \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>:Master

<% end %>

order ord_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> Optional: cln_SAPHanaTopology_<%= @system_id -%>_HDB<%= @instance -%> \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>

<% if @additional_instance %>

#
# non-production HANA and constraints
#

primitive rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%> ocf:heartbeat:SAPInstance \
params InstanceName="<%= @np_system_id -%>_HDB<%= @np_instance -%>_<%= secondary_host_name -%>" \
MONITOR_SERVICES="hdbindexserver|hdbnameserver" \
START_PROFILE="/usr/sap/QAS/SYS/profile/<%= @np_system_id -%>_HDB<%= @np_instance -%>_<%= secondary_host_name -%>" \
op start interval="0" timeout="600" \
op monitor interval="120" timeout="700" \
op stop interval="0" timeout="300"

location loc_<%= @np_system_id -%>_never_<%= primary_host_name -%> rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%> -inf: <%= primary_host_name -%>

colocation col_<%= @np_system_id -%>_never_with_<%= @system_id -%>ip -inf: rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%>:Started \
rsc_ip_<%= @system_id -%>_HDB<%= @instance -%>

order ord_<%= @np_system_id -%>_stop_before_<%= @system_id -%>-promote mandatory: \
rsc_SAP_<%= @np_system_id -%>_HDB<%= @np_instance -%>:stop \
msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%>:promote

<% end %>
9 changes: 6 additions & 3 deletions src/lib/sap_ha/configuration/hana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ def wait_idle(node)
end

def activating_msr
msr = "msl_SAPHana_#{@system_id}_HDB#{@instance}"
msr = "mst_SAPHanaCon_#{@system_id}_HDB#{@instance}"
if @rsa_version == "classic"
msr = "msl_SAPHana_#{@system_id}_HDB#{@instance}"
end
out, status = exec_outerr_status("crm", "resource", "refresh", msr)
@nlog.log_status(status.exitstatus == 0,
"#{msr} status refresh OK",
Expand Down Expand Up @@ -403,8 +406,8 @@ def configure_firewall(role)

# Creates the sudoers file
def adapt_sudoers
if File.exist?(SapHA::Helpers.data_file_path("SUDOERS_HANASR.erb"))
Helpers.write_file("/etc/sudoers.d/saphanasr.conf", Helpers.render_template("SUDOERS_HANASR.erb", binding))
if File.exist?(SapHA::Helpers.data_file_path("SUDOERS_HANASR.#{@rsa_version}.erb"))
Helpers.write_file("/etc/sudoers.d/saphanasr.conf", Helpers.render_template("SUDOERS_HANASR.#{@rsa_version}.erb", binding))
end
end

Expand Down

0 comments on commit 97522b2

Please sign in to comment.