From 105516714d6ec290c6a708d8f6264ca2a48f61e9 Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Wed, 29 Jan 2025 12:36:21 +0100 Subject: [PATCH 1/4] Enchance changes --- package/yast2-sap-ha.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/yast2-sap-ha.changes b/package/yast2-sap-ha.changes index e074e24..851d1db 100644 --- a/package/yast2-sap-ha.changes +++ b/package/yast2-sap-ha.changes @@ -3,6 +3,8 @@ Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly - yast-sap-ha does not support SAPHanaSR-angi (bsc#1232807) - Adapt to new SAPHanaSR-angi +- #458 [doc] Issue in "Constraints for SAPHanaSR-angi" + https://github.com/SUSE/suse-best-practices/issues/458 - 4.5.12 ------------------------------------------------------------------- From 521fb6447aacdf490d098bd524d56ad34dfbb4c1 Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Wed, 29 Jan 2025 12:37:00 +0100 Subject: [PATCH 2/4] Enchance changes --- package/yast2-sap-ha.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/yast2-sap-ha.changes b/package/yast2-sap-ha.changes index b9fde01..96d005e 100644 --- a/package/yast2-sap-ha.changes +++ b/package/yast2-sap-ha.changes @@ -3,6 +3,8 @@ Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly - yast-sap-ha does not support SAPHanaSR-angi (bsc#1232807) - Adapt to new SAPHanaSR-angi + #458 [doc] Issue in "Constraints for SAPHanaSR-angi" + https://github.com/SUSE/suse-best-practices/issues/458 - 4.6.4 ------------------------------------------------------------------- From 4a5e6e21413d5e7b1a27eac39f1a098ba2a644a7 Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Wed, 29 Jan 2025 12:38:04 +0100 Subject: [PATCH 3/4] Enchance changes --- package/yast2-sap-ha.changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/yast2-sap-ha.changes b/package/yast2-sap-ha.changes index 873b656..dd5757b 100644 --- a/package/yast2-sap-ha.changes +++ b/package/yast2-sap-ha.changes @@ -4,6 +4,8 @@ Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly - yast-sap-ha does not support SAPHanaSR-angi (bsc#1232807) Fix used templates Add missed distinguishing between classic and angi + #458 [doc] Issue in "Constraints for SAPHanaSR-angi" + https://github.com/SUSE/suse-best-practices/issues/458 - 4.7.2 ------------------------------------------------------------------- From a91716bee087e72847c6bc900cd15b12037ff07e Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Mon, 3 Feb 2025 14:51:55 +0100 Subject: [PATCH 4/4] yast sap_ha should check if HDB is running on primary (bsc#1235773) Build in a check if the DB is running on both nodes. --- package/yast2-sap-ha.changes | 7 +++++ package/yast2-sap-ha.spec | 2 +- src/data/sap_ha/help_prereq_hana_su_co.html | 1 + .../sap_ha/help_prereq_hana_su_co_azure.html | 1 + src/data/sap_ha/help_prereq_hana_su_mt.html | 1 + .../sap_ha/help_prereq_hana_su_mt_azure.html | 1 + src/data/sap_ha/help_prereq_hana_su_po.html | 1 + .../sap_ha/help_prereq_hana_su_po_azure.html | 1 + src/lib/sap_ha/configuration/hana.rb | 1 + src/lib/sap_ha/semantic_checks.rb | 29 ++++++++++++++++--- 10 files changed, 40 insertions(+), 5 deletions(-) diff --git a/package/yast2-sap-ha.changes b/package/yast2-sap-ha.changes index 851d1db..6c12ef2 100644 --- a/package/yast2-sap-ha.changes +++ b/package/yast2-sap-ha.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Feb 3 13:18:25 UTC 2025 - Peter Varkoly + +- yast sap_ha should check if HDB is running on primary + (bsc#1235773) Build in a check if the DB is running on both nodes. +- 4.5.13 + ------------------------------------------------------------------- Wed Jan 29 11:06:24 UTC 2025 - Peter Varkoly diff --git a/package/yast2-sap-ha.spec b/package/yast2-sap-ha.spec index 61e32b0..acc6b2f 100644 --- a/package/yast2-sap-ha.spec +++ b/package/yast2-sap-ha.spec @@ -17,7 +17,7 @@ Name: yast2-sap-ha -Version: 4.5.12 +Version: 4.5.13 Release: 0 BuildArch: noarch Source0: %{name}-%{version}.tar.bz2 diff --git a/src/data/sap_ha/help_prereq_hana_su_co.html b/src/data/sap_ha/help_prereq_hana_su_co.html index 4ba20d4..1e8844f 100644 --- a/src/data/sap_ha/help_prereq_hana_su_co.html +++ b/src/data/sap_ha/help_prereq_hana_su_co.html @@ -5,6 +5,7 @@

SAP HANA System Replication Scale Up: Cost-Optimized

There are two machines with SAP HANA installed.
Note that the machine you run the wizard on becomes the primary node in the cluster. +
  • Verify that both databases are up and running.
  • You have created one of the following:
      diff --git a/src/data/sap_ha/help_prereq_hana_su_co_azure.html b/src/data/sap_ha/help_prereq_hana_su_co_azure.html index 949ec31..3e26902 100644 --- a/src/data/sap_ha/help_prereq_hana_su_co_azure.html +++ b/src/data/sap_ha/help_prereq_hana_su_co_azure.html @@ -18,6 +18,7 @@

      SAP HANA System Replication Scale Up: Cost-Optimized in Microsoft® Azure There are two machines with SAP HANA installed.
      Note that the machine you run the wizard on becomes the primary node in the cluster. +
    • Verify that both databases are up and running.
    • The master node SSH public key is authorized for SSH access to the secondary node. This is needed when SSH password access is disabled, which is the default on Microsoft Azure.
    • diff --git a/src/data/sap_ha/help_prereq_hana_su_mt.html b/src/data/sap_ha/help_prereq_hana_su_mt.html index 32a0561..3df6e5e 100644 --- a/src/data/sap_ha/help_prereq_hana_su_mt.html +++ b/src/data/sap_ha/help_prereq_hana_su_mt.html @@ -5,6 +5,7 @@

      SAP HANA System Replication Scale Up: Multi-Tier

      There are two machines with SAP HANA installed.
      Note that the machine you run the wizard on becomes the primary node in the cluster. +
    • Verify that both databases are up and running.
    • You have created one of the following:
        diff --git a/src/data/sap_ha/help_prereq_hana_su_mt_azure.html b/src/data/sap_ha/help_prereq_hana_su_mt_azure.html index 127eba5..ea83541 100644 --- a/src/data/sap_ha/help_prereq_hana_su_mt_azure.html +++ b/src/data/sap_ha/help_prereq_hana_su_mt_azure.html @@ -18,6 +18,7 @@

        SAP HANA System Replication Scale Up: Multi-Tier in Microsoft® Azure® There are two machines with SAP HANA installed.
        Note that the machine you run the wizard on becomes the primary node in the cluster. +
      • Verify that both databases are up and running.
      • The master node SSH public key is authorized for SSH access to the secondary node. This is needed when SSH password access is disabled, which is the default on Microsoft Azure.
      • diff --git a/src/data/sap_ha/help_prereq_hana_su_po.html b/src/data/sap_ha/help_prereq_hana_su_po.html index 3dfe52c..586e432 100644 --- a/src/data/sap_ha/help_prereq_hana_su_po.html +++ b/src/data/sap_ha/help_prereq_hana_su_po.html @@ -5,6 +5,7 @@

        SAP HANA System Replication Scale Up: Performance-Optimized

        There are two machines with SAP HANA installed.
        Note that the machine you run the wizard on becomes the primary node in the cluster. +
      • Verify that both databases are up and running.
      • You have created one of the following:
          diff --git a/src/data/sap_ha/help_prereq_hana_su_po_azure.html b/src/data/sap_ha/help_prereq_hana_su_po_azure.html index 0c4e499..bdb56d8 100644 --- a/src/data/sap_ha/help_prereq_hana_su_po_azure.html +++ b/src/data/sap_ha/help_prereq_hana_su_po_azure.html @@ -18,6 +18,7 @@

          SAP HANA System Replication Scale Up: Performance-Optimized in Microsoft® There are two machines with SAP HANA installed.
          Note that the machine you run the wizard on becomes the primary node in the cluster. +
        • Verify that both databases are up and running.
        • The master node SSH public key is authorized for SSH access to the secondary node. This is needed when SSH password access is disabled, which is the default on Microsoft Azure.
        • diff --git a/src/lib/sap_ha/configuration/hana.rb b/src/lib/sap_ha/configuration/hana.rb index d41b59f..9ace2e2 100644 --- a/src/lib/sap_ha/configuration/hana.rb +++ b/src/lib/sap_ha/configuration/hana.rb @@ -118,6 +118,7 @@ def configured? def validate(verbosity = :verbose) SemanticChecks.instance.check(verbosity) do |check| check.hana_is_installed(@system_id, @global_config.cluster.all_nodes) + check.hana_is_running(@system_id, @instance, @global_config.cluster.all_nodes) check.ipv4(@virtual_ip, "Virtual IP") check.nonneg_integer(@virtual_ip_mask, "Virtual IP mask") check.integer_in_range(@virtual_ip_mask, 1, 32, "CIDR mask has to be between 1 and 32.", diff --git a/src/lib/sap_ha/semantic_checks.rb b/src/lib/sap_ha/semantic_checks.rb index bc8c4fa..43a4ac4 100644 --- a/src/lib/sap_ha/semantic_checks.rb +++ b/src/lib/sap_ha/semantic_checks.rb @@ -282,11 +282,33 @@ def hana_is_installed(value, nodes) end if status != 0 flag = false - message += "No SAP HANA #{value} is installed on #{node}\n" + message += "
          No SAP HANA #{value} is installed on #{node}" end end end - report_error(flag, message, 'SID', value) + report_error(flag, message, '', '') + end + + def hana_is_running(system_id, instance_number, nodes) + flag = true + message = '' + my_ips = SapHA::System::Network.ip_addresses + procname = "hdb.sap#{system_id.upcase}_HDB#{instance_number}" + if @no_test + nodes.each do |node| + log.debug("node #{node} #{my_ips}") + if my_ips.include?(node) + status = exec_status("pidof", procname) + else + status = exec_status("ssh", "-o", "StrictHostKeyChecking=no", node, "pidof", procname) + end + if status != 0 + flag = false + message += "
          No SAP HANA #{system_id} is running on #{node}" + end + end + end + report_error(flag, message, '', '') end # Check if string is a block device @@ -368,11 +390,10 @@ def error_string(field_name, explanation, value = nil) explanation = explanation[0..-2] if explanation.end_with? "." explanation = explanation if field_name.empty? - "Invalid input: #{explanation}" + "Error detected: #{explanation}" elsif value.nil? || (value.is_a?(::String) && value.empty?) "Invalid entry for #{field_name}: #{explanation}." else - "Invalid entry for #{field_name} (\"#{ERB::Util.html_escape(value)}\"): #{explanation}." end end