Skip to content

Commit

Permalink
add susChkSrv HA/DR provider
Browse files Browse the repository at this point in the history
make providers configurable
  • Loading branch information
yeoldegrove committed Nov 7, 2023
1 parent 38741a5 commit e695b4e
Show file tree
Hide file tree
Showing 18 changed files with 185 additions and 1 deletion.
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.
# disable susTkOver hook (enabled by default)
# hana_ha_dr_sustkover_enabled = false
# disable susChkSrv hook (enabled by default)
# hana_ha_dr_suschksrv = false
# 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 = true
}

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

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.
# disable susTkOver hook (enabled by default)
# hana_ha_dr_sustkover_enabled = false
# disable susChkSrv hook (enabled by default)
# hana_ha_dr_suschksrv = false
# 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 = true
}

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

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"
}

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.
# disable susTkOver hook (enabled by default)
# hana_ha_dr_sustkover_enabled = false
# disable susChkSrv hook (enabled by default)
# hana_ha_dr_suschksrv = false
# 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 = true
}

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

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.
# disable susTkOver hook (enabled by default)
# hana_ha_dr_sustkover_enabled = false
# disable susChkSrv hook (enabled by default)
# hana_ha_dr_suschksrv = false
# 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 = true
}

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

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.
# disable susTkOver hook (enabled by default)
# hana_ha_dr_sustkover_enabled = false
# disable susChkSrv hook (enabled by default)
# hana_ha_dr_suschksrv = false
# 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 = true
}

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

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(True) }}
ha_dr_suschksrv_enabled: {{ grains['hana_ha_dr_suschksrv_enabled']|default(True) }}
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

0 comments on commit e695b4e

Please sign in to comment.