Skip to content

Commit

Permalink
Check multipath (#1025)
Browse files Browse the repository at this point in the history
## Problem

If installation medium has misconfigured multipath, then it failed with
strange error.


## Solution

Log when misconfiguration is detected.


## Testing

- *Tested manually*
  • Loading branch information
jreidinger committed Feb 1, 2024
2 parents ae5f6da + 1f268e9 commit f3aadda
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions service/lib/agama/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def on_probe(&block)
def probe
start_progress(4)
config.pick_product(software.selected_product)
check_multipath
progress.step(_("Activating storage devices")) { activate_devices }
progress.step(_("Probing storage devices")) { probe_devices }
progress.step(_("Calculating the storage proposal")) { calculate_proposal }
Expand Down Expand Up @@ -283,6 +284,23 @@ def security
def questions_client
@questions_client ||= Agama::DBus::Clients::Questions.new(logger: logger)
end

MULTIPATH_CONFIG = "/etc/multipath.conf"
# Checks if all requirement for multipath probing is correct and if not
# then log it
def check_multipath
# check if kernel module is loaded
mods = `lsmod`.lines.grep(/dm_multipath/)
logger.warn("dm_multipath modules is not loaded") if mods.empty?

conf_file = File.exist?(MULTIPATH_CONFIG)
if conf_file
finder = File.readlines(MULTIPATH_CONFIG).grep(/find_multipaths\s+smart/)
logger.warn("find_multipaths is not set to smart value") if finder.empty?
else
logger.warn("#{MULTIPATH_CONFIG} does not exist")
end
end
end
end
end
5 changes: 5 additions & 0 deletions service/package/rubygem-agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Feb 1 13:08:39 UTC 2024 - Josef Reidinger <jreidinger@suse.com>

- Log if multipath probing is misconfigured (bsc#1215598)

-------------------------------------------------------------------
Mon Jan 29 13:51:30 UTC 2024 - José Iván López González <jlopez@suse.com>

Expand Down

0 comments on commit f3aadda

Please sign in to comment.