Partitioner: skip MD chunk size when not applicable (bsc#1205172) #1331
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses two separate problems related to MD RAIDs.
Problem 1
The switch from libstorage to libstorage-ng introduced changes in the identifiers used internally to represent types of Raid parity (eg.
parity_first
becamefirst
,o2
became offset_2`, etc.).That change reached AutoYaST. So the possible values of the property
<parity_algorithm>
in the AutoYaST profile are slightly different between SLE-12 and SLE-15 (storage-ng). That was only detected recently while checking the source code. It has not been reported by any affected user.Solution to problem 1
Implement backwards compatibility with SLE-12 profiles by recognizing legacy values for
<parity_algorithm>
(eg.parity_first
oro2
).I also created the corresponding pull request for the official AutoYaST documentation, so the new identifiers are used there (with a mention to the legacy ones): SUSE/doc-sle#1485
Testing of solution to problem 1
Added new unit tests to ensure both old and new representations of the parity are correctly processed by AutoYaST.
Previously existing tests already proved that exporting (cloning) uses the new values.
Problem 2
The Chunk Size options makes no sense for RAID1 devices. Still, YaST historically presents this dialog as second step in the process of creating such a device.
Previous versions of
mdadm
just ignored the corresponding--chunk=
argument when specified during the creation of a RAID1 device. So the information managed by YaST during the whole Partitioner execution was simply pointless.Starting with
mdadm
version 4.2 (which is included in both openSUSE Tumbleweed and SLE-15-SP5), the--chunk=
argument is not ignored anymore if used together with--level=1
. Instead, it now throws an error.Solution for problem 2
Don't display the dialog and don't set the internal value of
Y2Storage:::Md.chunk_size
for RAID1 devices. With that, YaST will make no assumptions about that pointless attribute and will not try to set its value in the corresponding libstorage-ng call tomdadm
.Testing solution for problem 2
Manually tested. The dialog is indeed skipped and using the option "Device -> Show Details" displays no value for new RAID1 devices.
More references
https://trello.com/c/jTPYqFTU/3209-2-ostumbleweed-p2-1205172-staging-mdadm-42-fails-installation-on-raid1-with-yast