diff --git a/aws/main.tf b/aws/main.tf index fe3fc159..255585b2 100644 --- a/aws/main.tf +++ b/aws/main.tf @@ -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 diff --git a/aws/terraform.tfvars.example b/aws/terraform.tfvars.example index dafc42bc..02cdea2e 100644 --- a/aws/terraform.tfvars.example +++ b/aws/terraform.tfvars.example @@ -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 ####################### diff --git a/aws/variables.tf b/aws/variables.tf index 95e80e45..ab66a441 100644 --- a/aws/variables.tf +++ b/aws/variables.tf @@ -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" { diff --git a/azure/main.tf b/azure/main.tf index 697743c9..7ec074b5 100644 --- a/azure/main.tf +++ b/azure/main.tf @@ -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 diff --git a/azure/terraform.tfvars.example b/azure/terraform.tfvars.example index c9687081..5fc77c6a 100644 --- a/azure/terraform.tfvars.example +++ b/azure/terraform.tfvars.example @@ -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 ####################### diff --git a/azure/variables.tf b/azure/variables.tf index 42eae460..695bbbb1 100644 --- a/azure/variables.tf +++ b/azure/variables.tf @@ -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 @@ -1103,4 +1121,3 @@ variable "hana_scale_out_anf_quota_shared" { type = number default = "2000" } - diff --git a/gcp/main.tf b/gcp/main.tf index e8a38c62..77208005 100644 --- a/gcp/main.tf +++ b/gcp/main.tf @@ -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 diff --git a/gcp/terraform.tfvars.example b/gcp/terraform.tfvars.example index 08a8fd92..f08a9a80 100644 --- a/gcp/terraform.tfvars.example +++ b/gcp/terraform.tfvars.example @@ -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 ####################### diff --git a/gcp/variables.tf b/gcp/variables.tf index 7e4a3a24..bc168bc6 100644 --- a/gcp/variables.tf +++ b/gcp/variables.tf @@ -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 diff --git a/generic_modules/common_variables/hana_variables.tf b/generic_modules/common_variables/hana_variables.tf index 9ab1243d..5647c69f 100644 --- a/generic_modules/common_variables/hana_variables.tf +++ b/generic_modules/common_variables/hana_variables.tf @@ -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." + } +} diff --git a/generic_modules/common_variables/outputs.tf b/generic_modules/common_variables/outputs.tf index 533415a8..e3b1bcd0 100644 --- a/generic_modules/common_variables/outputs.tf +++ b/generic_modules/common_variables/outputs.tf @@ -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 @@ -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} diff --git a/libvirt/main.tf b/libvirt/main.tf index c977b7e9..acd7d7f7 100644 --- a/libvirt/main.tf +++ b/libvirt/main.tf @@ -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 diff --git a/libvirt/terraform.tfvars.example b/libvirt/terraform.tfvars.example index 16647373..0808a868 100644 --- a/libvirt/terraform.tfvars.example +++ b/libvirt/terraform.tfvars.example @@ -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 ####################### diff --git a/libvirt/variables.tf b/libvirt/variables.tf index ee9e371f..961b562c 100644 --- a/libvirt/variables.tf +++ b/libvirt/variables.tf @@ -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 diff --git a/openstack/main.tf b/openstack/main.tf index f6890593..5da8b1c4 100644 --- a/openstack/main.tf +++ b/openstack/main.tf @@ -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 diff --git a/openstack/terraform.tfvars.example b/openstack/terraform.tfvars.example index 5db1ee66..80906d17 100644 --- a/openstack/terraform.tfvars.example +++ b/openstack/terraform.tfvars.example @@ -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 ####################### diff --git a/openstack/variables.tf b/openstack/variables.tf index d932843c..d43952e5 100644 --- a/openstack/variables.tf +++ b/openstack/variables.tf @@ -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" { diff --git a/pillar_examples/automatic/hana/hana.sls b/pillar_examples/automatic/hana/hana.sls index 2e8e6691..55a06c8c 100644 --- a/pillar_examples/automatic/hana/hana.sls +++ b/pillar_examples/automatic/hana/hana.sls @@ -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() }}