Skip to content

Commit

Permalink
Merge pull request #911 from SUSE/feat/susChrSrv
Browse files Browse the repository at this point in the history
add susChkSrv HA/DR provider and make providers configurable
  • Loading branch information
yeoldegrove committed Nov 8, 2023
2 parents 38741a5 + 36d9c56 commit d27d45e
Show file tree
Hide file tree
Showing 21 changed files with 192 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ test-mlc:
./terraform.tvars.example \
../pillar/*/* \
https://github.com/SUSE/ha-sap-terraform-deployments/actions \
https://github.com/SUSE/ha-sap-terraform-deployments/workflows/CI%20tests/badge.svg
https://github.com/SUSE/ha-sap-terraform-deployments/workflows/CI%20tests/badge.svg \
https://www.sap.com/dmc/exp/2014-09-02-hana-hardware/enEN/#/solutions*

# test-salt-lint: @ Run linting on all salt files
test-salt-lint:
Expand Down
3 changes: 3 additions & 0 deletions aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ module "common_variables" {
hana_scale_out_addhosts = var.hana_scale_out_addhosts
hana_scale_out_standby_count = var.hana_scale_out_standby_count
hana_basepath_shared = local.hana_basepath_shared
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
netweaver_sid = var.netweaver_sid
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
netweaver_ers_instance_number = var.netweaver_ers_instance_number
Expand Down
10 changes: 10 additions & 0 deletions aws/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ hana_inst_master = "s3://sapdata/sap_inst_media/51053381"
# Cost optimized scenario
#scenario_type = "cost-optimized"

# 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)
# hana_ha_dr_sustkover_enabled = true
# enable susChkSrv hook (disabled by default)
# hana_ha_dr_suschksrv_enabled = true
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
# hana_ha_dr_suschksrv_action_on_lost = "fence"

#######################
# SBD related variables
#######################
Expand Down
18 changes: 18 additions & 0 deletions aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,24 @@ variable "hana_efs_performance_mode" {
default = "generalPurpose"
}

variable "hana_ha_dr_sustkover_enabled" {
description = "enable susTkOver hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_enabled" {
description = "enable susChkSrv hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_action_on_lost" {
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
type = string
default = "stop"
}

# DRBD related variables

variable "drbd_name" {
Expand Down
3 changes: 3 additions & 0 deletions azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ module "common_variables" {
hana_scale_out_addhosts = var.hana_scale_out_addhosts
hana_scale_out_standby_count = var.hana_scale_out_standby_count
hana_basepath_shared = local.hana_basepath_shared
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
netweaver_sid = var.netweaver_sid
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
netweaver_ers_instance_number = var.netweaver_ers_instance_number
Expand Down
10 changes: 10 additions & 0 deletions azure/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ hana_inst_master = "//YOUR_STORAGE_ACCOUNT_NAME.file.core.windows.net/sapdata/sa
# fencing mechanism for HANA cluster (Options: sbd [default], native)
# hana_cluster_fencing_mechanism = "sbd"

# 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)
# hana_ha_dr_sustkover_enabled = true
# enable susChkSrv hook (disabled by default)
# hana_ha_dr_suschksrv_enabled = true
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
# hana_ha_dr_suschksrv_action_on_lost = "fence"

#######################
# SBD related variables
#######################
Expand Down
19 changes: 18 additions & 1 deletion azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,24 @@ variable "hana_scale_out_standby_count" {
default = "0"
}

variable "hana_ha_dr_sustkover_enabled" {
description = "enable susTkOver hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_enabled" {
description = "enable susChkSrv hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_action_on_lost" {
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
type = string
default = "stop"
}

# SBD related variables
# In order to enable SBD, an ISCSI server is needed as right now is the unique option
# All the clusters will use the same mechanism
Expand Down Expand Up @@ -1103,4 +1121,3 @@ variable "hana_scale_out_anf_quota_shared" {
type = number
default = "2000"
}

2 changes: 1 addition & 1 deletion doc/workspaces-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The proposed workflow is the following:

To create a new workspace:

`terraform worspace new $USER-test-amazing-stuff`
`terraform workspace new $USER-test-amazing-stuff`

Show current workspace:

Expand Down
3 changes: 3 additions & 0 deletions gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ module "common_variables" {
hana_scale_out_addhosts = var.hana_scale_out_addhosts
hana_scale_out_standby_count = var.hana_scale_out_standby_count
hana_basepath_shared = local.hana_basepath_shared
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
netweaver_sid = var.netweaver_sid
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
netweaver_ers_instance_number = var.netweaver_ers_instance_number
Expand Down
10 changes: 10 additions & 0 deletions gcp/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ hana_inst_master = "MyHanaBucket/sapdata/sap_inst_media/51053381"
# Cost optimized scenario
#scenario_type = "cost-optimized"

# 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)
# hana_ha_dr_sustkover_enabled = true
# enable susChkSrv hook (disabled by default)
# hana_ha_dr_suschksrv_enabled = true
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
# hana_ha_dr_suschksrv_action_on_lost = "fence"

#######################
# SBD related variables
#######################
Expand Down
18 changes: 18 additions & 0 deletions gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,24 @@ variable "hana_scale_out_standby_count" {
default = "0"
}

variable "hana_ha_dr_sustkover_enabled" {
description = "enable susTkOver hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_enabled" {
description = "enable susChkSrv hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_action_on_lost" {
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
type = string
default = "stop"
}

variable "filestore_tier" {
description = "service level / tier for filestore shared Storage"
type = string
Expand Down
21 changes: 21 additions & 0 deletions generic_modules/common_variables/hana_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,24 @@ variable "hana_basepath_shared" {
type = bool
default = true
}

variable "hana_ha_dr_sustkover_enabled" {
description = "enable susTkOver hook"
type = bool
}

variable "hana_ha_dr_suschksrv_enabled" {
description = "enable susChkSrv hook"
type = bool
}

variable "hana_ha_dr_suschksrv_action_on_lost" {
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
type = string
validation {
condition = (
can(regex("^(stop|fence)$", var.hana_ha_dr_suschksrv_action_on_lost))
)
error_message = "Invalid action on lost for susChkrSrv. Options: stop, fence."
}
}
6 changes: 6 additions & 0 deletions generic_modules/common_variables/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ output "configuration" {
scale_out_addhosts = var.hana_scale_out_addhosts
scale_out_standby_count = var.hana_scale_out_standby_count
basepath_shared = var.hana_basepath_shared
ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
}
netweaver = {
ha_enabled = var.netweaver_ha_enabled
Expand Down Expand Up @@ -164,6 +167,9 @@ hana_scale_out_shared_storage_type: ${var.hana_scale_out_shared_storage_type}
hana_scale_out_addhosts: {${join(", ", formatlist("'%s': '%s'", keys(var.hana_scale_out_addhosts), values(var.hana_scale_out_addhosts), ), )}}
hana_scale_out_standby_count: ${var.hana_scale_out_standby_count}
hana_basepath_shared: ${var.hana_basepath_shared}
hana_ha_dr_sustkover_enabled: ${var.hana_ha_dr_sustkover_enabled}
hana_ha_dr_suschksrv_enabled: ${var.hana_ha_dr_suschksrv_enabled}
hana_ha_dr_suschksrv_action_on_lost: ${var.hana_ha_dr_suschksrv_action_on_lost}
scenario_type: ${var.hana_scenario_type}
hwcct: ${var.hana_hwcct}
ha_enabled: ${var.hana_ha_enabled}
Expand Down
3 changes: 3 additions & 0 deletions libvirt/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ module "common_variables" {
hana_scale_out_addhosts = var.hana_scale_out_addhosts
hana_scale_out_standby_count = var.hana_scale_out_standby_count
hana_basepath_shared = local.hana_basepath_shared
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
netweaver_sid = var.netweaver_sid
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
netweaver_ers_instance_number = var.netweaver_ers_instance_number
Expand Down
10 changes: 10 additions & 0 deletions libvirt/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ hana_inst_master = "url-to-your-nfs-share:/sapdata/sap_inst_media/51053381"
# paths = "/usr/sap"
#}

# 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)
# hana_ha_dr_sustkover_enabled = true
# enable susChkSrv hook (disabled by default)
# hana_ha_dr_suschksrv_enabled = true
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
# hana_ha_dr_suschksrv_action_on_lost = "fence"

#######################
# SBD related variables
#######################
Expand Down
18 changes: 18 additions & 0 deletions libvirt/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,24 @@ variable "hana_scale_out_nfs" {
default = ""
}

variable "hana_ha_dr_sustkover_enabled" {
description = "enable susTkOver hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_enabled" {
description = "enable susChkSrv hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_action_on_lost" {
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
type = string
default = "stop"
}

# SBD related variables
# In order to enable SBD, an ISCSI server is needed as right now is the unique option
# All the clusters will use the same mechanism
Expand Down
3 changes: 3 additions & 0 deletions openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ module "common_variables" {
hana_scale_out_addhosts = var.hana_scale_out_addhosts
hana_scale_out_standby_count = var.hana_scale_out_standby_count
hana_basepath_shared = local.hana_basepath_shared
hana_ha_dr_sustkover_enabled = var.hana_ha_dr_sustkover_enabled
hana_ha_dr_suschksrv_enabled = var.hana_ha_dr_suschksrv_enabled
hana_ha_dr_suschksrv_action_on_lost = var.hana_ha_dr_suschksrv_action_on_lost
netweaver_sid = var.netweaver_sid
netweaver_ascs_instance_number = var.netweaver_ascs_instance_number
netweaver_ers_instance_number = var.netweaver_ers_instance_number
Expand Down
10 changes: 10 additions & 0 deletions openstack/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,16 @@ hana_ips = ["10.0.0.10", "10.0.0.11"]
# enable this to deploy the Cost optimized scenario (off by default)
#scenario_type = "cost-optimized"

# 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)
# hana_ha_dr_sustkover_enabled = true
# enable susChkSrv hook (disabled by default)
# hana_ha_dr_suschksrv_enabled = true
# susChkSrv action on lost, see `man 7 susChkSrv.py` (Options: stop [default], fence)
# hana_ha_dr_suschksrv_action_on_lost = "fence"

#######################
# SBD related variables
#######################
Expand Down
18 changes: 18 additions & 0 deletions openstack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,24 @@ variable "hana_majority_maker_ip" {
}
}

variable "hana_ha_dr_sustkover_enabled" {
description = "enable susTkOver hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_enabled" {
description = "enable susChkSrv hook"
type = bool
default = false
}

variable "hana_ha_dr_suschksrv_action_on_lost" {
description = "define action on lost for susChkSrv, see `man 7 susChkSrv.py`"
type = string
default = "stop"
}

# Monitoring related variables

variable "monitoring_name" {
Expand Down
3 changes: 3 additions & 0 deletions pillar_examples/automatic/hana/hana.sls
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ hana:
monitoring_enabled: {{ grains['monitoring_enabled']|default(False) }}
ha_enabled: {{ grains['ha_enabled'] }}
basepath_shared: {{ grains['hana_basepath_shared']|default(True) }}
ha_dr_sustkover_enabled: {{ grains['hana_ha_dr_sustkover_enabled']|default(False) }}
ha_dr_suschksrv_enabled: {{ grains['hana_ha_dr_suschksrv_enabled']|default(False) }}
ha_dr_suschksrv_action_on_lost: {{ grains['hana_ha_dr_suschksrv_action_on_lost']|default('stop') }}
nodes:
- host: {{ grains['name_prefix'] }}01
sid: {{ grains['hana_sid'].lower() }}
Expand Down
8 changes: 4 additions & 4 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
hana_node:
python-shaptools: 0.3.13+git.1651505455.cee9bd8
python3-shaptools: 0.3.13+git.1651505455.cee9bd8
salt-shaptools: 0.3.17+git.1651504665.6e49c5b
salt-shaptools: 0.3.18+git.1690200022.db379c1
habootstrap-formula: 0.4.8+git.1660641261.50edfd7
saphanabootstrap-formula: 0.13.0+git.1660641499.5213c99
saphanabootstrap-formula: 0.14.0+git.1699438512.4930943
drbd_node:
python-shaptools: 0.3.13+git.1651505455.cee9bd8
python3-shaptools: 0.3.13+git.1651505455.cee9bd8
salt-shaptools: 0.3.17+git.1651504665.6e49c5b
salt-shaptools: 0.3.18+git.1690200022.db379c1
habootstrap-formula: 0.4.8+git.1660641261.50edfd7
drbd-formula: 0.5.0+git.1637569723.cf85049
netweaver_node:
python-shaptools: 0.3.13+git.1651505455.cee9bd8
python3-shaptools: 0.3.13+git.1651505455.cee9bd8
salt-shaptools: 0.3.17+git.1651504665.6e49c5b
salt-shaptools: 0.3.18+git.1690200022.db379c1
habootstrap-formula: 0.4.8+git.1660641261.50edfd7
sapnwbootstrap-formula: 0.7.5+git.1660133259.5ed78f4
iscsi_srv:
Expand Down

0 comments on commit d27d45e

Please sign in to comment.