Skip to content

Commit

Permalink
Merge pull request #37 from varkoly/master
Browse files Browse the repository at this point in the history
Setup workflow is bad bsc#1217596
  • Loading branch information
varkoly committed Feb 13, 2024
2 parents fe6437b + 2e7a53b commit be3d95d
Show file tree
Hide file tree
Showing 21 changed files with 200 additions and 192 deletions.
11 changes: 0 additions & 11 deletions aux/config.yml
Expand Up @@ -122,17 +122,6 @@ cluster: !ruby/object:SapHA::Configuration::Cluster
- :@keys
- :@append_hosts
- :@host_passwords
cluster_finalizer: !ruby/object:SapHA::Configuration::ClusterFinalizer
global_config: *5
screen_name: Cluster Configuration Finalizer
exception_type: &6 !ruby/class 'SapHA::Exceptions::BaseConfigException'
yaml_exclude:
- :@nlog
instance_variables:
- :@global_config
- :@screen_name
- :@exception_type
- :@yaml_exclude
fencing: !ruby/object:SapHA::Configuration::Fencing
global_config: *5
screen_name: Fencing Mechanism
Expand Down
11 changes: 0 additions & 11 deletions aux/config_prd.yml
Expand Up @@ -121,17 +121,6 @@ cluster: !ruby/object:SapHA::Configuration::Cluster
- :@enable_csync2
- :@keys
- :@append_hosts
cluster_finalizer: !ruby/object:SapHA::Configuration::ClusterFinalizer
global_config: *5
screen_name: Cluster Configuration Finalizer
exception_type: &6 !ruby/class 'SapHA::Exceptions::BaseConfigException'
yaml_exclude:
- :@nlog
instance_variables:
- :@global_config
- :@screen_name
- :@exception_type
- :@yaml_exclude
fencing: !ruby/object:SapHA::Configuration::Fencing
global_config: *5
screen_name: Fencing Mechanism
Expand Down
11 changes: 0 additions & 11 deletions aux/config_prd_sps03.yml
Expand Up @@ -122,17 +122,6 @@ cluster: !ruby/object:SapHA::Configuration::Cluster
- :@enable_csync2
- :@keys
- :@append_hosts
cluster_finalizer: !ruby/object:SapHA::Configuration::ClusterFinalizer
global_config: *5
screen_name: Cluster Configuration Finalizer
exception_type: &6 !ruby/class 'SapHA::Exceptions::BaseConfigException'
yaml_exclude:
- :@nlog
instance_variables:
- :@global_config
- :@screen_name
- :@exception_type
- :@yaml_exclude
fencing: !ruby/object:SapHA::Configuration::Fencing
global_config: *5
screen_name: Fencing Mechanism
Expand Down
15 changes: 15 additions & 0 deletions aux/is_hana_running.sh
@@ -0,0 +1,15 @@
#!/bin/bash
#

while true
do
if [ "$( /usr/sap/hostctrl/exe/sapcontrol -nr 00 -function GetProcessList | grep hdbindexserver )" ]; then
echo -n "RUN " >> /var/log/hana-state
date >> /var/log/hana-state
else
echo -n "NOT " >> /var/log/hana-state
date >> /var/log/hana-state
fi
sleep 1
done

24 changes: 24 additions & 0 deletions package/yast2-sap-ha.changes
@@ -1,3 +1,27 @@
-------------------------------------------------------------------
Wed Nov 29 07:52:36 UTC 2023 - Peter Varkoly <varkoly@suse.com>

