Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1528205

Summary: Failed to boot installed(virtio-scsi) windows guest from usb-storage
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Gu Nini <ngu>
Component: qemu-kvmAssignee: Vadim Rozenfeld <vrozenfe>
Status: CLOSED WONTFIX QA Contact: Michael <choma>
Severity: medium Docs Contact:
Priority: high    
Version: 8.0CC: ailan, chayang, jinzhao, juzhang, knoel, marcel, ngu, rbalakri, virt-maint, vrozenfe, xiaohli, xuma
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-14 14:58:15 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: 1558351    
Attachments:
Description Flags
Failure_screenshot_of_win10-i3886
none
boot win2016 guest failed on rhel8 host none

Description Gu Nini 2017-12-21 09:56:38 UTC
Description of problem:
Install a windows guest(Win10.i386, Win2012r2) from virtio scsi and q35 machine type; reboot the guest from usb-storage, it's a failure(might be for INACCESSIBLE BOOT DEVICE)

Version-Release number of selected component (if applicable):
Host kernel: 3.10.0-801.el7.x86_64
Qemu-kvm-rhev: qemu-kvm-rhev-2.10.0-12.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install a windows guest from virtio scsi and q35:

-machine q35 \
-device pcie-root-port,bus=pcie.0,id=root0,multifunction=on,chassis=1,addr=0xa.0 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=root0 \
-drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/win2012r2 \
-device scsi-hd,id=image1,drive=drive_image1,bootindex=1 \
-cpu Opteron_G4,+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time

2. After the installation finishes, quit the guest
3. Boot the guest again from usb-storage and q35:

-machine q35 \
-device pcie-root-port,bus=pcie.0,id=root0,multifunction=on,chassis=1,addr=0xa.0 \
-device  nec-usb-xhci,id=usbtest,bus=root0 \
-drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/win2012r2 \
-device usb-storage,id=image1,drive=drive_image1,bus=usbtest.0,bootindex=1 \
-cpu Opteron_G4,+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time


Actual results:
It's a failure to boot up the guest from usb-storage.


Expected results:
Can boot guest from usb-storage

Additional info:

Comment 2 Gu Nini 2017-12-21 10:05:19 UTC
Created attachment 1370787 [details]
Failure_screenshot_of_win10-i3886

Please note there is no the bug problem for pc machine type.

Comment 14 Vadim Rozenfeld 2018-01-19 09:09:00 UTC
I can reproduce the problem on rhel7.4 ((qemu) info version 2.9.0 (v2.9.0-191-g1ef7054)) as well. The key point is to keep exactly the same architecture when switching between virtio and usb attached storage. For example, WS2012R2 VM installed with the following command line

sudo $QEMU -enable-kvm -machine q35 -device pcie-root-port,bus=pcie.0,id=root0,multifunction=on,chassis=1,addr=0xa.0 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=root0 -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/vrozenfe/work/images/$IMAGE -device scsi-hd,id=image1,drive=drive_image1,bootindex=1 -cpu Opteron_G4,+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -m 1G -smp 2 -cdrom /run/media/vrozenfe/elements/isos/en_windows_server_2012_r2_x64_dvd_2707946.iso -fda /home/share/builds/virtio-win-1.9.3-1.el7/usr/share/virtio-win/virtio-win_amd64.vfd -boot dc -monitor stdio

will crash into INACCESSIBLE_BOOT_DEVICE BSOD later when switching to usb disk

sudo $QEMU -enable-kvm -machine q35 -device pcie-root-port,bus=pcie.0,id=root0,multifunction=on,chassis=1,addr=0xa.0 -device nec-usb-xhci,id=usbtest,bus=root0 -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/home/vrozenfe/work/images/$IMAGE -device usb-storage,id=image1,drive=drive_image1,bus=usbtest.0,bootindex=1 -cpu Opteron_G4,+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time -m 1G -smp 2 -monitor stdio

but survives the same configuration with "-smp 3" instead of "-smp 2". And of course the VM can be booted successfully into "safe mode" 

Gu Nini, could you please repeat the same experiment on you setup to see that it is not a regression first of all?

Thanks,
Vadim.

