はじめに
RHEL7.2をRHEL8.4にインプレースアップグレードする作業がありましたので記録を残しておきます。以下のサイトを元に作業を実施しています。
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html-single/upgrading_from_rhel_7_to_rhel_8/index
環境
今回はAWSのインスタンス(RHEL7.2)を使用します。AWS の提供するサブスクリプション込みのインスタンスを利用する場合はSubscription Manager を使用する必要はありません。
手順
全パッケージのアップデート
カーネルを含めてアップデートします。アップデート後は再起動します。これによりRHEL7.2がRHEL7.9になります。
$ sudo yum update -y
・・・
Complete!
$ sudo reboot
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
リポジトリの有効化とインストール
$ sudo yum-config-manager --enable rhui-client-config-server-7
$ sudo yum-config-manager --enable rhel-7-server-rhui-extras-rpms
$ sudo yum -y install rh-amazon-rhui-client leapp-rhui-aws
Leapp ユーティリティーのインストール
$ sudo yum install leapp leapp-repository
RedHatのサイトから「leapp-data14.tar.gz」をダウンロードします。
(無料のアカウント登録が必要です)
https://access.redhat.com/ja/articles/4175971
ファイルをダウンロードしたら、対象サーバに保存します。管理人はTeraTermの「SSH SCP」機能を使用しています。
ファイルを展開し指定の場所に配置します。
$ sudo tar -xzf leapp-data14.tar.gz -C /etc/leapp/files && rm -f leapp-data14.tar.gz
アップグレードのテスト
$ sudo leapp preupgrade
・・・
============================================================
ERRORS
============================================================
2021-08-26 23:08:03.830190 [ERROR] Actor: scan_subscription_manager_info
Message: A subscription-manager command failed to execute
Summary:
Details: Command ['subscription-manager', 'release'] failed with exit code 1.
Stderr: This system is not yet registered. Try 'subscription-manager register --help' for more information.
Hint: Please ensure you have a valid RHEL subscription and your network is up. If you are using proxy for Red Hat subscription-manager, please make sure it is specified inside the /etc/rhsm/rhsm.conf file. Or use the --no-rhsm option when running leapp, if you do not want to use subscription-manager for the in-place upgrade and you want to deliver all target repositories by yourself or using RHUI on public cloud.
============================================================
END OF ERRORS
============================================================
エラーメッセージを見ると、オプションが(--no-rhsm)が必要ですね。オプションをつけて再実行します。
$ sudo leapp preupgrade --no-rhsm
・・・
============================================================
UPGRADE INHIBITED
============================================================
Upgrade has been inhibited due to the following problems:
1. Inhibitor: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.
2. Inhibitor: Possible problems with remote login using root account
3. Inhibitor: Missing required answers in the answer file
Consult the pre-upgrade report for details and possible remediation.
============================================================
UPGRADE INHIBITED
============================================================
Debug output written to /var/log/leapp/leapp-preupgrade.log
============================================================
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
============================================================
結果を見ると3つの問題があると表示されました。レポートを確認していきます。
レポートの確認と対応
レポートファイルを確認します。
$ sudo less /var/log/leapp/leapp-report.txt
----------------------------------------
Risk Factor: high (inhibitor)
Title: 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:
- floppy
- pata_acpi
Please see https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-device-drivers_hardware-enablement for details.
Remediation: [hint] Please disable detected kernel drivers in order to proceed with the upgrade process using the rmmod or modprobe -r.
Key: b6fd580136aaf67fa42d68fb75b27f6e13f47c2d
----------------------------------------
Risk Factor: high (inhibitor)
Title: Possible problems with remote login using root account
Summary: OpenSSH configuration file does not explicitly state the option PermitRootLogin in sshd_config file, which will default in RHEL8 to "prohibit-password".
Remediation: [hint] If you depend on remote root logins using passwords, consider setting up a different user for remote administration or adding "PermitRootLogin yes" to sshd_config.
Key: 3d21e8cc9e1c09dc60429de7716165787e99515f
----------------------------------------
Risk Factor: high (inhibitor)
Title: Missing required answers in the answer file
Summary: One or more sections in answerfile are missing user choices: remove_pam_pkcs11_module_check.confirm
For more information consult https://leapp.readthedocs.io/en/latest/dialogs.html
Remediation: [hint] Please register user choices with leapp answer cli command or by manually editing the answerfile.
[command] leapp answer --section remove_pam_pkcs11_module_check.confirm=True
Key: d35f6c6b1b1fa6924ef442e3670d90fa92f0d54b
----------------------------------------
3つの問題点と対応方法は以下のとおりです。
- RHEL8で削除されたカーネルドライバがある(floppyとpata_acpiの2つ)
→ modprobe コマンドを使用する(sudo modprobe -r floppy pata_acpi) - rootアカウントでリモートログインする設定になっていない
→ 設定ファイル修正(sudo vi /etc/ssh/sshd_config で「PermitRootLogin yes」にする) - 回答ファイルに情報が不足している
→ 回答ファイル修正(sudo vi /var/log/leapp/answerfile で「confirm = True」にする)
アップグレードの実行
再度、「sudo leapp preupgrade --no-rhsm」コマンドを実行します。問題なくアップグレードできることが確認できました。
$ sudo leapp preupgrade --no-rhsm
・・・
Transaction Summary
=======================================================================================================================================
Install 248 Packages
Upgrade 295 Packages
Remove 71 Packages
Downgrade 5 Packages
Total size: 554 M
Total download size: 442 M
Downloading Packages:
Check completed.
====> * report_set_target_release
Reports information related to the release set in the subscription-manager after the upgrade.
==> Processing phase `Reports`
====> * verify_check_results
Check all dialogs and notify that user needs to make some choices.
====> * verify_check_results
Check all generated results messages and notify user about them.
Debug output written to /var/log/leapp/leapp-preupgrade.log
============================================================
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
============================================================
Answerfile has been generated at /var/log/leapp/answerfile
「sudo leapp upgrade --no-rhsm」コマンドでアップグレードを実行します。これによりRHEL7.9がRHEL8.4になります。
$ sudo leapp upgrade --no-rhsm
・・・
$ sudo reboot
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)
通常、問題なくアップグレードできると思いますがサーバの環境により以下のエラーで停止することがあります。
Error Summary
-------------
Disk Requirements:
At least 228MB more space needed on the / filesystem.
dfコマンドでディスクの空き容量が十分ある場合は、以下のサイトを参考に対応して下さい。
https://access.redhat.com/solutions/5057391
管理人が確認した環境では環境変数の値を変更することで対応できました。
# export LEAPP_OVL_SIZE=3072
コメント