-
Notifications
You must be signed in to change notification settings - Fork 150
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
Resolve boot issues in hybrid azure images during upgrades from RHEL 7 > 8 > 9. #1284
base: main
Are you sure you want to change the base?
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.
Note that first time contributors cannot run tests automatically - they need to be started by a reviewer. 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. |
This commit addresses the issue where the `/boot/grub2/grub.cfg` file is overwritten during the upgrade process by an old RHEL7 configuration leftover on the system, causing the system to fail to boot. The problem occurs on hybrid Azure images, which support both UEFI and Legacy systems and have both `grub-pc` and `grub-efi` packages installed. It is caused by one of the scriplets in `grub-efi` which overwrites the old configuration. If old configuration is detected, this actor regenerates the grub configuration using `grub2-mkconfig -o /boot/grub2/grub.cfg` after installing rpms to ensure the correct boot configuration is in place. The fix is applied specifically to Azure hybrid cloud systems. JIRA: RHEL-38255
390e3e4
to
cc3fa6f
Compare
0e3bf53
to
838a95a
Compare
repos/system_upgrade/common/actors/cloud/checkhybridimage/actor.py
Outdated
Show resolved
Hide resolved
14a0302
to
807c270
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cool to me, just minor details that require changing.
repos/system_upgrade/common/actors/cloud/checkgrubenvtofile/tests/test_checkgrubenvtofile.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkhybridimage/libraries/checkhybridimage.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkhybridimage/libraries/checkhybridimage.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkhybridimage/tests/test_checkhybridimage.py
Outdated
Show resolved
Hide resolved
...m_upgrade/el8toel9/actors/cloud/checkvalidgrubcfghybrid/libraries/checkvalidgrubcfghybrid.py
Outdated
Show resolved
Hide resolved
...m_upgrade/el8toel9/actors/cloud/checkvalidgrubcfghybrid/libraries/checkvalidgrubcfghybrid.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkgrubenvtofile/libraries/checkgrubenvtofile.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkhybridimage/libraries/checkhybridimage.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkhybridimage/actor.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/cloud/checkgrubenvtofile/libraries/checkgrubenvtofile.py
Outdated
Show resolved
Hide resolved
Previosly detection of Azure hybrid image was tightly coupled with process of converting grubenv symlink to a regular file. Since there exists other issues relating to hybrid images it is worth to separate these two concepts. This commit modifies the ScanHybridImage actor so that it produces a message whel WALinuxAgent is detected or we are booted in bios and ESP partition is mounted and we are running on Hyper-V (sign of a hybrid image). New CheckGrubenvToFile actor is responsible for detection of grubenv symlink on hybrid images and tasks ConvertGrubenvToFile that is later responsible for the actual conversion.
807c270
to
39d83e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - untested. keeping opened yet until someone test it manually :)
This PR includes two changes
Restructure hybrid image detection
Previosly detection of Azure hybrid image was tightly coupled with process of converting grubenv symlink to a regular file. Since there exists other issues relating to hybrid images it is worth to separate these two concepts.
This commit modifies the
CheckHybridImage
actor so that it produces a message whenWALinuxAgent
is detectedNew
CheckGrubenvToFile
actor is responsible for detection of grubenv symlink on hybrid images and tasksConvertGrubenvToFile
to be later responsible for the actual conversion during the upgrade.Check potential boot failures in Azure Gen1 VMs due to invalid grubcfg
This change addresses the issue where the
/boot/grub2/grub.cfg
file is overwritten during the upgrade process by an old RHEL7 configuration leftover on the system, causing the system to fail to boot.The problem occurs on hybrid Azure images. The issue is caused by one of the scriplets in
grub-efi
which overwrites during the upgrade current configuration in/boot/grub2/grub.cfg
by an old configuration from/boot/efi/EFI/redhat/grub.cfg
.The issue is detected and fixed specifically on Azure hybrid cloud systems.
If old configuration is detected, this actor regenerates the grub configuration using
grub2-mkconfig -o /boot/grub2/grub.cfg
after installing rpms to ensure the correct boot configuration is in place.Old configuration is detected by looking for a menuentry corresponding to a kernel from RHEL 7 which should not be present on RHEL 8 systems.
JIRA: RHEL-38255