Comment 15 Gu Nini 2018-01-23 09:23:07 UTC
(In reply to Vadim Rozenfeld from comment #14)
> I can reproduce the problem on rhel7.4 ((qemu) info version 2.9.0
> (v2.9.0-191-g1ef7054)) as well. The key point is to keep exactly the same
> architecture when switching between virtio and usb attached storage. For
> example, WS2012R2 VM installed with the following command line
> 


I could reproduce the bug on the original rhel7.4 qemu-kvm-rhev version this time, so the bug is not a regression, clear the keyword.

Thanks for the analysis.

Comment 17 Li Xiaohui 2018-07-09 11:43:02 UTC
Hi all,
recently I test one case RHEL7-8979 - [usb-device] [usb-storage] Usb device bootindex test, and reproduce this issue again in rhel-7.6

host info:
kernel-3.10.0-915.el7.x86_64 & qemu-img-rhev-2.12.0-7.el7.x86_64
guest info:
windows 2016 and scsi-image

Looking forward the bug fixed soon

Regards,
Li Xiaohui

Comment 18 Li Xiaohui 2018-09-19 02:33:08 UTC
Hi all:
I test case RHEL7-8979: [usb-device] [usb-storage] Usb device bootindex test, reproduce this bug in win2016 guest for rhel8 host, and guest machine type is pc


version info:
host info:
kernel-4.18.0-8.el8.x86_64 & qemu-img-2.12.0-31.el8+1812+3c9feb68.x86_64 &
virt-viewer-7.0-1.el8.x86_64
guest info:
kernel-4.18.0-8.el8.x86_64


steps:
1.install win2016 guest with virtio-blk
/usr/libexec/qemu-kvm -M pc \
-cpu SandyBridge \
-enable-kvm \
-m 2G \
-smp 4 \
-nodefaults \
-rtc base=localtime,clock=host,driftfix=slew \
--drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/mnt/win-image/win2016-64-virtio-win-prewhql-0.1-160-blk.qcow2 \
-device virtio-blk-pci,id=image1,drive=drive_image1,bus=pci.0,addr=0x4 \
-cdrom /root/work/qemu-sh/share/ISO/Win2016/en_windows_server_2016_x64_dvd_9718492.iso \
-drive file=virtio-win-prewhql.iso,if=none,media=cdrom,id=ide-cdrom0 \
-device ide-cd,drive=ide-cdrom0,id=cdrom0 \
-device virtio-net-pci,mac=24:be:05:0c:1e:2c,id=netdev1,vectors=4,netdev=net1,bootindex=3 -netdev tap,id=net1,vhost=on \
-qmp tcp:0:4444,server,nowait \
-vnc :4 \
-monitor stdio \
-vga qxl \
-boot menu=on \

2.boot guest with usb-storage:
/usr/libexec/qemu-kvm -M pc \
-cpu SandyBridge \
-enable-kvm \
-m 2G \
-smp 4 \
-nodefaults \
-rtc base=localtime,clock=host,driftfix=slew \
-device pvpanic,ioport=0x505,id=id7hNWlQ \
-drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=/mnt/win-image/win2012-64-virtio-win-prewhql-0.1-160-blk.qcow2 \
-device virtio-blk-pci,id=image1,drive=drive_image1,bus=pci.0,addr=0x4,bootindex=2 \
-device virtio-net-pci,mac=24:be:05:0c:1e:2c,id=netdev1,vectors=4,netdev=net1,bootindex=3 -netdev tap,id=net1,vhost=on \
-device nec-usb-xhci,id=controller \
-drive file=/mnt/win-image/win2016-64-virtio-win-prewhql-0.1-160-blk.qcow2,if=none,id=drive-virtio-0-1,media=disk,format=qcow2,cache=none \
-device usb-storage,drive=drive-virtio-0-1,id=virt0-0-1,bus=controller.0,bootindex=1 \
-qmp tcp:0:4444,server,nowait \
-vnc :4 \
-monitor stdio \
-vga qxl \
-boot menu=on \


Actual result:
boot win2016 guest with usb-storage failed, detailed failure please see below picture

Comment 19 Li Xiaohui 2018-09-19 02:34:23 UTC
Created attachment 1484549 [details]
boot win2016 guest failed on rhel8 host