Skip to content

Commit

Permalink
Merge pull request #46 from varkoly/master
Browse files Browse the repository at this point in the history
yast-sap-ha does not support SAPHanaSR-angi
  • Loading branch information
varkoly authored Nov 5, 2024
2 parents d28e084 + 1d643ce commit 5fe67c9
Show file tree
Hide file tree
Showing 17 changed files with 366 additions and 35 deletions.
110 changes: 110 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
################################################################################
#
# This part contains the shared Rubocop configuration for SUSE projects. It is
# maintained at https://github.com/SUSE/style-guides/blob/master/rubocop-suse.yml
#
# NOTE: some rules have been commented out, see the YaST specific changes
# at the end of the file!
#
################################################################################

# Disabled, would require too many changes in the current code
#Lint/EndAlignment:
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#lintendalignment
# AlignWith: variable

Metrics/LineLength:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength
Max: 110
# To make it possible to copy or click on URIs in the code, we allow lines
# contaning a URI to be longer than Max.
AllowURI: true
URISchemes:
- http
- https

Style/AlignHash:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylealignhash
EnforcedHashRocketStyle: table
EnforcedColonStyle: table

# Disabled, see the YaST default at the end of the file
#Style/AlignParameters:
# StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylealignparameters
# Enabled: false

Style/CollectionMethods:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylecollectionmethods
Enabled: false

Style/EmptyLinesAroundBlockBody:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#styleemptylinesaroundblockbody
Enabled: false

Style/MultilineOperationIndentation:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylemultilineoperationindentation
EnforcedStyle: indented

Style/StringLiterals:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals
EnforcedStyle: double_quotes
Enabled: false

Style/StringLiteralsInInterpolation:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliteralsininterpolation
EnforcedStyle: double_quotes

Style/WordArray:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#deviations-from-the-upstream-style-guide
Enabled: false

Style/RegexpLiteral:
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#deviations-from-the-upstream-style-guide
Enabled: false

Style/SignalException:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
EnforcedStyle: only_raise


################################################################################
#
# This part contains the YaST specific changes to the shared SUSE configuration
#
################################################################################

# no extra indentation for multiline function calls
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation

# no extra indentation for case
Style/CaseIndentation:
IndentWhenRelativeTo: end

# "unless" has a different connotation than "if not"
Style/NegatedIf:
Enabled: false


################################################################################
#
# Settings specific to the yast-hana-update module
#
################################################################################

# Edited for yast-hana-update
Metrics/MethodLength:
Max: 60

# Edited for yast-hana-update
Metrics/ClassLength:
Max: 400

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false

Metrics/AbcSize:
Enabled: false
7 changes: 7 additions & 0 deletions package/yast2-sap-ha.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Nov 4 21:34:50 UTC 2024 - Peter Varkoly <[email protected]>

- yast-sap-ha does not support SAPHanaSR-angi (bsc#1232807)
Adapt to new SAPHanaSR-angi
- 6.0.2

-------------------------------------------------------------------
Fri Mar 15 17:38:52 UTC 2024 - Peter Varkoly <[email protected]>

Expand Down
3 changes: 1 addition & 2 deletions package/yast2-sap-ha.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-sap-ha
Version: 6.0.1
Version: 6.0.2
Release: 0
BuildArch: noarch
Source0: %{name}-%{version}.tar.bz2
Expand Down Expand Up @@ -45,7 +45,6 @@ Requires: openssh
Requires: HANA-Firewall >= 2.0.3
%endif
Requires: util-linux
Requires: SAPHanaSR
Requires: kmod
# for pidof
Requires: sysvinit-tools
Expand Down
4 changes: 4 additions & 0 deletions src/clients/sap_ha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ def main
@sequence["product_check"][:hana] = "file_import_check" if @config.imported
Wizard.CreateDialog
Wizard.SetDialogTitle("HA Setup for SAP Products")
if not @config.hana.check_rsa_version
Popup.Error("There are no SUSE SAP Resource Agents installed.")
return
end
begin
if @config.unattended
Sequencer.Run(@aliases, @unattended_sequence)
Expand Down
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
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 msl_SAPHana_<%= @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 \
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_SAPHanaTop_<%= @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 %>
File renamed without changes.
Loading

0 comments on commit 5fe67c9

Please sign in to comment.