Create a pre-upgrade report on a RHEL server, and then evaluate and address the results.
Outcomes
Create a pre-upgrade report by using the Leapp tool.
Review the pre-upgrade report, and resolve any errors or inhibitors.
Confirm upgrade changes to the system by modifying the Leapp answer file.
As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.
[student@workstation ~]$ lab start upgrade-preupgrade
Instructions
In the previous activity, you prepared a system for an in-place upgrade. In this activity, you run a pre-upgrade analysis. In future activities, you execute the upgrade and verify its success.
On the serverc machine, review the man page for the leapp command for information about how to use it.
Specifically, review information about the leapp preupgrade command.
Log in to the serverc machine as the student user.
Switch to the root user.
Use student as the password.
[student@workstation ~]$ssh servercstudent@serverc's password:student[student@serverc ~]$sudo -i[sudo] password for student:student[root@serverc ~]#
Review the leapp command man page.
[root@serverc ~]# man leapp
...output omitted...
COMMANDS
preupgrade
Generates a pre-upgrade report.
upgrade
Upgrades the current system to the next available major version.
answer
Manages answerfile generation: registers persistent
user choices for specific dialog sections.
...output omitted...The man page for the leapp command includes subcommand information.
The preupgrade command analyzes the machine and creates a report with information that is relevant to the upgrade.
Review the help information for the leapp preupgrade command.
[root@serverc ~]# leapp preupgrade --help
...output omitted...
--target {8.6,8.8,8.9}
Specify RHEL version to upgrade to for default
detected upgrade flavour
--iso ISO Use provided target RHEL installation image to perform
the in-place upgrade.
--channel {ga,tuv,e4s,eus,aus}
Set preferred channel for the IPU target.
--enablerepo <repoid>
Enable specified repository. Can be used multiple
times.
--no-rhsm-facts Do not store migration information using Red Hat
Subscription Manager. Automatically implied by --no-
rhsm.
...output omitted...The help information for the leapp preupgrade command describes some optional arguments and environment variables to override the command behavior.
For example, the --target option specifies the target version of Red Hat Enterprise Linux to which you are upgrading.
Create a pre-upgrade report to assess the serverc system for an upgrade from RHEL 7.9 to RHEL 8.9.
Review the report file and address any issues that are found during the analysis.
Review the current RHEL version of the serverc system.
[root@serverc ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)Run the pre-upgrade analysis for the serverc system.
[root@serverc ~]#leapp preupgrade --target 8.9...output omitted... Debug output written to /var/log/leapp/leapp-preupgrade.log ============================================================ REPORT OVERVIEW ============================================================ Upgrade has been inhibited due to the following problems: 1. Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed. 2. Missing required answers in the answer file HIGH and MEDIUM severity reports: 1. Packages available in excluded repositories will not be installed 2. Difference in Python versions and support in RHEL 8 3. GRUB2 core will be automatically updated during the upgrade 4. chrony using default configuration Reports summary: Errors: 0Inhibitors: 2HIGH severity reports: 3 MEDIUM severity reports: 1 LOW severity reports: 3 INFO severity reports: 4 Before continuing consult the full report: A report has been generated at /var/log/leapp/leapp-report.json A report has been generated at /var/log/leapp/leapp-report.txt ============================================================ END OF REPORT OVERVIEW ============================================================ Answerfile has been generated at /var/log/leapp/answerfile
The pre-upgrade analysis completed, and the /var/log/leapp/leapp-report.txt report file identifies issues that must be addressed.
The report identifies two issues as inhibitors that prevent the upgrade from completing successfully.
In the /var/log/leapp/leapp-report.txt report file, items with the Risk Factor: high (inhibitor) title must be resolved to continue with the upgrade.
The first inhibitor that the report identifies is an incompatibility issue with the pata_acpi and floppy kernel modules.
Assume that you have determined that these modules are not necessary for your server to perform its necessary functions.
Remove these modules to solve the issue.
[root@serverc ~]#cat /var/log/leapp/leapp-report.txtRisk Factor: high (inhibitor) Title: Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed. Summary: Support for the following RHEL 7 device drivers has been removed in RHEL 8: -pata_acpi-floppy...output omitted... [root@serverc ~]#rmmod pata_acpi[root@serverc ~]#rmmod floppy
The second inhibitor that the report identifies is missing information in the Leapp answer file. You must review and confirm tasks that the Leapp tool performs during the upgrade process.
[root@serverc ~]#cat /var/log/leapp/leapp-report.txt...output omitted... Risk Factor: high (inhibitor) Title:Missing required answers in the answer fileSummary: One or more sections in answerfile are missing user choices: remove_pam_pkcs11_module_check.confirm For more information consult https://red.ht/leapp-dialogs. ...output omitted...
Review the /var/log/leapp/answerfile file and confirm the tasks that the Leapp tool recommends.
[root@serverc ~]# cat /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
# Title: None
# Reason: Confirmation
# =================== remove_pam_pkcs11_module_check.confirm ==================
# Label: Disable pam_pkcs11 module in PAM configuration?
If no, the upgrade process will be interrupted.
# Description: PAM module pam_pkcs11 is no longer available in RHEL-8
since it was replaced by SSSD.
# Reason: Leaving this module in PAM configuration may
lock out the system.
# Type: bool
# Default: None
# Available choices: True/False
# Unanswered question. Uncomment the following line with your answer
# confirm =The Leapp tool requires confirmation to disable the pam_pkcs11 kernel module.
The serverc system is not managed by Identity Management in Red Hat Enterprise Linux, which requires this module, so you can safely remove the pam_pkcs11 module.
The machines in your organization might use Identity Management or other solutions that rely on the pam_pkcs11 module.
When converting a server in a different environment, you might need to determine a replacement for the pam_pkcs11 module and prepare to configure it.
Update the Leapp answer file to disable the kernel module.
To do so, uncomment the confirm variable and set it to the True value.
[root@serverc ~]# cat /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
...output omitted...
confirm = TrueThe issues in the leapp-report.txt report file will vary for your own systems.
The actions to resolve the reported issues depend on your environment, applications, and the upgrade plan.
The instructions in this exercise reflect the needs of the server in this lab environment.
When performing an upgrade, you must resolve all items that the pre-upgrade analysis marks as inhibitors.
Rerun the pre-upgrade analysis to verify that the analysis does not identify additional errors or inhibitors.
Rerun the pre-upgrade analysis.
[root@serverc ~]#leapp preupgrade --target 8.9...output omitted... Debug output written to /var/log/leapp/leapp-preupgrade.log ============================================================ REPORT OVERVIEW ============================================================ Following errors occurred and the upgrade cannot continue: 1. Actor: target_userspace_creator Message: Cannot set the container mode for the subscription-manager. HIGH and MEDIUM severity reports: 1. Packages available in excluded repositories will not be installed 2. Difference in Python versions and support in RHEL 8 3. GRUB2 core will be automatically updated during the upgrade 4. Module pam_pkcs11 will be removed from PAM configuration 5. chrony using default configuration Reports summary:Errors: 1Inhibitors: 0 HIGH severity reports: 3 MEDIUM severity reports: 2 LOW severity reports: 3 INFO severity reports: 4 Before continuing consult the full report: A report has been generated at /var/log/leapp/leapp-report.json A report has been generated at /var/log/leapp/leapp-report.txt ...output omitted...
This time, the analysis report returns the error: Cannot set the container mode for the subscription-manager.
This error occurs because the /etc/machine-id file does not exist or does not contain the required information.
Review the /etc/machine-id file.
[root@serverc ~]# cat /etc/machine-id
[root@serverc ~]#The /etc/machine-id file is empty.
Recreate the contents of the /etc/machine-id file.
You can delete the empty file, and then recreate its contents by using the dbus-uuidgen command, which generates a UUID to uniquely identify the machine.
[root@serverc ~]#rm /etc/machine-idrm: remove regular empty file '/etc/machine-id'?y[root@serverc ~]#dbus-uuidgen --ensure=/etc/machine-id
Verify the new contents of the /etc/machine-id file.
[root@serverc ~]# cat /etc/machine-id
ee5fbf90638db3eac55d67e065e61943Rerun the pre-upgrade analysis.
[root@serverc ~]# leapp preupgrade --target 8.9
...output omitted...
============================================================
REPORT OVERVIEW
============================================================
HIGH and MEDIUM severity reports:
1. Packages available in excluded repositories will not be installed
2. Difference in Python versions and support in RHEL 8
3. GRUB2 core will be automatically updated during the upgrade
4. Module pam_pkcs11 will be removed from PAM configuration
5. chrony using default configuration
Reports summary:
Errors: 0
Inhibitors: 0
HIGH severity reports: 3
MEDIUM severity reports: 2
LOW severity reports: 4
INFO severity reports: 4
Before continuing consult the full report:
A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt
============================================================
END OF REPORT OVERVIEW
============================================================
Answerfile has been generated at /var/log/leapp/answerfileThe Leapp tool completed the analysis and reports no errors and no inhibitors. This time, the Leapp tool also performed a package availability check.
Exit the serverc machine.
[root@serverc ~]#exitlogout [student@serverc ~]$exitlogout Connection to serverc closed. [student@workstation ~]$