Bug 1988419 - RHEL 7 kernels not removed and bootable after leapp upgrade
Summary: RHEL 7 kernels not removed and bootable after leapp upgrade
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: leapp-repository
Version: 7.9
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Leapp Notifications Bot
QA Contact: upgrades-and-conversions
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-30 13:58 UTC by lnarvaez
Modified: 2023-07-31 07:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OAMG-5341 0 None None None 2023-05-11 08:15:24 UTC

Description lnarvaez 2021-07-30 13:58:53 UTC
Description of problem: 

Leapp upgrade completes successfully but does not successfully remove RHEL 7 kernels.  These kernels are still available and bootable from the grub menu post upgrade to RHEL 8. 

Leapp upgrade logs do not show any items related to RHEL 7 package cleanup. 


Version-Release number of selected component (if applicable): 

leapp-0.12.1-1.el7_9.noarch                                 Thu Jul  1 10:58:45 2021


How reproducible:  Perform leapp upgrade on RHEL 7.9 system.  


Steps to Reproduce:
1. Perform leapp upgrade
2. On completion check grub menu during boot.  RHEL 7 kernels will appear
3. Select RHEL 7 kernel to boot system. 

Actual results:  

RHEL 7 kernels are available to select and boot from grub menu post upgrade.


Expected results:

RHEL 7 kernels should no longer be available after upgrade and removed as part of cleanup.

Comment 4 Petr Stodulka 2021-07-30 14:29:13 UTC
Hi Louis, thank you for the report. This is currently expected result, not a bug. We know about this problem and even we have documented steps that customer is required to do manually after the upgrade that lead into the correct removal of the old kernel and the bootloader entry:
    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/upgrading_from_rhel_7_to_rhel_8/index

We expect in future to improve the experience in this area, however for now, it's not sure when and whether it happen in the end.
The improvement itself is relatively easy if we ignore various side effects. However, when we count with various side-effects, the solution doesn't have to be so easy as it looks like. Notably:
  1) it will immadiately breaks the Boom's tool snapshots 
  2) it can trigger the removal of additional rpms that users originally expected to be present after the upgrad
  3) If user requires a special (3rd-party) drivers to be able to boot and haven't realized that before, ...

If customer requires the automatic removal of old kernels, they could extend the current functionality by own actors following the article below, that do all required steps described in the article above.


Customizing your Red Hat Enterprise Linux in-place upgrade:
    https://access.redhat.com/articles/4977891

Petr

Comment 5 Peter Vreman 2021-08-04 15:03:31 UTC
Petr

1) BOOM is not a hard requirement and in 95% of the cases not needed because the VM infrastructure provides already VM level Snapshotting that is much easier.
   If BOOM is used it can be detected by leapp and mention that the kernel cannot be delete in the first leapp step and a manual leapp step is neede

2) The RHEL8 upgrade process removes already so many RPMs that can trigger tons of other RPMS to be removed that it does not hurt much more to also remove kernel-3.10.
   The current documented manual cleanup steps tjhat recommend to remove all non-'*.el8.*rpm' is even much worser and will garantuee to break almost every no empty redhat system.

3) The 3rdparty drivers shall be part of the customer preparation phase and shall be identified by the leapp preupgrade process if they are inhibitors


I find it reasonable that i can expect after a leapp upgrade that the RHEL7 that stuff is removed out-of-the-box. That is how leapp is marketed. Not that i have afterwards run another 20 commands (removing the leftover of the kernels has 'for-loop' making it for the person executing it a lot more to prepare and execute the commands and not just a simpel 'copy-and-paste'




Peter

Comment 6 Petr Stodulka 2021-08-12 10:04:57 UTC
The removal of the old kernel is on our roadmap and we expect to deliver it during the next year (2022). In the meantime you can write a custom actor that will do this thing automatically. Example of such an actor is here:
    https://github.com/oamg/leapp-repository/blob/master/repos/system_upgrade/el7toel8/actors/removeleftoverpackages/actor.py

In case of the custom actor, do not use the ExperimentalTag tag. Here is a link to the public tutorials for leapp:
    https://leapp.readthedocs.io/en/latest/tutorials.html

Comment 7 Peter Vreman 2021-08-12 12:05:00 UTC
The following 2 simple shell commands will do the job also:
~~~
yum remove kernel-3\*
rm -rfv /lib/modules/3.*.el7* /usr/lib/firmware/3.*.el7* /boot/loader/entries/*-3.*.el7*
~~~


Note You need to log in before you can comment on or make changes to this bug.