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 1144840 - initrd should include virtio_blk and virtio_scsi drivers when guest installed with ahci
Summary: initrd should include virtio_blk and virtio_scsi drivers when guest installed...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dracut
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: dracut-maint
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-21 12:57 UTC by CongLi
Modified: 2014-12-08 05:40 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-08 05:40:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
guest initrd log (133.36 KB, text/plain)
2014-09-21 12:57 UTC, CongLi
no flags Details
pci - guest boot up failed with virtio-blk driver (29.28 KB, application/octet-stream)
2014-09-21 12:59 UTC, CongLi
no flags Details
anaconda log from guest (720.00 KB, application/x-tar)
2014-09-23 02:49 UTC, CongLi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 978245 0 medium CLOSED install a rhel5 as kvm guest better always build initrd.img with ahci driver(and virtio-blk) 2021-02-22 00:41:40 UTC

Internal Links: 978245

Description CongLi 2014-09-21 12:57:23 UTC
Created attachment 939756 [details]
guest initrd log

Description of problem:
initrd should include virtio_blk and virtio_scsi drivers when guest installed with ahci

guest can't boot up with virtio_blk or virtio_scsi driver although the guest is installed with ahci.

1. installed the guest with ahci and check the initrd info:
# lsinitrd /boot/initramfs-3.10.0-123.el7.x86_64.img | grep -i ahci
-rw-r--r--   1 root     root        61169 May  5 23:45 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/ata/ahci.ko
-rw-r--r--   1 root     root        51561 May  5 23:45 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/ata/libahci.ko

2. check the virtio driver:
# lsinitrd /boot/initramfs-3.10.0-123.el7.x86_64.img | grep -i virtio
-rw-r--r--   1 root     root        50145 May  5 23:45 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/net/virtio_net.ko
drwxr-xr-x   2 root     root            0 Sep 21 18:28 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/virtio
-rw-r--r--   1 root     root        13065 May  5 23:45 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/virtio/virtio.ko
-rw-r--r--   1 root     root        21073 May  5 23:45 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/virtio/virtio_pci.ko
-rw-r--r--   1 root     root        24441 May  5 23:45 usr/lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/virtio/virtio_ring.ko

Version-Release number of selected component (if applicable):
host: 
kernel-3.10.0-163.el7.x86_64
qemu-kvm-rhev-2.1.0-4.el7.x86_64
guest:
tree: RHEL-7.0-20140507.0
kernel-3.10.0-123.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. install a rhel.7.0 guest with ahci
    -device ahci,id=ahci0,bus=pci.0,addr=06 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.1-64-virtio.qcow2 \
    -device ide-hd,id=image1,drive=drive_image1,bootindex=0 \

2. shutdown the guest
3. boot up the guest with virtio_blk driver
   -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.1-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0 \

Actual results:
guest can't boot up with error:
systemd-fsck[282]: fsck: error 2 (No such file or directory) while executing fsck.ext2 for /dev/disk/by-uuid/92b20565-b3a8-450a-8d93-2ee580ccaf54
dracut-initqueue[403]: Warning: Could not boot.

Expected results:
geust can boot up with virtio_blk or virtio_scsi driver

Additional info:
1. in guest: 
[root@unused ~]# systemd-detect-virt --vm
kvm
[root@unused ~]# lsmod | grep virtio
virtio_net             28059  0 
virtio_pci             17725  0 
virtio_ring            21011  2 virtio_net,virtio_pci
virtio                 14187  2 virtio_net,virtio_pci

2. in guest:
[root@unused ~]# ls -R /dev/disk /dev/mapper
/dev/disk:
by-id  by-uuid

/dev/disk/by-id:
ata-QEMU_HARDDISK_QM00015
ata-QEMU_HARDDISK_QM00015-part1
ata-QEMU_HARDDISK_QM00015-part2
dm-name-rhel_unused-root
dm-name-rhel_unused-swap
dm-uuid-LVM-btACEbZNhvfZCguRXORgp27lSyla7JA91MVfq07eSBf7PfxBVFgsbS4leoVmGCD1
dm-uuid-LVM-btACEbZNhvfZCguRXORgp27lSyla7JA9R93qf9g1p6mbNQ0N7mAuvobZAkZwrpJh
lvm-pv-uuid-qC4Jaz-KGPK-zeLM-L206-wZK3-Hwvp-PF7CxC

