Skip to content

Commit d27d45e

Browse files
authored
Merge pull request #911 from SUSE/feat/susChrSrv
add susChkSrv HA/DR provider and make providers configurable
2 parents 38741a5 + 36d9c56 commit d27d45e

21 files changed

+192
-7
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ test-mlc:
8080
./terraform.tvars.example \
8181
../pillar/*/* \
8282
https://github.com/SUSE/ha-sap-terraform-deployments/actions \
83-
https://github.com/SUSE/ha-sap-terraform-deployments/workflows/CI%20tests/badge.svg
83+
https://github.com/SUSE/ha-sap-terraform-deployments/workflows/CI%20tests/badge.svg \
84+
https://www.sap.com/dmc/exp/2014-09-02-hana-hardware/enEN/#/solutions*
8485

8586
# test-salt-lint: @ Run linting on all salt files
8687
test-salt-lint:

aws/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ module "common_variables" {
126126
hana_scale_out_addhosts = var.hana_scale_out_addhosts
127127
hana_scale_out_standby_count = var.hana_scale_out_standby_count
128128
hana_basepath_shared = local.hana_basepath_shared
129+
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
130+
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
131+
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
129132
netweaver_sid = var.netweaver_sid
130133
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
131134
netweaver_ers_instance_number = var.netweaver_ers_instance_number

aws/terraform.tfvars.example

+10
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,16 @@ hana_inst_master = "s3://sapdata/sap_inst_media/51053381"
318318
# Cost optimized scenario
319319
#scenario_type = "cost-optimized"
320320

321+
# HANA HA/DR provider configuration
322+
# See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
323+
# The SAPHanaSR hook is always enabled.
324+
# enable susTkOver hook (disabled by default)
325+
# hana_ha_dr_sustkover_enabled = true
326+
# enable susChkSrv hook (disabled by default)
327+
# hana_ha_dr_suschksrv_enabled = true
328+
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
329+
# hana_ha_dr_suschksrv_action_on_lost = "fence"
330+
321331
#######################
322332
# SBD related variables
323333
#######################

aws/variables.tf

+18
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,24 @@ variable "hana_efs_performance_mode" {
590590
default = "generalPurpose"
591591
}
592592

593+
variable "hana_ha_dr_sustkover_enabled" {
594+
description = "enable susTkOver hook"
595+
type = bool
596+
default = false
597+
}
598+
599+
variable "hana_ha_dr_suschksrv_enabled" {
600+
description = "enable susChkSrv hook"
601+
type = bool
602+
default = false
603+
}
604+
605+
variable "hana_ha_dr_suschksrv_action_on_lost" {
606+
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
607+
type = string
608+
default = "stop"
609+
}
610+
593611
# DRBD related variables
594612

595613
variable "drbd_name" {

azure/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ module "common_variables" {
117117
hana_scale_out_addhosts = var.hana_scale_out_addhosts
118118
hana_scale_out_standby_count = var.hana_scale_out_standby_count
119119
hana_basepath_shared = local.hana_basepath_shared
120+
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
121+
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
122+
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
120123
netweaver_sid = var.netweaver_sid
121124
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
122125
netweaver_ers_instance_number = var.netweaver_ers_instance_number

azure/terraform.tfvars.example

+10
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,16 @@ hana_inst_master = "//YOUR_STORAGE_ACCOUNT_NAME.file.core.windows.net/sapdata/sa
384384
# fencing mechanism for HANA cluster (Options: sbd [default], native)
385385
# hana_cluster_fencing_mechanism = "sbd"
386386

387+
# HANA HA/DR provider configuration
388+
# See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
389+
# The SAPHanaSR hook is always enabled.
390+
# enable susTkOver hook (disabled by default)
391+
# hana_ha_dr_sustkover_enabled = true
392+
# enable susChkSrv hook (disabled by default)
393+
# hana_ha_dr_suschksrv_enabled = true
394+
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
395+
# hana_ha_dr_suschksrv_action_on_lost = "fence"
396+
387397
#######################
388398
# SBD related variables
389399
#######################

azure/variables.tf

+18-1
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,24 @@ variable "hana_scale_out_standby_count" {
557557
default = "0"
558558
}
559559

560+
variable "hana_ha_dr_sustkover_enabled" {
561+
description = "enable susTkOver hook"
562+
type = bool
563+
default = false
564+
}
565+
566+
variable "hana_ha_dr_suschksrv_enabled" {
567+
description = "enable susChkSrv hook"
568+
type = bool
569+
default = false
570+
}
571+
572+
variable "hana_ha_dr_suschksrv_action_on_lost" {
573+
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
574+
type = string
575+
default = "stop"
576+
}
577+
560578
# SBD related variables
561579
# In order to enable SBD, an ISCSI server is needed as right now is the unique option
562580
# All the clusters will use the same mechanism
@@ -1103,4 +1121,3 @@ variable "hana_scale_out_anf_quota_shared" {
11031121
type = number
11041122
default = "2000"
11051123
}
1106-

doc/workspaces-workflow.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The proposed workflow is the following:
2424

2525
To create a new workspace:
2626

27-
`terraform worspace new $USER-test-amazing-stuff`
27+
`terraform workspace new $USER-test-amazing-stuff`
2828

2929
Show current workspace:
3030

gcp/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ module "common_variables" {
135135
hana_scale_out_addhosts = var.hana_scale_out_addhosts
136136
hana_scale_out_standby_count = var.hana_scale_out_standby_count
137137
hana_basepath_shared = local.hana_basepath_shared
138+
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
139+
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
140+
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
138141
netweaver_sid = var.netweaver_sid
139142
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
140143
netweaver_ers_instance_number = var.netweaver_ers_instance_number

gcp/terraform.tfvars.example

+10
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,16 @@ hana_inst_master = "MyHanaBucket/sapdata/sap_inst_media/51053381"
355355
# Cost optimized scenario
356356
#scenario_type = "cost-optimized"
357357

358+
# HANA HA/DR provider configuration
359+
# See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
360+
# The SAPHanaSR hook is always enabled.
361+
# enable susTkOver hook (disabled by default)
362+
# hana_ha_dr_sustkover_enabled = true
363+
# enable susChkSrv hook (disabled by default)
364+
# hana_ha_dr_suschksrv_enabled = true
365+
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
366+
# hana_ha_dr_suschksrv_action_on_lost = "fence"
367+
358368
#######################
359369
# SBD related variables
360370
#######################

gcp/variables.tf

+18
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,24 @@ variable "hana_scale_out_standby_count" {
526526
default = "0"
527527
}
528528

529+
variable "hana_ha_dr_sustkover_enabled" {
530+
description = "enable susTkOver hook"
531+
type = bool
532+
default = false
533+
}
534+
535+
variable "hana_ha_dr_suschksrv_enabled" {
536+
description = "enable susChkSrv hook"
537+
type = bool
538+
default = false
539+
}
540+
541+
variable "hana_ha_dr_suschksrv_action_on_lost" {
542+
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
543+
type = string
544+
default = "stop"
545+
}
546+
529547
variable "filestore_tier" {
530548
description = "service level / tier for filestore shared Storage"
531549
type = string

generic_modules/common_variables/hana_variables.tf

+21
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,24 @@ variable "hana_basepath_shared" {
217217
type = bool
218218
default = true
219219
}
220+
221+
variable "hana_ha_dr_sustkover_enabled" {
222+
description = "enable susTkOver hook"
223+
type = bool
224+
}
225+
226+
variable "hana_ha_dr_suschksrv_enabled" {
227+
description = "enable susChkSrv hook"
228+
type = bool
229+
}
230+
231+
variable "hana_ha_dr_suschksrv_action_on_lost" {
232+
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
233+
type = string
234+
validation {
235+
condition = (
236+
can(regex("^(stop|fence)$", var.hana_ha_dr_suschksrv_action_on_lost))
237+
)
238+
error_message = "Invalid action on lost for susChkrSrv. Options: stop, fence."
239+
}
240+
}

generic_modules/common_variables/outputs.tf

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ output "configuration" {
7474
scale_out_addhosts = var.hana_scale_out_addhosts
7575
scale_out_standby_count = var.hana_scale_out_standby_count
7676
basepath_shared = var.hana_basepath_shared
77+
ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
78+
ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
79+
ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
7780
}
7881
netweaver = {
7982
ha_enabled = var.netweaver_ha_enabled
@@ -164,6 +167,9 @@ hana_scale_out_shared_storage_type: ${var.hana_scale_out_shared_storage_type}
164167
hana_scale_out_addhosts: {${join(", ", formatlist("'%s': '%s'", keys(var.hana_scale_out_addhosts), values(var.hana_scale_out_addhosts), ), )}}
165168
hana_scale_out_standby_count: ${var.hana_scale_out_standby_count}
166169
hana_basepath_shared: ${var.hana_basepath_shared}
170+
hana_ha_dr_sustkover_enabled: ${var.hana_ha_dr_sustkover_enabled}
171+
hana_ha_dr_suschksrv_enabled: ${var.hana_ha_dr_suschksrv_enabled}
172+
hana_ha_dr_suschksrv_action_on_lost: ${var.hana_ha_dr_suschksrv_action_on_lost}
167173
scenario_type: ${var.hana_scenario_type}
168174
hwcct: ${var.hana_hwcct}
169175
ha_enabled: ${var.hana_ha_enabled}

libvirt/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ module "common_variables" {
124124
hana_scale_out_addhosts = var.hana_scale_out_addhosts
125125
hana_scale_out_standby_count = var.hana_scale_out_standby_count
126126
hana_basepath_shared = local.hana_basepath_shared
127+
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
128+
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
129+
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
127130
netweaver_sid = var.netweaver_sid
128131
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
129132
netweaver_ers_instance_number = var.netweaver_ers_instance_number

libvirt/terraform.tfvars.example

+10
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@ hana_inst_master = "url-to-your-nfs-share:/sapdata/sap_inst_media/51053381"
276276
# paths = "/usr/sap"
277277
#}
278278

279+
# HANA HA/DR provider configuration
280+
# See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
281+
# The SAPHanaSR hook is always enabled.
282+
# enable susTkOver hook (disabled by default)
283+
# hana_ha_dr_sustkover_enabled = true
284+
# enable susChkSrv hook (disabled by default)
285+
# hana_ha_dr_suschksrv_enabled = true
286+
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
287+
# hana_ha_dr_suschksrv_action_on_lost = "fence"
288+
279289
#######################
280290
# SBD related variables
281291
#######################

libvirt/variables.tf

+18
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,24 @@ variable "hana_scale_out_nfs" {
477477
default = ""
478478
}
479479

480+
variable "hana_ha_dr_sustkover_enabled" {
481+
description = "enable susTkOver hook"
482+
type = bool
483+
default = false
484+
}
485+
486+
variable "hana_ha_dr_suschksrv_enabled" {
487+
description = "enable susChkSrv hook"
488+
type = bool
489+
default = false
490+
}
491+
492+
variable "hana_ha_dr_suschksrv_action_on_lost" {
493+
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
494+
type = string
495+
default = "stop"
496+
}
497+
480498
# SBD related variables
481499
# In order to enable SBD, an ISCSI server is needed as right now is the unique option
482500
# All the clusters will use the same mechanism

openstack/main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ module "common_variables" {
138138
hana_scale_out_addhosts = var.hana_scale_out_addhosts
139139
hana_scale_out_standby_count = var.hana_scale_out_standby_count
140140
hana_basepath_shared = local.hana_basepath_shared
141+
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
142+
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
143+
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
141144
netweaver_sid = var.netweaver_sid
142145
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
143146
netweaver_ers_instance_number = var.netweaver_ers_instance_number

openstack/terraform.tfvars.example

+10
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,16 @@ hana_ips = ["10.0.0.10", "10.0.0.11"]
361361
# enable this to deploy the Cost optimized scenario (off by default)
362362
#scenario_type = "cost-optimized"
363363

364+
# HANA HA/DR provider configuration
365+
# See https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#cha.s4s.hana-hook for details.
366+
# The SAPHanaSR hook is always enabled.
367+
# enable susTkOver hook (disabled by default)
368+
# hana_ha_dr_sustkover_enabled = true
369+
# enable susChkSrv hook (disabled by default)
370+
# hana_ha_dr_suschksrv_enabled = true
371+
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
372+
# hana_ha_dr_suschksrv_action_on_lost = "fence"
373+
364374
#######################
365375
# SBD related variables
366376
#######################

openstack/variables.tf

+18
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,24 @@ variable "hana_majority_maker_ip" {
549549
}
550550
}
551551

552+
variable "hana_ha_dr_sustkover_enabled" {
553+
description = "enable susTkOver hook"
554+
type = bool
555+
default = false
556+
}
557+
558+
variable "hana_ha_dr_suschksrv_enabled" {
559+
description = "enable susChkSrv hook"
560+
type = bool
561+
default = false
562+
}
563+
564+
variable "hana_ha_dr_suschksrv_action_on_lost" {
565+
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
566+
type = string
567+
default = "stop"
568+
}
569+
552570
# Monitoring related variables
553571

554572
variable "monitoring_name" {

pillar_examples/automatic/hana/hana.sls

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ hana:
6262
monitoring_enabled: {{ grains['monitoring_enabled']|default(False) }}
6363
ha_enabled: {{ grains['ha_enabled'] }}
6464
basepath_shared: {{ grains['hana_basepath_shared']|default(True) }}
65+
ha_dr_sustkover_enabled: {{ grains['hana_ha_dr_sustkover_enabled']|default(False) }}
66+
ha_dr_suschksrv_enabled: {{ grains['hana_ha_dr_suschksrv_enabled']|default(False) }}
67+
ha_dr_suschksrv_action_on_lost: {{ grains['hana_ha_dr_suschksrv_action_on_lost']|default('stop') }}
6568
nodes:
6669
- host: {{ grains['name_prefix'] }}01
6770
sid: {{ grains['hana_sid'].lower() }}

requirements.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
hana_node:
33
python-shaptools: 0.3.13+git.1651505455.cee9bd8
44
python3-shaptools: 0.3.13+git.1651505455.cee9bd8
5-
salt-shaptools: 0.3.17+git.1651504665.6e49c5b
5+
salt-shaptools: 0.3.18+git.1690200022.db379c1
66
habootstrap-formula: 0.4.8+git.1660641261.50edfd7
7-
saphanabootstrap-formula: 0.13.0+git.1660641499.5213c99
7+
saphanabootstrap-formula: 0.14.0+git.1699438512.4930943
88
drbd_node:
99
python-shaptools: 0.3.13+git.1651505455.cee9bd8
1010
python3-shaptools: 0.3.13+git.1651505455.cee9bd8
11-
salt-shaptools: 0.3.17+git.1651504665.6e49c5b
11+
salt-shaptools: 0.3.18+git.1690200022.db379c1
1212
habootstrap-formula: 0.4.8+git.1660641261.50edfd7
1313
drbd-formula: 0.5.0+git.1637569723.cf85049
1414
netweaver_node:
1515
python-shaptools: 0.3.13+git.1651505455.cee9bd8
1616
python3-shaptools: 0.3.13+git.1651505455.cee9bd8
17-
salt-shaptools: 0.3.17+git.1651504665.6e49c5b
17+
salt-shaptools: 0.3.18+git.1690200022.db379c1
1818
habootstrap-formula: 0.4.8+git.1660641261.50edfd7
1919
sapnwbootstrap-formula: 0.7.5+git.1660133259.5ed78f4
2020
iscsi_srv:

0 commit comments

Comments
 (0)