Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1988419

Summary: RHEL 7 kernels not removed and bootable after leapp upgrade
Product: Red Hat Enterprise Linux 7 Reporter: lnarvaez
Component: leapp-repositoryAssignee: Leapp Notifications Bot <leapp-notifications-bot>
Status: CLOSED MIGRATED QA Contact: upgrades-and-conversions
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.9CC: dhiguera, jbreitwe, peter.vreman, pstodulk
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-12 11:11:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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*
~~~

Comment 11 RHEL Program Management 2023-09-12 11:05:57 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 12 RHEL Program Management 2023-09-12 11:11:03 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.