Bug 2209599

Summary: Failed to launch the installer with "inst.ks=cdrom:/ks.cfg inst.repo=cdrom"
Product: Red Hat Enterprise Linux 9 Reporter: Yihuang Yu <yihyu>
Component: anacondaAssignee: Jiri Konecny <jkonecny>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 9.3CC: jkonecny, jstodola, kazen, myllynen, rduda, richard.liu, vslavik, xuwei, yfu
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 9.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-34.25.3.3-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:32:05 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:
Bug Depends On:    
Bug Blocks: 2209174    

Description Yihuang Yu 2023-05-24 08:05:06 UTC
Description of problem:
When trying to install a kvm VM, I save the ks.cfg into a cdrom named ks.iso, and append kernel params "inst.repo=cdrom inst.ks=cdrom:/ks.cfg" in the qemu command line, after the VM is started, the anaconda installer cannot be launched.

Version-Release number of selected component (if applicable):
distro: RHEL-9.3.0-20230523.0-aarch64-dvd1.iso
anaconda: anaconda-34.25.3.1-1.el9

How reproducible:
always

Steps to Reproduce:
1. Create a VM with qemu-kvm and contains following lines:
    -blockdev '{"node-name": "file_cd1", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/iso/linux/RHEL-9.3.0-20230523.0-aarch64-dvd1.iso", "cache": {"direct": true, "no-flush": false}}' \
    -blockdev '{"node-name": "drive_cd1", "driver": "raw", "read-only": true, "cache": {"direct": true, "no-flush": false}, "file": "file_cd1"}' \
    -device '{"driver": "scsi-cd", "id": "cd1", "drive": "drive_cd1", "write-cache": "on"}' \
    -blockdev '{"node-name": "file_unattended", "driver": "file", "auto-read-only": true, "discard": "unmap", "aio": "threads", "filename": "/home/kvm_autotest_root/images/rhel930-aarch64/ks.iso", "cache": {"direct": true, "no-flush": false}}' \
    -blockdev '{"node-name": "drive_unattended", "driver": "raw", "read-only": true, "cache": {"direct": true, "no-flush": false}, "file": "file_unattended"}' \
    -device '{"driver": "scsi-cd", "id": "unattended", "drive": "drive_unattended", "write-cache": "on"}'  \
    -kernel '/home/kvm_autotest_root/images/rhel930-aarch64/vmlinuz'  \
    -append 'inst.sshd inst.repo=cdrom inst.ks=cdrom:/ks.cfg net.ifnames=0 inst.wait_for_disks=30 console=ttyAMA0,38400'  \
    -initrd '/home/kvm_autotest_root/images/rhel930-aarch64/initrd.img'  \

2. Check the serial output
2023-05-24 03:24:15:          Starting ^[[0;1;39mDevice-Mapper Multipath Device Controller^[[0m...
2023-05-24 03:24:15: [^[[0;32m  OK  ^[[0m] Started ^[[0;1;39mDevice-Mapper Multipath Device Controller^[[0m.
2023-05-24 03:24:15: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mPreparation for Local File Systems^[[0m.
2023-05-24 03:24:15: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mLocal File Systems^[[0m.
2023-05-24 03:24:15: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mSystem Initialization^[[0m.
2023-05-24 03:24:15: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mBasic System^[[0m.
2023-05-24 03:24:15: Please insert CDROM containing '/ks.cfg'...
2023-05-24 03:24:18: [   13.328221] dracut-initqueue[1467]: Warning: no suitable images
2023-05-24 03:24:18: [   13.753371] loop: module loaded
2023-05-24 03:24:18: [   13.756529] loop0: detected capacity change from 0 to 1505264
2023-05-24 03:24:18: [   13.767720] loop1: detected capacity change from 0 to 6291456
2023-05-24 03:24:18: [   13.779368] loop2: detected capacity change from 0 to 67108864
3.

Actual results:
anaconda cannot find the ks.cfg in the cdrom, the installer failed to be launched.

Expected results:
the installer can be launched.

Additional info:
1. By default, "inst.wait_for_disks=5", if I add "inst.wait_for_disks=0", the problem is gone.

2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mSystem Initialization^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Started ^[[0;1;39mDaily Cleanup of Temporary Directories^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mTimer Units^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Listening on ^[[0;1;39mD-Bus System Message Bus Socket^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Listening on ^[[0;1;39mOpen-iSCSI iscsid Socket^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Listening on ^[[0;1;39mOpen-iSCSI iscsiuio Socket^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mSocket Units^[[0m.
2023-05-24 04:01:49:          Starting ^[[0;1;39mD-Bus System Message Bus^[[0m...
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Started ^[[0;1;39mD-Bus System Message Bus^[[0m.
2023-05-24 04:01:49: [^[[0;32m  OK  ^[[0m] Reached target ^[[0;1;39mBasic System^[[0m.
2023-05-24 04:01:49:          Starting ^[[0;1;39mAnaconda NetworkManager configuration^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mNetworkManager auda installation environment^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mpre-anaconda logging service^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mRestore /run/initramfs on shutdown^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mHold until boot process finishes up^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mTerminate Plymouth Boot Screen^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mSystem Logging Service^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mOpenSSH ecdsa Server Key Generation^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mOpenSSH ed25519 Server Key Generation^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mOpenSSH rsa Server Key Generation^[[0m...
2023-05-24 04:01:49:          Starting ^[[0;1;39mUser Login Management^[[0m...
...
...
2023-05-24 04:01:57:  * shell is available on TTY2
2023-05-24 04:01:57:  * when reporting a bug add logs from /tmp as separate text/plain attachments
2023-05-24 04:02:12: Queued start job for default target Main User Target.
2023-05-24 04:02:12: Startup finished in 404ms.

2. If using "inst.ks=https://xxx", cannot trigger this problem.

Comment 1 Yihuang Yu 2023-05-24 08:12:17 UTC
The problem is only in the latest anaconda, and from bug 2171811, so set "Regression" keyword.

Comment 2 Jan Stodola 2023-05-26 07:29:19 UTC
I've attached debugging logs to the RHEL-8 bug 2209602.
Proposing this bug fox fixing in 9.3, otherwise bug 2171811 needs to be reverted.

Comment 3 Jiri Konecny 2023-05-30 13:48:47 UTC
bug 2193332 might be a duplicate of this issue

Comment 4 Jan Stodola 2023-05-31 08:31:59 UTC
*** Bug 2211011 has been marked as a duplicate of this bug. ***

Comment 5 Jiri Konecny 2023-06-02 11:19:43 UTC
PR: https://github.com/rhinstaller/anaconda/pull/4802

Comment 7 Jan Stodola 2023-06-14 12:14:10 UTC
Retested with anaconda-34.25.3.3-1.el9 and this problem is fixed there, the kickstart file is loaded and the installation continues.
When inst.ks=cdrom:/ks.cfg is present on the kernel cmdline and no such a medium is present, the boot process is paused until a medium with ks.cfg is inserted, then the boot process continues.
No regression was found when re-testing bug 2171811 with OEMDRV-labeled medium.

Marking as Verified:Tested.

Comment 10 Jan Stodola 2023-06-19 12:44:55 UTC
Checked that anaconda-34.25.3.3-1.el9 is in nightly compose RHEL-9.3.0-20230619.35

Moving to VERIFIED

Comment 12 errata-xmlrpc 2023-11-07 08:32:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (anaconda bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6414