なにかの技術メモ置き場

なにかの技術メモ置き場

@インフラエンジニア

CentOS8のPXEインストールでdracut-initqueue timeoutが発生

事象

PXEサーバからCentOS8のインストールが失敗した。

Warning: dracut-initqueue timeout - starting timeout scripts
Warning: Could not boot.
Warning: /dev/root does not exist

先に結論

CentOS7以降では「append」パラメータに「inst.repo」や「inst.ks」などが実質必須になった。

環境

用途 OS パッケージ 備考
インストール先 CentOS 8.1.1911 - KVMゲスト
TFTPサーバ CentOS 8.1.1911 tftp-server-5.2 PXEサーバとして1ノード
DHCPサーバ CentOS 8.1.1911 dhcp-server-4.3.6 PXEサーバとして1ノード
HTTPサーバ CentOS 8.1.1911 httpd-2.4.37 PXEサーバとして1ノード
NFSサーバ 割愛 割愛 ReadyNAS Pro 2
KVMホスト CentOS 8.1.1911 - KVMホスト

事象詳細

[  OK  ] Started udev Wait for Complete Device Initialization.
         Starting Device-Mapper Multipath Device Controller...
[  OK  ] Started Device-Mapper Multipath Device Controller.
[  OK  ] Reached target Local File System (Pre).
[  OK  ] Reached target Local File System.
         Starting Create Volative Files and Directories...
         Starting Open-iSCSI...
[  OK  ] Started Create Volative Files and Directories.
[  OK  ] Reached target System Initializatin.
[  OK  ] Reached target Basic System.
[  OK  ] Started Open-iSCSI.
         Starting dracut initqueue hook...
[  XXX.XXXXXX] dracut-initqueue[XXX]: Warning: dracut-initqueue timeout - starting timeout scripts
…
[  XXX.XXXXXX] dracut-initqueue[XXX]: Warning: dracut-initqueue timeout - starting timeout scripts
[  XXX.XXXXXX] dracut-initqueue[XXX]: Warning: Could not boot.
         Starting Setup Virtual Console...
[  OK  ] Started Setup Virtual Console.
         Starting Dracut Emergency Shell...
Warning: /dev/root does not exist

Generating "/run/initramfs/rdsosreport.txt"


Entering emergency mode. Exit the shell to continue.
Type "journalctl" to view system logs.
You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot
after mounting them and attach it to a bug report.


dracut:/#

事象分析

DHCPサーバからネットワーク情報を取得:OK
・TFTPサーバからブートイメージ(initrd.img、vmlinuz)を取得:OK
・ブートイメージからの起動:OK
インストーライメージを起動:NG

調査

RHEL公式サイトで設定ファイルの書き方を再確認した。
結果、RHEL7から「inst.repo」や「inst.ks」オプションが必須であると判断した。
# 必須なのか任意なのか明記されていないのがつらい・・・

・RHEL8のPXEサーバ構築手順
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/configuring-a-tftp-server-for-bios-based-clients_preparing-for-a-network-install
→手順8のサンプルではオプションあり。
→手順8の注記にそれらしき記載あり。

このランタイムイメージなしでは、インストールプログラムは起動できません。inst.stage2 起動オプションを使用して、イメージの場所を指定します。または、inst.repo= オプションを使用して、イメージおよびインストールソースを指定することも可能です。


・RHEL7のPXEサーバ構築手順
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/installation_guide/chap-installation-server-setup
→「手順23.1 BIOS ベースのシステム向けに TFTP ブートサーバーを設定する」
 →手順6のサンプルではオプションあり。
 →手順6の注記に明確な記載あり。

重要
上記の例で示されている inst.repo= Anaconda オプションでは、常にインストールソースに加えてインストールプログラムのイメージを指定する必要があります。このオプションを使用しないと、インストールプログラムは起動できなくなります。


・RHEL6のPXEサーバ構築手順
https://access.redhat.com/documentation/ja_jp/red_hat_enterprise_linux/6/html/installation_guide/s1-netboot-pxe-config
→30.2.1. BIOS 用の PXE ブートの設定
 →手順7のサンプルではオプションなし。
https://access.redhat.com/documentation/ja_jp/red_hat_enterprise_linux/6/html/installation_guide/ch-Boot-x86#s2-x86-starting-bootopts
→7.1.3. 追加できる起動オプション
 →repoオプションは存在するが、必須との記載が見当たらない。

対処

PXEのエントリを修正。いくつか例示。

Before

label X
        MENU LABEL ^X. CentOS-8.1.1911-x86_64 Installer
        kernel CentOS-8.1.1911-x86_64/isolinux/vmlinuz
        append initrd=CentOS-8.1.1911-x86_64/isolinux/initrd.img

After

e.g.) inst.repoでリモートディレクトリを指定。
# httpの他に、httpsftpnfsなど使用可能。

label X
        MENU LABEL ^X. CentOS-8.1.1911-x86_64 Installer
        kernel CentOS-8.1.1911-x86_64/isolinux/vmlinuz
        append initrd=CentOS-8.1.1911-x86_64/isolinux/initrd.img inst.repo=http://【HTTPサーバの所定ディレクトリ】/


e.g.) inst.repoでISOファイルを指定。
# NFSサーバのみ。HTTPだと「ISOファイルをGETする」だけなので、ISOの中身が見えず失敗する。

label X
        MENU LABEL ^X. CentOS-8.1.1911-x86_64 Installer
        kernel CentOS-8.1.1911-x86_64/isolinux/vmlinuz
        append initrd=CentOS-8.1.1911-x86_64/isolinux/initrd.img inst.repo=nfs://【NFSサーバの所定ディレクトリ】/CentOS-8.1.1911-x86_64-dvd1.iso


e.g.) inst.ksでkickstartファイルを指定。

label X
        MENU LABEL ^X. CentOS-8.1.1911-x86_64 Installer
        kernel CentOS-8.1.1911-x86_64/isolinux/vmlinuz
        append initrd=CentOS-8.1.1911-x86_64/isolinux/initrd.img ks=http://【HTTPサーバの所定ディレクトリ】/ks_centos8.cfg


e.g.) inst.repoでインターネット上のリポジトリを指定。
# おまけ。当環境のDHCPサーバから取得したネットワーク設定では、インターネットと通信ができない。そのため、インターネットと通信できるネットワーク情報を手動設定してしまう。
# パラメータの書式がCentOS8で変わったらしいので参考として記載しておく。

label X
        MENU LABEL ^X. CentOS-8.1.1911-x86_64 Installer
        kernel CentOS-8.1.1911-x86_64/isolinux/vmlinuz
        append initrd=CentOS-8.1.1911-x86_64/isolinux/initrd.img ip=192.168.0.100::192.168.0.1:255.255.255.0:guest01:ens3:none nameserver=192.168.0.1 inst.repo=http://ftp.riken.jp/Linux/centos/8/BaseOS/x86_64/os/

補足

-