/dev/disk/by-uuid:
1f41b1bb-5435-48bd-80de-fa80c705c64c  ad27dda0-8f5b-4f04-a402-070a93062614
92b20565-b3a8-450a-8d93-2ee580ccaf54

/dev/mapper:
control  rhel_unused-root  rhel_unused-swap

3. Qemu CML (installed with ahci):
/bin/qemu-kvm \
    -S  \
    -name 'virt-tests-vm1'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga cirrus  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140920-001511-6TchmCvt,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140920-001511-6TchmCvt,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140920-001511-6TchmCvt,path=/tmp/seabios-20140920-001511-6TchmCvt,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140920-001511-6TchmCvt,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -device ahci,id=ahci0,bus=pci.0,addr=04 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.1-64-virtio.qcow2 \
    -device ide-hd,id=image1,drive=drive_image1,bus=ahci0.0,unit=0 \
    -device virtio-net-pci,mac=9a:21:22:23:24:25,id=id9jHflY,vectors=4,netdev=id7TTbXO,bus=pci.0,addr=05  \
    -netdev tap,id=id7TTbXO,vhost=on,vhostfd=23,fd=22  \
    -m 4096  \
    -smp 4,cores=2,threads=1,sockets=2  \
    -cpu 'Opteron_G4',+kvm_pv_unhalt \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file=/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/isos/linux/RHEL7.1-Server-x86_64.iso \
    -device ide-cd,id=cd1,drive=drive_cd1,bus=ide.0,unit=0 \
    -drive id=drive_fl,if=none,cache=none,snapshot=off,readonly=off,aio=native,file=/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/rhel71-64/ks.vfd \
    -global isa-fdc.driveA=drive_fl \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -kernel '/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/rhel71-64/vmlinuz'  \
    -append 'ks=hd:fd0:/ks.cfg nicdelay=60 console=ttyS0,115200 console=tty0'  \
    -initrd '/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/rhel71-64/initrd.img'  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=d,menu=off  \
    -no-kvm-pit-reinjection \
    -no-shutdown \
    -enable-kvm

4. host info:
processor	: 23
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 1
model name	: AMD Opteron(TM) Processor 6234                 
stepping	: 2
microcode	: 0x6000626
cpu MHz		: 2400.031
cache size	: 2048 KB
physical id	: 1
siblings	: 12
core id		: 5
cpu cores	: 6
apicid		: 75
initial apicid	: 43
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bogomips	: 4799.73
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb

Comment 1 CongLi 2014-09-21 12:59:43 UTC
Created attachment 939757 [details]
pci - guest boot up failed with virtio-blk driver

Comment 3 David Shea 2014-09-22 13:34:17 UTC
Please post the logs from the installation (available in /tmp in the install environment or in /var/log/anaconda in the installed system) to this bug as individual, text/plain attachments.

Comment 4 David Shea 2014-09-22 13:35:17 UTC
Whoops, messed up the needinfo.

Comment 5 CongLi 2014-09-23 02:49:04 UTC
Created attachment 940235 [details]
anaconda log from guest

Comment 6 David Shea 2014-09-23 18:47:45 UTC
The initrd was created without virtio_block drivers because you installed a system that did not use virtio_block. initrds in RHEL-7 are created with --hostonly, so you cannot change the bus for the drive containing the root partition without first modifying the initrd and your boot parameters to support it.

Comment 7 CongLi 2014-09-24 02:24:49 UTC
(In reply to David Shea from comment #6)
> The initrd was created without virtio_block drivers because you installed a
> system that did not use virtio_block. initrds in RHEL-7 are created with
> --hostonly, so you cannot change the bus for the drive containing the root
> partition without first modifying the initrd and your boot parameters to
> support it.

Yes, for host, switch driver is not a must.

But switching block device controller in a virt environment is quite common useage, so better always include virtio-* driver at the installation stage.

Hi Ronen,

Could you please have a look at this problem ?

Do we support that install a rhel.7 guest with ahci driver and can boot up with virtio-* driver?

Thanks.

Comment 8 Ronen Hod 2014-09-29 09:28:50 UTC
David,
A RHEL7 guest needs to be able to boot from a virtio disk (blk/scsi). This is also always doable for Windows guests, and we cannot stay behind.
Is there a way to do it without always including the two virtio drivers? Is there a reason to "discriminate" these drivers and not include them?
Not sure that I am asking the right questions :-)
Thanks, Ronen.

