Upgrade dracut module: Update /usr mounting solution#1202
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported,
See other labels for particular jobs defined in the Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
|
/packit build |
67da1cd to
bc5fd7e
Compare
|
/packit build |
bc5fd7e to
1fd6b1c
Compare
|
@pirat89 I have tried this patch with a VM that uses a separate virtio block device for /usr and it worked fine. I have verified that /usr is mounted, and that Do you happen to have any recollection on the conditions when this patch was not working? |
|
@MichalHe I have reproduced the problem with:
note that for the screenshot I had to re-run it, that's why you see an extra msg about |
|
@pirat89 By default, systemd will mount only into Also, if the device is an LVM's logical volume and the source system is using Otherwise, the upgrade went OK. |
|
Looking at when What we could do in theory is to run systemd-fstab-generator before reboot and try keeping the generated |
|
So, the issue is essentially twofold: To tell dracut to include key LVM binaries, and an udev rule that takes care of triggering these commands. I have tried booting into the initramfs, and the lv for 2) We want to ditch running resulting in the into Now systemd is very strict how mount units should be named, so we need to rename the mount units to reflect the new mount target. For example, for Finally, we copy the contents of And we have an upgrade initramfs that a) autoactivates LVM, b) uses systemd to mount entries from 😁 |
|
@MichalHe, thanks for the great in-depth analysis. Just to understand the issue better - so the problem is if we're trying to access anything else than Is this just a new use case we need to support now (having |
Previously, we activated lvm and all other mountpoints have been mounted later by And that's basically why we started these discussions, as |
|
OK, I see - so dracut/systemd tandem in initrd only cares about |
|
Side note: the reason that we're not using the usual autoactivation in dracut is historical. At first, we didn't have any event-based autoactivation, so dracut needed to come up with its own way (not that ideal, because it contains a kind of a loop, but it didn't matter much since we were interested only in the VG/LV on which the rootfs sit). Then we added native event-based autoactivation to LVM, but only with a helper We could also try what happens if we have MD (or other storage virtualization technology) in the device stack instead of LVM - but I assume it would be very similar situation. |
|
@prajnoha Thanks. Anything that gets the job done is fine by me. I would just note that in case this change is implemented in dracut, we would be introducing code into dracut's codebase (a maintenance cost) that would be used by no one else but us (upgrades). How much work do you think would it be to get this into dracut? Is there a reason why is it a bad idea to bypass dracut's mechanisms? @pirat89 Do you see any issues in case that this would be implemented in dracut w.r.t. to how leapp releases its RHEL builds? It would not be that we require dracut, we would have to require dracut with some minimal version, otherwise we would have to do some weird stuff when we detect the dracut version and use leapp's old mechanism or something. I am also worried a bit about what if we decide, e.g., that we will support SANs. I know a little to nothing about having a SAN attached to the system, so I blindly wonder whether a LVM could be set up on top of a SAN. Would implementing the solution in dracut be flexible enough? Our use case requires us to mount everything in fstab - is there a chance that a LVM activation requires some nontrivial systemd dependencies? Re-reading this message, I get the feeling that I am a proponent of going the "LVM-autoactivation" route. Please, do not be mistaken, I just want to make an informed decision 😁 |
49eaad3 to
4fa7517
Compare
62ab47a to
ef0d891
Compare
|
Summary from current manual testing:
I will do yet a test on Azure due to specific (behaviour) storage there and if that one will pass as well, we can jump to merging. Possibly I will update yet the commit msg in the first commit to drop TBD. Almost there! |
|
error on azure:
|
@pirat89 and I did some debugging, I cannot write the exact details because I don't have access to the machine right now: CauseAs the error say The error however happens because we try to copy the contents of our generated units directory (the temporary dir) to
Therefore besides FixWe need to prefix the units units in the directories about with "sysroot" too. |
785d4ac to
1b4857f
Compare
|
Retesting summary (in-progress) (swap is always included in following tests)
** ✔️ works |
Originally we had implemented our own mount_usr.sh script, which took care about mounting the /usr when it is present on separate partition / mountpoint. It took care also about LVM activation. However, it has been problematic in various cases (e.g. when device needed more time for initialisation - e.g. when connected using FC). Let's use instead existing system solutions, starting the upgrade.target after initrd-fs.target (instead of just basic.target). IOW, let's get as close to the standard booting procedure when speaking about the storage, as possible. Note that the booting is still broken in this commit and needs additional changes made in followup commits. But due to complexity of the solution, keeping this separated. jira: RHEL-3344, RHEL-35446
Add LVM autoactivation mechanism to the upgrade initramfs. The core of the mechanism is based on a special udev rule that is triggered when a new device is detected. The rule then calls two lvm binaries (which are also included into the upgrade initrams) to activate the volume groups and logical volumes.
a629fd0 to
8efa0ad
Compare
8efa0ad to
4e5ba73
Compare
Run systemd-fstab-generator to produce mount units that correspond to the content of source system's fstab. The generated mount units are then modified to mount /target into /sysroot/target, to reflect that the root of the source system is mounted as /sysroot. These mount units are made dependencies of local-fs.target, and, therefore, will be triggered by systemd before the upgrade. Assisted-by: Cursor (Claude Sonnet 4) Jira-ref: RHEL-35446 @pstodulk: Updated the code to cover also other systemd targets that can be covered by systemd-fstab-generator. Also cover the situation when a directory with systemd target (requires, wants) already exists. Tests have been updated. Note that there are still possible issues hidden in the generate mount unit files as we update at this moment just the `Where` clause however we are not touching anything else. (Before, After, RequiresMountsFor, ...). But keeping that for future development and testing. The call for `mount -a` is still present, we expect followup PRs at this point. Co-authored-by: Petr Stodulka <pstodulk@redhat.com>
0ffe8d3 to
fc65536
Compare
|
All tests, passed. Rebase only squashed the fixup commit. Approving, will merge once the tests pass again (there was no change, but we are not in hurry). |
matejmatuska
left a comment
There was a problem hiding this comment.
LGTM, extensively tested on different setups.
## Packaging - Requires leapp-framework 6.2+ (oamg#1438) ## Upgrade handling ### Fixes - Fix detection of encrypted Ceph OSD containers (oamg#1255) - Fix error handling for the LiveMode image file removal after the upgrade (oamg#1487) - Fix handling of LVM and Multipath during the upgrade (oamg#1453, oamg#1460, oamg#1464) - Fix remediation command for making symlinks in root directory relative (oamg#1458) - Handle invalid repository definitions (oamg#1475) - Handle trailing slashes when checking for persistence of required mounts (oamg#1488) - Inhibit the upgrade if pluginpath is configured explicitly in DNF (oamg#1425) - Minor changes in logs and reports (oamg#1431, oamg#1441, oamg#1455, oamg#1472) - Prevent sssdupdate actor from rising errors that could stop the upgrade (oamg#1430) - Propagate /etc/crypttab on systems with encrypted storage during the upgrade (oamg#1432) - Raise proper error message when trying to upgrade from unsupported system version (oamg#1443) - Reset DNF module-streams correctly per each action related to the DNF upgrade transaction (oamg#1486) - Skip empty lines when parsing dumped DNF config (oamg#1446) - Wait for the storage initialisation until filesystems defined in FSTAB are mounted (oamg#1459) - [IPU 8 -> 9] Fix the upgrade for systems with installed kernel-rt (oamg#1479) - [IPU 8 -> 9] Skip check for required baseos & appstream repos when upgrading from CS 9 (oamg#1484) ### Enhancements - Add repositories mapping for Almalinux (oamg#1480) - Added scan and checks for NVMe devices, blocking known problematic setups (oamg#1459) - Detect third party python modules for the target python version (oamg#1400) - Handle the upgrade on systems with NVMe-FC storage (oamg#1459, oamg#1493) - Improve error message when scanning invalid SSHD configuration (oamg#1468) - Inhibit the upgrade when converting system to a different linux distribution with enabled secure boot (oamg#1466) - Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade (oamg#1438) - Introduce new IPU paths 8.10 -> 9.8 and 9.8 -> 10.2 (oamg#1436, oamg#1489) - Introduce the `--target-version` alias option, equivalent to `--target` (oamg#1438) - LiveMode: Do not install by default RPMs in initramfs that are not essential for the upgrade (oamg#1476) - LiveMode: Drop inhibitor for use of livemode on non-intel architectures (oamg#1476) - Log applications of PRESENCE and DEPRECATION PES events (oamg#1467) - Migrate the UEFI configuration when converting to RHEL (oamg#1466, oamg#1490) - Modernize the storage initialization when booting to the upgrade environment (oamg#1202, oamg#1439, oamg#1444, oamg#1457) - Remove RPM GPG keys of the source distribution when converting system (oamg#1448) - Remove obsoleted IPU paths (oamg#1491) - Replace distro specific packages during conversion (oamg#1454) - Respect repomapping on CentOS-like distributions (oamg#1423) - Respect repomapping when converting the system to different Linux distribution (oamg#1438) - Update the leapp data files (oamg#1428, oamg#1449, oamg#1451, oamg#1471, oamg#1480) - [IPU 8 -> 9] Cover JBoss EAP repositories for the upgrade (oamg#1428) - [IPU 8 -> 9] Enable php:8.2 module stream if enabled on the source system (oamg#1486) - [IPU 9 -> 10] Check installed Xorg RPMs for removed content (oamg#1478) - [IPU 9 -> 10] Check kerberos configuration (oamg#1340) - [IPU 9 -> 10] Detect installed Motif packages when upgrading to RHEL 10 (oamg#1474) - [IPU 9 -> 10] Handle correctly live kernel patching during IPU (oamg#1435) - [IPU 9 -> 10] Setup net.naming-scheme to handle NIC names correctly when upgrading to RHEL 10.2+ (not applied for Centos 10 yet) (oamg#1492) ## Additional changes interesting for devels - Add tutorial for using snactor to run actors in system upgrade repos (oamg#1368) - Code cleanup - dropping plenty of RHEL 7 related code a removing some legacy functionality (oamg#1427) - Contribution guidelines in upstream docs have been updated (oamg#1456) - CurrentActorMocked: Update defaults, aligning them with IPU 8 -> 9 (oamg#1426) - Functions inside `grub`, `efi`, and `partitions` libraries raise new exceptions on errors instead of `StopActorExecution` and `StopActorExecutionError` to uncover silent issues - leaving the handling of problems on callers. (oamg#1466) - Introduced new envar LEAPP_DEVEL_TARGET_OS to specify any target distribution for the conversion (oamg#1438, oamg#1447) - Introduced new functions in the shared `distro` library to get distribution related repoids (oamg#1423) - New deprecations introduced: - The `leapp.libraries.common.config.get_distro_id` function has been deprecated in favor of `get_source_distro_id` and `get_target_distro_id` from the same library. (oamg#1438) - Numerous functions in the shared `grub` library have been split into new libraries: `efi` and `partitions`. Some functions have also been renamed. Original functions have been deprecated. Read the upstream documentation for full details: https://leapp-repository.readthedocs.io/latest/libraries-and-api/deprecations-list.html (oamg#1466) - Partially fixed possibility to run unit tests for single actor in containers (oamg#1403) - The code has been updated to meet newly enabled pylint rules (oamg#1421) - Update and cleanup test containers (oamg#1424)
- Fix detection of encrypted Ceph OSD containers (oamg#1255) - Fix error handling for the LiveMode image file removal after the upgrade (oamg#1487) - Fix handling of LVM and Multipath during the upgrade (oamg#1453, oamg#1460, oamg#1464) - Fix remediation command for making symlinks in root directory relative (oamg#1458) - Handle invalid repository definitions (oamg#1475) - Handle trailing slashes when checking for persistence of required mounts (oamg#1488) - Inhibit the upgrade if pluginpath is configured explicitly in DNF (oamg#1425) - Minor changes in logs and reports (oamg#1431, oamg#1441, oamg#1455, oamg#1472) - Prevent sssdupdate actor from rising errors that could stop the upgrade (oamg#1430) - Propagate /etc/crypttab on systems with encrypted storage during the upgrade (oamg#1432) - Raise proper error message when trying to upgrade from unsupported system version (oamg#1443) - Reset DNF module-streams correctly per each action related to the DNF upgrade transaction (oamg#1486) - Skip empty lines when parsing dumped DNF config (oamg#1446) - Wait for the storage initialisation until filesystems defined in FSTAB are mounted (oamg#1459) - [IPU 8 -> 9] Fix the upgrade for systems with installed kernel-rt (oamg#1479) - [IPU 8 -> 9] Skip check for required baseos & appstream repos when upgrading from CS 9 (oamg#1484) - Add repositories mapping for Almalinux (oamg#1480) - Added scan and checks for NVMe devices, blocking known problematic setups (oamg#1459) - Detect third party python modules for the target python version (oamg#1400) - Handle the upgrade on systems with NVMe-FC storage (oamg#1459, oamg#1493) - Improve error message when scanning invalid SSHD configuration (oamg#1468) - Inhibit the upgrade when converting system to a different linux distribution with enabled secure boot (oamg#1466) - Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade (oamg#1438) - Introduce new IPU paths 8.10 -> 9.8 and 9.8 -> 10.2 (oamg#1436, oamg#1489) - Introduce the `--target-version` alias option, equivalent to `--target` (oamg#1438) - LiveMode: Do not install by default RPMs in initramfs that are not essential for the upgrade (oamg#1476) - LiveMode: Drop inhibitor for use of livemode on non-intel architectures (oamg#1476) - Log applications of PRESENCE and DEPRECATION PES events (oamg#1467) - Migrate the UEFI configuration when converting to RHEL (oamg#1466, oamg#1490) - Modernize the storage initialization when booting to the upgrade environment (oamg#1202, oamg#1439, oamg#1444, oamg#1457) - Remove RPM GPG keys of the source distribution when converting system (oamg#1448) - Remove obsoleted IPU paths (oamg#1491) - Replace distro specific packages during conversion (oamg#1454) - Respect repomapping on CentOS-like distributions (oamg#1423) - Respect repomapping when converting the system to different Linux distribution (oamg#1438) - Update the leapp data files (oamg#1428, oamg#1449, oamg#1451, oamg#1471, oamg#1480) - [IPU 8 -> 9] Cover JBoss EAP repositories for the upgrade (oamg#1428) - [IPU 8 -> 9] Enable php:8.2 module stream if enabled on the source system (oamg#1486) - [IPU 9 -> 10] Check installed Xorg RPMs for removed content (oamg#1478) - [IPU 9 -> 10] Check kerberos configuration (oamg#1340) - [IPU 9 -> 10] Detect installed Motif packages when upgrading to RHEL 10 (oamg#1474) - [IPU 9 -> 10] Handle correctly live kernel patching during IPU (oamg#1435) - [IPU 9 -> 10] Setup net.naming-scheme to handle NIC names correctly when upgrading to RHEL 10.2+ (not applied for Centos 10 yet) (oamg#1492) - Add tutorial for using snactor to run actors in system upgrade repos (oamg#1368) - Code cleanup - dropping plenty of RHEL 7 related code a removing some legacy functionality (oamg#1427) - Contribution guidelines in upstream docs have been updated (oamg#1456) - CurrentActorMocked: Update defaults, aligning them with IPU 8 -> 9 (oamg#1426) - Functions inside `grub`, `efi`, and `partitions` libraries raise new exceptions on errors instead of `StopActorExecution` and `StopActorExecutionError` to uncover silent issues - leaving the handling of problems on callers. (oamg#1466) - Introduced new envar LEAPP_DEVEL_TARGET_OS to specify any target distribution for the conversion (oamg#1438, oamg#1447) - Introduced new functions in the shared `distro` library to get distribution related repoids (oamg#1423) - New deprecations introduced: - The `leapp.libraries.common.config.get_distro_id` function has been deprecated in favor of `get_source_distro_id` and `get_target_distro_id` from the same library. (oamg#1438) - Numerous functions in the shared `grub` library have been split into new libraries: `efi` and `partitions`. Some functions have also been renamed. Original functions have been deprecated. Read the upstream documentation for full details: https://leapp-repository.readthedocs.io/latest/libraries-and-api/deprecations-list.html (oamg#1466) - Partially fixed possibility to run unit tests for single actor in containers (oamg#1403) - The code has been updated to meet newly enabled pylint rules (oamg#1421) - Update and cleanup test containers (oamg#1424)
## Packaging - Requires leapp-framework 6.2+ (oamg#1438) ## Upgrade handling ### Fixes - Fix detection of encrypted Ceph OSD containers (oamg#1255) - Fix error handling for the LiveMode image file removal after the upgrade (oamg#1487) - Fix handling of LVM and Multipath during the upgrade (oamg#1453, oamg#1460, oamg#1464) - Fix remediation command for making symlinks in root directory relative (oamg#1458) - Handle invalid repository definitions (oamg#1475) - Handle trailing slashes when checking for persistence of required mounts (oamg#1488) - Inhibit the upgrade if pluginpath is configured explicitly in DNF (oamg#1425) - Minor changes in logs and reports (oamg#1431, oamg#1441, oamg#1455, oamg#1472) - Prevent sssdupdate actor from rising errors that could stop the upgrade (oamg#1430) - Propagate /etc/crypttab on systems with encrypted storage during the upgrade (oamg#1432) - Raise proper error message when trying to upgrade from unsupported system version (oamg#1443) - Reset DNF module-streams correctly per each action related to the DNF upgrade transaction (oamg#1486) - Skip empty lines when parsing dumped DNF config (oamg#1446) - Wait for the storage initialisation until filesystems defined in FSTAB are mounted (oamg#1459) - [IPU 8 -> 9] Fix the upgrade for systems with installed kernel-rt (oamg#1479) - [IPU 8 -> 9] Skip check for required baseos & appstream repos when upgrading from CS 9 (oamg#1484) ### Enhancements - Add repositories mapping for Almalinux (oamg#1480) - Added scan and checks for NVMe devices, blocking known problematic setups (oamg#1459) - Detect third party python modules for the target python version (oamg#1400) - Handle the upgrade on systems with NVMe-FC storage (oamg#1459, oamg#1493) - Improve error message when scanning invalid SSHD configuration (oamg#1468) - Inhibit the upgrade when converting system to a different linux distribution with enabled secure boot (oamg#1466) - Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade (oamg#1438) - Introduce new IPU paths 8.10 -> 9.8 and 9.8 -> 10.2 (oamg#1436, oamg#1489) - Introduce the `--target-version` alias option, equivalent to `--target` (oamg#1438) - LiveMode: Do not install by default RPMs in initramfs that are not essential for the upgrade (oamg#1476) - LiveMode: Drop inhibitor for use of livemode on non-intel architectures (oamg#1476) - Log applications of PRESENCE and DEPRECATION PES events (oamg#1467) - Migrate the UEFI configuration when converting to RHEL (oamg#1466, oamg#1490) - Modernize the storage initialization when booting to the upgrade environment (oamg#1202, oamg#1439, oamg#1444, oamg#1457) - Remove RPM GPG keys of the source distribution when converting system (oamg#1448) - Remove obsoleted IPU paths (oamg#1491) - Replace distro specific packages during conversion (oamg#1454) - Respect repomapping on CentOS-like distributions (oamg#1423) - Respect repomapping when converting the system to different Linux distribution (oamg#1438) - Update the leapp data files (oamg#1428, oamg#1449, oamg#1451, oamg#1471, oamg#1480) - [IPU 8 -> 9] Cover JBoss EAP repositories for the upgrade (oamg#1428) - [IPU 8 -> 9] Enable php:8.2 module stream if enabled on the source system (oamg#1486) - [IPU 9 -> 10] Check installed Xorg RPMs for removed content (oamg#1478) - [IPU 9 -> 10] Check kerberos configuration (oamg#1340) - [IPU 9 -> 10] Detect installed Motif packages when upgrading to RHEL 10 (oamg#1474) - [IPU 9 -> 10] Handle correctly live kernel patching during IPU (oamg#1435) - [IPU 9 -> 10] Setup net.naming-scheme to handle NIC names correctly when upgrading to RHEL 10.2+ (not applied for Centos 10 yet) (oamg#1492) ## Additional changes interesting for devels - Add tutorial for using snactor to run actors in system upgrade repos (oamg#1368) - Code cleanup - dropping plenty of RHEL 7 related code a removing some legacy functionality (oamg#1427) - Contribution guidelines in upstream docs have been updated (oamg#1456) - CurrentActorMocked: Update defaults, aligning them with IPU 8 -> 9 (oamg#1426) - Functions inside `grub`, `efi`, and `partitions` libraries raise new exceptions on errors instead of `StopActorExecution` and `StopActorExecutionError` to uncover silent issues - leaving the handling of problems on callers. (oamg#1466) - Introduced new envar LEAPP_DEVEL_TARGET_OS to specify any target distribution for the conversion (oamg#1438, oamg#1447) - Introduced new functions in the shared `distro` library to get distribution related repoids (oamg#1423) - New deprecations introduced: - The `leapp.libraries.common.config.get_distro_id` function has been deprecated in favor of `get_source_distro_id` and `get_target_distro_id` from the same library. (oamg#1438) - The `RHELTargetRepository` model has been deprecated, replaced by `DistroTargetRepository` (oamg#1423) - Numerous functions in the shared `grub` library have been split into new libraries: `efi` and `partitions`. Some functions have also been renamed. Original functions have been deprecated. Read the upstream documentation for full details: https://leapp-repository.readthedocs.io/latest/libraries-and-api/deprecations-list.html (oamg#1466) - Partially fixed possibility to run unit tests for single actor in containers (oamg#1403) - The code has been updated to meet newly enabled pylint rules (oamg#1421) - Update and cleanup test containers (oamg#1424)
## Packaging - Requires leapp-framework 6.2+ (oamg#1438) ## Upgrade handling ### Fixes - Fix detection of encrypted Ceph OSD containers (oamg#1255) - Fix error handling for the LiveMode image file removal after the upgrade (oamg#1487) - Fix handling of LVM and Multipath during the upgrade (oamg#1453, oamg#1460, oamg#1464) - Fix remediation command for making symlinks in root directory relative (oamg#1458) - Handle invalid repository definitions (oamg#1475) - Handle trailing slashes when checking for persistence of required mounts (oamg#1488) - Inhibit the upgrade if pluginpath is configured explicitly in DNF (oamg#1425) - Minor changes in logs and reports (oamg#1431, oamg#1441, oamg#1455, oamg#1472) - Prevent sssdupdate actor from rising errors that could stop the upgrade (oamg#1430) - Propagate /etc/crypttab on systems with encrypted storage during the upgrade (oamg#1432) - Raise proper error message when trying to upgrade from unsupported system version (oamg#1443) - Reset DNF module-streams correctly per each action related to the DNF upgrade transaction (oamg#1486) - Skip empty lines when parsing dumped DNF config (oamg#1446) - Wait for the storage initialisation until filesystems defined in FSTAB are mounted (oamg#1459) - [IPU 8 -> 9] Fix the upgrade for systems with installed kernel-rt (oamg#1479) - [IPU 8 -> 9] Skip check for required baseos & appstream repos when upgrading from CS 9 (oamg#1484) ### Enhancements - Add repositories mapping for Almalinux (oamg#1480) - Added scan and checks for NVMe devices, blocking known problematic setups (oamg#1459) - Detect third party python modules for the target python version (oamg#1400) - Handle the upgrade on systems with NVMe-FC storage (oamg#1459, oamg#1493) - Improve error message when scanning invalid SSHD configuration (oamg#1468) - Inhibit the upgrade when converting system to a different linux distribution with enabled secure boot (oamg#1466) - Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade (oamg#1438) - Introduce new IPU paths 8.10 -> 9.8 and 9.8 -> 10.2 (oamg#1436, oamg#1489) - Introduce the `--target-version` alias option, equivalent to `--target` (oamg#1438) - LiveMode: Do not install by default RPMs in initramfs that are not essential for the upgrade (oamg#1476) - LiveMode: Drop inhibitor for use of livemode on non-intel architectures (oamg#1476) - Log applications of PRESENCE and DEPRECATION PES events (oamg#1467) - Migrate the UEFI configuration when converting to RHEL (oamg#1466, oamg#1490) - Modernize the storage initialization when booting to the upgrade environment (oamg#1202, oamg#1439, oamg#1444, oamg#1457) - Remove RPM GPG keys of the source distribution when converting system (oamg#1448) - Remove obsoleted IPU paths (oamg#1491) - Replace distro specific packages during conversion (oamg#1454) - Respect repomapping on CentOS-like distributions (oamg#1423) - Respect repomapping when converting the system to different Linux distribution (oamg#1438) - Update the leapp data files (oamg#1428, oamg#1449, oamg#1451, oamg#1471, oamg#1480) - [IPU 8 -> 9] Cover JBoss EAP repositories for the upgrade (oamg#1428) - [IPU 8 -> 9] Enable php:8.2 module stream if enabled on the source system (oamg#1486) - [IPU 9 -> 10] Check installed Xorg RPMs for removed content (oamg#1478) - [IPU 9 -> 10] Check kerberos configuration (oamg#1340) - [IPU 9 -> 10] Detect installed Motif packages when upgrading to RHEL 10 (oamg#1474) - [IPU 9 -> 10] Handle correctly live kernel patching during IPU (oamg#1435) - [IPU 9 -> 10] Setup net.naming-scheme to handle NIC names correctly when upgrading to RHEL 10.2+ (not applied for Centos 10 yet) (oamg#1492) ## Additional changes interesting for devels - Add tutorial for using snactor to run actors in system upgrade repos (oamg#1368) - Code cleanup - dropping plenty of RHEL 7 related code a removing some legacy functionality (oamg#1427) - Contribution guidelines in upstream docs have been updated (oamg#1456) - CurrentActorMocked: Update defaults, aligning them with IPU 8 -> 9 (oamg#1426) - Functions inside `grub`, `efi`, and `partitions` libraries raise new exceptions on errors instead of `StopActorExecution` and `StopActorExecutionError` to uncover silent issues - leaving the handling of problems on callers. (oamg#1466) - Introduced new envar LEAPP_DEVEL_TARGET_OS to specify any target distribution for the conversion (oamg#1438, oamg#1447) - Introduced new functions in the shared `distro` library to get distribution related repoids (oamg#1423) - New deprecations introduced: - The `leapp.libraries.common.config.get_distro_id` function has been deprecated in favor of `get_source_distro_id` and `get_target_distro_id` from the same library. (oamg#1438) - The `RHELTargetRepository` model has been deprecated, replaced by `DistroTargetRepository` (oamg#1423) - Numerous functions in the shared `grub` library have been split into new libraries: `efi` and `partitions`. Some functions have also been renamed. Original functions have been deprecated. Read the upstream documentation for full details: https://leapp-repository.readthedocs.io/latest/libraries-and-api/deprecations-list.html (oamg#1466) - Partially fixed possibility to run unit tests for single actor in containers (oamg#1403) - The code has been updated to meet newly enabled pylint rules (oamg#1421) - Update and cleanup test containers (oamg#1424)
## Packaging - Requires leapp-framework 6.2+ (#1438) ## Upgrade handling ### Fixes - Fix detection of encrypted Ceph OSD containers (#1255) - Fix error handling for the LiveMode image file removal after the upgrade (#1487) - Fix handling of LVM and Multipath during the upgrade (#1453, #1460, #1464) - Fix remediation command for making symlinks in root directory relative (#1458) - Handle invalid repository definitions (#1475) - Handle trailing slashes when checking for persistence of required mounts (#1488) - Inhibit the upgrade if pluginpath is configured explicitly in DNF (#1425) - Minor changes in logs and reports (#1431, #1441, #1455, #1472) - Prevent sssdupdate actor from rising errors that could stop the upgrade (#1430) - Propagate /etc/crypttab on systems with encrypted storage during the upgrade (#1432) - Raise proper error message when trying to upgrade from unsupported system version (#1443) - Reset DNF module-streams correctly per each action related to the DNF upgrade transaction (#1486) - Skip empty lines when parsing dumped DNF config (#1446) - Wait for the storage initialisation until filesystems defined in FSTAB are mounted (#1459) - [IPU 8 -> 9] Fix the upgrade for systems with installed kernel-rt (#1479) - [IPU 8 -> 9] Skip check for required baseos & appstream repos when upgrading from CS 9 (#1484) ### Enhancements - Add repositories mapping for Almalinux (#1480) - Added scan and checks for NVMe devices, blocking known problematic setups (#1459) - Detect third party python modules for the target python version (#1400) - Handle the upgrade on systems with NVMe-FC storage (#1459, #1493) - Improve error message when scanning invalid SSHD configuration (#1468) - Inhibit the upgrade when converting system to a different linux distribution with enabled secure boot (#1466) - Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade (#1438) - Introduce new IPU paths 8.10 -> 9.8 and 9.8 -> 10.2 (#1436, #1489) - Introduce the `--target-version` alias option, equivalent to `--target` (#1438) - LiveMode: Do not install by default RPMs in initramfs that are not essential for the upgrade (#1476) - LiveMode: Drop inhibitor for use of livemode on non-intel architectures (#1476) - Log applications of PRESENCE and DEPRECATION PES events (#1467) - Migrate the UEFI configuration when converting to RHEL (#1466, #1490) - Modernize the storage initialization when booting to the upgrade environment (#1202, #1439, #1444, #1457) - Remove RPM GPG keys of the source distribution when converting system (#1448) - Remove obsoleted IPU paths (#1491) - Replace distro specific packages during conversion (#1454) - Respect repomapping on CentOS-like distributions (#1423) - Respect repomapping when converting the system to different Linux distribution (#1438) - Update the leapp data files (#1428, #1449, #1451, #1471, #1480) - [IPU 8 -> 9] Cover JBoss EAP repositories for the upgrade (#1428) - [IPU 8 -> 9] Enable php:8.2 module stream if enabled on the source system (#1486) - [IPU 9 -> 10] Check installed Xorg RPMs for removed content (#1478) - [IPU 9 -> 10] Check kerberos configuration (#1340) - [IPU 9 -> 10] Detect installed Motif packages when upgrading to RHEL 10 (#1474) - [IPU 9 -> 10] Handle correctly live kernel patching during IPU (#1435) - [IPU 9 -> 10] Setup net.naming-scheme to handle NIC names correctly when upgrading to RHEL 10.2+ (not applied for Centos 10 yet) (#1492) ## Additional changes interesting for devels - Add tutorial for using snactor to run actors in system upgrade repos (#1368) - Code cleanup - dropping plenty of RHEL 7 related code a removing some legacy functionality (#1427) - Contribution guidelines in upstream docs have been updated (#1456) - CurrentActorMocked: Update defaults, aligning them with IPU 8 -> 9 (#1426) - Functions inside `grub`, `efi`, and `partitions` libraries raise new exceptions on errors instead of `StopActorExecution` and `StopActorExecutionError` to uncover silent issues - leaving the handling of problems on callers. (#1466) - Introduced new envar LEAPP_DEVEL_TARGET_OS to specify any target distribution for the conversion (#1438, #1447) - Introduced new functions in the shared `distro` library to get distribution related repoids (#1423) - New deprecations introduced: - The `leapp.libraries.common.config.get_distro_id` function has been deprecated in favor of `get_source_distro_id` and `get_target_distro_id` from the same library. (#1438) - The `RHELTargetRepository` model has been deprecated, replaced by `DistroTargetRepository` (#1423) - Numerous functions in the shared `grub` library have been split into new libraries: `efi` and `partitions`. Some functions have also been renamed. Original functions have been deprecated. Read the upstream documentation for full details: https://leapp-repository.readthedocs.io/latest/libraries-and-api/deprecations-list.html (#1466) - Partially fixed possibility to run unit tests for single actor in containers (#1403) - The code has been updated to meet newly enabled pylint rules (#1421) - Update and cleanup test containers (#1424)
## Packaging - Requires leapp-framework 6.2+ (oamg#1438) ## Upgrade handling ### Fixes - Fix detection of encrypted Ceph OSD containers (oamg#1255) - Fix error handling for the LiveMode image file removal after the upgrade (oamg#1487) - Fix handling of LVM and Multipath during the upgrade (oamg#1453, oamg#1460, oamg#1464) - Fix remediation command for making symlinks in root directory relative (oamg#1458) - Handle invalid repository definitions (oamg#1475) - Handle trailing slashes when checking for persistence of required mounts (oamg#1488) - Inhibit the upgrade if pluginpath is configured explicitly in DNF (oamg#1425) - Minor changes in logs and reports (oamg#1431, oamg#1441, oamg#1455, oamg#1472) - Prevent sssdupdate actor from rising errors that could stop the upgrade (oamg#1430) - Propagate /etc/crypttab on systems with encrypted storage during the upgrade (oamg#1432) - Raise proper error message when trying to upgrade from unsupported system version (oamg#1443) - Reset DNF module-streams correctly per each action related to the DNF upgrade transaction (oamg#1486) - Skip empty lines when parsing dumped DNF config (oamg#1446) - Wait for the storage initialisation until filesystems defined in FSTAB are mounted (oamg#1459) - [IPU 8 -> 9] Fix the upgrade for systems with installed kernel-rt (oamg#1479) - [IPU 8 -> 9] Skip check for required baseos & appstream repos when upgrading from CS 9 (oamg#1484) ### Enhancements - Add repositories mapping for Almalinux (oamg#1480) - Added scan and checks for NVMe devices, blocking known problematic setups (oamg#1459) - Detect third party python modules for the target python version (oamg#1400) - Handle the upgrade on systems with NVMe-FC storage (oamg#1459, oamg#1493) - Improve error message when scanning invalid SSHD configuration (oamg#1468) - Inhibit the upgrade when converting system to a different linux distribution with enabled secure boot (oamg#1466) - Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade (oamg#1438) - Introduce new IPU paths 8.10 -> 9.8 and 9.8 -> 10.2 (oamg#1436, oamg#1489) - Introduce the `--target-version` alias option, equivalent to `--target` (oamg#1438) - LiveMode: Do not install by default RPMs in initramfs that are not essential for the upgrade (oamg#1476) - LiveMode: Drop inhibitor for use of livemode on non-intel architectures (oamg#1476) - Log applications of PRESENCE and DEPRECATION PES events (oamg#1467) - Migrate the UEFI configuration when converting to RHEL (oamg#1466, oamg#1490) - Modernize the storage initialization when booting to the upgrade environment (oamg#1202, oamg#1439, oamg#1444, oamg#1457) - Remove RPM GPG keys of the source distribution when converting system (oamg#1448) - Remove obsoleted IPU paths (oamg#1491) - Replace distro specific packages during conversion (oamg#1454) - Respect repomapping on CentOS-like distributions (oamg#1423) - Respect repomapping when converting the system to different Linux distribution (oamg#1438) - Update the leapp data files (oamg#1428, oamg#1449, oamg#1451, oamg#1471, oamg#1480) - [IPU 8 -> 9] Cover JBoss EAP repositories for the upgrade (oamg#1428) - [IPU 8 -> 9] Enable php:8.2 module stream if enabled on the source system (oamg#1486) - [IPU 9 -> 10] Check installed Xorg RPMs for removed content (oamg#1478) - [IPU 9 -> 10] Check kerberos configuration (oamg#1340) - [IPU 9 -> 10] Detect installed Motif packages when upgrading to RHEL 10 (oamg#1474) - [IPU 9 -> 10] Handle correctly live kernel patching during IPU (oamg#1435) - [IPU 9 -> 10] Setup net.naming-scheme to handle NIC names correctly when upgrading to RHEL 10.2+ (not applied for Centos 10 yet) (oamg#1492) ## Additional changes interesting for devels - Add tutorial for using snactor to run actors in system upgrade repos (oamg#1368) - Code cleanup - dropping plenty of RHEL 7 related code a removing some legacy functionality (oamg#1427) - Contribution guidelines in upstream docs have been updated (oamg#1456) - CurrentActorMocked: Update defaults, aligning them with IPU 8 -> 9 (oamg#1426) - Functions inside `grub`, `efi`, and `partitions` libraries raise new exceptions on errors instead of `StopActorExecution` and `StopActorExecutionError` to uncover silent issues - leaving the handling of problems on callers. (oamg#1466) - Introduced new envar LEAPP_DEVEL_TARGET_OS to specify any target distribution for the conversion (oamg#1438, oamg#1447) - Introduced new functions in the shared `distro` library to get distribution related repoids (oamg#1423) - New deprecations introduced: - The `leapp.libraries.common.config.get_distro_id` function has been deprecated in favor of `get_source_distro_id` and `get_target_distro_id` from the same library. (oamg#1438) - The `RHELTargetRepository` model has been deprecated, replaced by `DistroTargetRepository` (oamg#1423) - Numerous functions in the shared `grub` library have been split into new libraries: `efi` and `partitions`. Some functions have also been renamed. Original functions have been deprecated. Read the upstream documentation for full details: https://leapp-repository.readthedocs.io/latest/libraries-and-api/deprecations-list.html (oamg#1466) - Partially fixed possibility to run unit tests for single actor in containers (oamg#1403) - The code has been updated to meet newly enabled pylint rules (oamg#1421) - Update and cleanup test containers (oamg#1424) (cherry picked from commit 362613c)

Originally we had implemented our own mount_usr.sh script, which took care about mounting the /usr when it is present on separate partition / mountpoint. It took care also about LVM activation.
However, it has been problematic in various cases (e.g. when device needed more time for initialisation - e.g. when connected using FC). Let's use instead existing system solutions, starting the upgrade.target after initrd-fs.target (instead of just basic.target).
Jira-ref: RHEL-3344, RHEL-35446
Cooperating with: prajnoha, lnykryn, pvalena.
do_not_merge: just exprimenting right now. if we find working solution, I will update yet commit msg at minimum.
Technical description of the solution
1. LVM Autoactivation
The device that is mounted at /usr might be an LVM partition, so the proposed solution needs to handle LVM activation (the old implementation already did so). To this end, we include the
69-dm-lvm.rulesudev rule into the upgrade initramfs. These rules autoactivate LVM volumes when a device is discovered by the kernel and the udev daemon is notified about them. This mechanism is borrowed from a standard boot process. For more details see lvmautoactivation (7).2. Mounting the filesystem according to /etc/fstab
The goal is to use a mounting mechanism that is as close as possible to an ordinary boot process of a RHEL system. Inside the initramfs, the boot process looks as follows (taken from bootup):
One of the most important parts is
initrd-parse-etc, which callssystemd-fstab-generatorto parse/etc/fstaband generate mount units that mount the filesystem tree as described by/etc/fstabwhen possible (device is available, mount target exists, etc.). However, triggering the service in initramfs will not help us, since the/etc/fstabin initramfs is different than the one used on the source system. Moreover, we a slightly different behavior than the one described by source system's fstab: instead of mounting deviceXat/usr, we want to mount it at/sysroot/usr.The solution proposed by this PR is to manually run
systemd-fstab-generatorto generate corresponding mount units before reboot. These units are modified according to our needs (/usr->/sysroot/usr), and, then we include them in our upgrade initramfs. These mount units are then mounted, since they are marked as a dependency oflocal-fs.target.Notes for reviewers
Modify the created upgrade boot entry by running the following command.
After rebooting, you will be dropped into a shell that allows you to check the state of the system before proceeding with the upgrade. Check that everything is mounted as expected under
/sysroot, and that the created mount units are active without any problems:Additional notes
initrd-parse-etc.service, but the inside the unit file:initrd-cleanupservice includes also switch-root, which we do not want to happen at all and due to isolation it basically kills out upgrade process.Update: