Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup workflow is bad bsc#1217596 #37

Merged
merged 41 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1bc2ab3
Bump version to 4.6.0
jreidinger Sep 1, 2023
be5fe64
Avoid build error on not used architectures.
Sep 20, 2023
4fa7df7
Fix package requirement for yast2-cluster
Sep 20, 2023
938db72
yast2-sap-ha does not set global_allocation_limit for non productive …
Oct 27, 2023
8d04938
Use the right system id to configure global.ini for non productive db.
Oct 30, 2023
e7aac79
yast2-sap-ha wizard terminates abruptly when save configuration optio…
Nov 2, 2023
effb245
New version
Nov 2, 2023
3487651
Add textdomain
Nov 8, 2023
687488c
Refresh only the proposal to avoid rewriting the settings in the read…
Nov 9, 2023
96c1dd4
Increase debug
Nov 9, 2023
605863f
Increase debug infos
Nov 9, 2023
5ece3bc
Fix checking global alloc limit. The value is given in string.
Nov 9, 2023
7eba700
Fix text indentation
Nov 9, 2023
1f8d173
Fix bsc#1214603 in the right function
Nov 9, 2023
f0122c3
Complete changes.
Nov 9, 2023
035afc1
Fix parameter for sysconfig write.
Nov 16, 2023
0d2060d
Check if HANA db with given SID is installed.
Nov 16, 2023
6c9b9e4
Do not check if HANA is installed in the test envinroment.
Nov 17, 2023
b905880
Check if the HANA systems with the given SID are installed on the req…
Nov 17, 2023
ad50863
Enhance changes.
Nov 17, 2023
de5ea32
Merge pull request #35 from varkoly/SLE-15-SP4
varkoly Nov 20, 2023
68d9c29
Merge pull request #33 from varkoly/SLE-15-SP5
varkoly Nov 20, 2023
a3f7136
Fix typo
Nov 28, 2023
9eb1921
Merge remote-tracking branch 'upstream/SLE-15-SP4' into SLE-15-SP4
Nov 28, 2023
7215010
Fix version
Nov 28, 2023
ec1a656
Fix version
Nov 28, 2023
d14f99a
Fix version
Nov 28, 2023
4c376a2
Rework the configuration worklflow:
Nov 29, 2023
346e005
New version
Nov 29, 2023
97cb9ab
Use the right class
Nov 29, 2023
8880546
Use or ignore output
Nov 29, 2023
4707761
New function to wait until primary get idle.
Dec 1, 2023
cb318e1
Set ms in maintenance mode
Dec 1, 2023
0f1dcc4
Use the right node. Do not wait infinitively
Dec 1, 2023
c272e1c
Increment
Dec 2, 2023
0acb212
Now wait_idle can handle all nodes.
Dec 7, 2023
bd5cbfc
New helper script to test if hana is running on a node
Dec 7, 2023
a93308a
Fix conflict
Dec 13, 2023
848b21a
Fix conflict
Dec 13, 2023
1a4bacc
Fix conflict
Dec 13, 2023
2e7a53b
Adapt version to master
Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions aux/config.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
-------------------------------------------------------------------
Wed Nov 29 07:52:36 UTC 2023 - Peter Varkoly <[email protected]>

- 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 <[email protected]>

- 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 <[email protected]>

Expand Down
6 changes: 4 additions & 2 deletions package/yast2-sap-ha.spec
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading
Loading