Comment 9 David Shea 2014-10-05 16:18:22 UTC
(In reply to Ronen Hod from comment #8)
> David,
> A RHEL7 guest needs to be able to boot from a virtio disk (blk/scsi). This
> is also always doable for Windows guests, and we cannot stay behind.
> Is there a way to do it without always including the two virtio drivers? Is
> there a reason to "discriminate" these drivers and not include them?
> Not sure that I am asking the right questions :-)
> Thanks, Ronen.

The problem you are having is that dracut is *not* being discriminatory in its treatment of the virtio drivers. The initrd created at install time when installing with an ahci bus does not include the virtio drivers, since from dracut's point of view the virtio drivers are not needed, since they are not used to access the storage used while installing. If you want to change the bus used for your virtual storage devices, you will need to regenerate your initrd files, either explicitly including the virtio drivers or using --nohostonly to include a wider set of drivers not used by the currently running system.

If you want to pursue this bug to have virtio drivers automatically included in the initrd files in virtual environments, please change the component to dracut so that the virtio drivers can be handled differently during initrd creation.

Comment 10 Ronen Hod 2014-10-06 07:38:19 UTC
See Comment 9.
We would like the virtio drivers to be available at install time too.

Comment 11 Harald Hoyer 2014-10-20 12:04:40 UTC
(In reply to Ronen Hod from comment #10)
> See Comment 9.
> We would like the virtio drivers to be available at install time too.

reassigning

The initramfs for installation is composed with dracut, but the dracut module and kernel driver set is  controlled by lorax.

Comment 12 Brian Lane 2014-10-20 18:11:46 UTC
They already are:

lsinitrd initrd.img | grep -i virt
-rw-r--r--   1 root     root        27753 Oct  8 14:49 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/block/virtio_blk.ko
-rw-r--r--   1 root     root        50513 Oct  8 14:48 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/net/virtio_net.ko
-rw-r--r--   1 root     root        28561 Oct  8 14:49 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/scsi/virtio_scsi.ko
drwxr-xr-x   2 root     root            0 Oct 10 00:48 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio
-rw-r--r--   1 root     root        13145 Oct  8 14:49 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio/virtio.ko
-rw-r--r--   1 root     root        21121 Oct  8 14:49 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio/virtio_pci.ko
-rw-r--r--   1 root     root        25521 Oct  8 14:49 usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio/virtio_ring.ko

See comment 9.

Also, if this is a kickstart you can add the dracut-config-generic package and it will turn off the hostonly behavior.

Comment 13 CongLi 2014-12-08 05:40:42 UTC
(In reply to bcl from comment #12)
> They already are:
> 
> lsinitrd initrd.img | grep -i virt
> -rw-r--r--   1 root     root        27753 Oct  8 14:49
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/block/virtio_blk.ko
> -rw-r--r--   1 root     root        50513 Oct  8 14:48
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/net/virtio_net.ko
> -rw-r--r--   1 root     root        28561 Oct  8 14:49
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/scsi/virtio_scsi.ko
> drwxr-xr-x   2 root     root            0 Oct 10 00:48
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio
> -rw-r--r--   1 root     root        13145 Oct  8 14:49
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio/virtio.ko
> -rw-r--r--   1 root     root        21121 Oct  8 14:49
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio/virtio_pci.ko
> -rw-r--r--   1 root     root        25521 Oct  8 14:49
> usr/lib/modules/3.10.0-184.el7.x86_64/kernel/drivers/virtio/virtio_ring.ko
> 
> See comment 9.
> 
> Also, if this is a kickstart you can add the dracut-config-generic package
> and it will turn off the hostonly behavior.

Hi bcl,

Thanks for your explanation.

Test pass when add package dracut-config-generic in the kickstart.

I will close this bug as 'NOT A BUG'.

Thanks.


Note You need to log in before you can comment on or make changes to this bug.