- yast2-sap-ha setup workflow is bad (bsc#1217596)
Reworking the workflow:
1. Setting up SAP HANA System Replication
2. Setting up SAP HANA HA/DR providers
3. Confiugring the base cluster on all nodes
4. Configuring cluster properties and resources with the new function HANA.finalize
The whole class ClusterFinlizer was removed.
- 6.0.0

-------------------------------------------------------------------
Thu Nov 9 08:31:53 UTC 2023 - Peter Varkoly <varkoly@suse.com>

- yast2-sap-ha wizard terminates abruptly when save configuration option
is selected post configuration (bsc#1214603)
- yast2-sap-ha does not set global_allocation_limit for non productive database
(bsc#1216651)
- Take care that the read values from the saved configuration will
not be overridden during initialization of the modules
- Check if the required HANA systems are installed on the nodes.
- 5.0.1

-------------------------------------------------------------------
Mon Aug 7 05:13:47 UTC 2023 - Peter Varkoly <varkoly@suse.com>

Expand Down
6 changes: 4 additions & 2 deletions package/yast2-sap-ha.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-sap-ha
Version: 5.0.0
Version: 6.0.0
Release: 0
BuildArch: noarch
Source0: %{name}-%{version}.tar.bz2
Expand All @@ -32,7 +32,7 @@ Requires: hawk2
Requires: pacemaker
Requires: rubygem(%{rb_default_ruby_abi}:xmlrpc)
Requires: yast2
Requires: yast2-cluster >= 4.3.8
Requires: yast2-cluster >= 4.4.4
Requires: yast2-ruby-bindings
Requires: yast2-ntp-client
# for opening URLs
Expand All @@ -41,7 +41,9 @@ Requires: xdg-utils
Requires: expect
Requires: firewalld
Requires: openssh
%ifarch x86_64 ppc64le
Requires: HANA-Firewall >= 2.0.3
%endif
Requires: util-linux
Requires: SAPHanaSR
Requires: kmod
Expand Down
2 changes: 2 additions & 0 deletions src/clients/sap_ha.rb
Expand Up @@ -312,7 +312,9 @@ def scenario_selection
log.debug "--- called #{self.class}.#{__callee__}:: ret is #{selection.class} ---"
if selection.is_a?(SapHA::HAConfiguration)
@config = selection
log.debug "-- @config #{@config.to_yaml}"
@config.refresh_all_proposals
log.debug "-- @config after refresh #{@config.to_yaml}"
return :next
end
selection
Expand Down
2 changes: 2 additions & 0 deletions src/data/sap_ha/GLOBAL_INI_NON_PROD.erb
@@ -0,0 +1,2 @@
[memorymanager]
global_allocation_limit = <%= @production_constraints[:global_alloc_limit_non] -%>
2 changes: 1 addition & 1 deletion src/data/sap_ha/GLOBAL_INI_SUS_COSTOPT.erb
@@ -1,5 +1,5 @@
[memorymanager]
global_allocation_limit = <%= @production_constraints[:global_alloc_limit] -%>
global_allocation_limit = <%= @production_constraints[:global_alloc_limit_prod] -%>

[system_replication]
preload_column_tables = <%= @production_constraints[:preload_column_tables] -%>
Expand Down
2 changes: 1 addition & 1 deletion src/data/sap_ha/scenarios.yaml
Expand Up @@ -12,8 +12,8 @@
- ntp
- watchdog
- fencing
- cluster
- hana
- cluster
screen_sequence: &id002
- prerequisites
- communication_layer
Expand Down
2 changes: 1 addition & 1 deletion src/data/sap_ha/tmpl_cluster_config.erb
Expand Up @@ -40,7 +40,7 @@ primitive rsc_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> ocf:suse:SAPHana \
meta priority="100"

ms msl_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> rsc_SAPHana_<%= @system_id -%>_HDB<%= @instance -%> \
meta clone-max="2" clone-node-max="1" interleave="true"
meta clone-max="2" clone-node-max="1" interleave="true" maintenance="true"

primitive rsc_ip_<%= @system_id -%>_HDB<%= @instance -%> ocf:heartbeat:IPaddr2 \
op monitor interval="10" timeout="20" \
Expand Down
6 changes: 2 additions & 4 deletions src/lib/sap_ha/configuration.rb
Expand Up @@ -26,7 +26,6 @@
require "sap_ha/helpers"
require "sap_ha/node_logger"
require "sap_ha/configuration/cluster"
require "sap_ha/configuration/cluster_finalizer"
require "sap_ha/configuration/fencing"
require "sap_ha/configuration/watchdog"
require "sap_ha/configuration/hana"
Expand All @@ -53,7 +52,6 @@ class HAConfiguration
:watchdog,
:hana,
:ntp,
:cluster_finalizer,
:imported,
:unattended,
:completed,
Expand All @@ -80,7 +78,6 @@ def initialize(role = :master)
@scenario_summary = nil
@yaml_configuration = load_scenarios
@cluster = Configuration::Cluster.new(self)
@cluster_finalizer = Configuration::ClusterFinalizer.new(self)
@fencing = Configuration::Fencing.new(self)
@watchdog = Configuration::Watchdog.new(self)
@hana = Configuration::HANA.new(self)
Expand All @@ -94,7 +91,7 @@ def initialize(role = :master)
# loading an old configuration to detect new hardware.
def refresh_all_proposals
@watchdog.refresh_proposals
@fencing.read_system
@fencing.refresh_proposals
end

# Product ID setter. Raises an ScenarioNotFoundException if the ID was not found
Expand Down Expand Up @@ -233,6 +230,7 @@ def collect_log

def write_config
log.debug "--- called #{self.class}.#{__callee__} ---"
@timestamp = Time.now
SapHA::Helpers.write_var_file("configuration.yml", dump(false, true), timestamp: @timestamp)
end

Expand Down
22 changes: 13 additions & 9 deletions src/lib/sap_ha/configuration/cluster.rb
Expand Up @@ -247,6 +247,13 @@ def other_nodes
ips
end

# return all IPs of the first ring
def all_nodes
ips = @nodes.map { |_, n| n[:ip_ring1] }
return [] if ips.any?(&:empty?)
ips
end

def set_host_password(ip, password)
node = @nodes.values.find { |v| v[:ip_ring1] == ip }
if node.nil?
Expand Down Expand Up @@ -280,12 +287,12 @@ def other_nodes_ext

def get_primary_on_primary
SapHA::System::Network.ip_addresses.each do |my_ip|
@nodes.each do |_, node|
if node[:ip_ring1] == my_ip
return node[:host_name]
end
end
end
@nodes.each do |_, node|
if node[:ip_ring1] == my_ip
return node[:host_name]
end
end
end
return nil
end

Expand Down Expand Up @@ -374,10 +381,7 @@ def apply(role)
@nlog.log_status(status, "Exported configuration for yast2-cluster",
"Could not export configuration for yast2-cluster")
flag &= status
#Handle firewall
SapHA::System::Local.config_firewall(@fw_config, role)
flag &= SapHA::System::Local.start_cluster_services
flag &= SapHA::System::Local.cluster_maintenance(:on) if role == :master
flag &= SapHA::System::Local.add_stonith_resource if role == :master
flag
end
Expand Down
59 changes: 0 additions & 59 deletions src/lib/sap_ha/configuration/cluster_finalizer.rb

This file was deleted.

14 changes: 8 additions & 6 deletions src/lib/sap_ha/configuration/fencing.rb
Expand Up @@ -28,7 +28,7 @@ module Configuration
# Fencing configuration
class Fencing < BaseConfig
attr_reader :proposals, :sysconfig
attr_accessor :sbd_options, :sbd_delayed_start
attr_accessor :sbd_options, :sbd_delayed_start, :devices
include Yast::UIShortcuts
include Yast::Logger

Expand Down Expand Up @@ -83,7 +83,9 @@ def list_items(key)
end

def table_items
@devices.each_with_index.map { |e, i| Item(Id(i), (i + 1).to_s, e) }
de_items = @devices.each_with_index.map { |e, i| Item(Id(i), (i + 1).to_s, e) }
log.debug "table_items #{@devices}"
return de_items
end

def popup_validator(check, dev_path)
Expand Down Expand Up @@ -144,8 +146,11 @@ def apply(role)
flag
end

private
def refresh_proposals
@proposals = SapHA::System::Local.block_devices
end

private
def handle_sysconfig
handle = ->(sett, default) { (sett.nil? || sett.empty?) ? default : sett }
@devices = handle.call(@sysconfig[:device], "").split(";")
Expand All @@ -154,9 +159,6 @@ def handle_sysconfig
true
end

def refresh_proposals
@proposals = SapHA::System::Local.block_devices
end
end
end
end

0 comments on commit be3d95d

Please sign in to comment.