Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1057965

Summary: win2008r2 guest cannot boot up normal when boot multi vms using same image
Product: Red Hat Enterprise Linux 7 Reporter: ShupingCui <scui>
Component: qemu-kvmAssignee: Ronen Hod <rhod>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, famz, juli, juzhang, knoel, michen, rhod, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-28 13:10:39 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:
Attachments:
Description Flags
chkdsk_snapshot1
none
chkdsk_snapshot2
none
chkdsk_log none

Description ShupingCui 2014-01-26 08:26:23 UTC
Description of problem:
win2008r2 guest cannot boot up normal when boot multi vms with "...,snapshot=off", and guest enter chkdsk step, but when boot up vms with "... -drive id=drive_image1,if=none,cache=none,snapshot=on,aio=native,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/win2008r2-64-virtio.qcow2", no error and works well.

Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-41.el7.x86_64
kernel-3.10.0-78.el7.x86_64
virtio-win-prewhql-0.1-74

How reproducible:
100%

Steps to Reproduce:
1. boot multi(=5) win2008r2 vms using '-snapshot' with same image
vm1:
/usr/libexec/qemu-kvm \
    -name 'vm1'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga std  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140126-142507-2pbyMP6G,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140126-142507-2pbyMP6G,path=/tmp/seabios-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140126-142507-2pbyMP6G,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/win2008r2-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device virtio-net-pci,mac=9a:66:67:68:69:6a,id=idhi5lc3,netdev=idFytmyo,bus=pci.0,addr=05  \
    -netdev tap,id=idFytmyo,vhost=on \
    -m 2048  \
    -smp 2,maxcpus=2,cores=1,threads=1,sockets=2  \
    -cpu 'Penryn',+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/isos/windows/winutils.iso \
    -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,bus=ide.0,unit=0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -snapshot \
    -enable-kvm \
    -monitor stdio

vm2:
/usr/libexec/qemu-kvm \
    -name 'vm2'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga std  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140126-142507-2pbyMP6G,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140126-142507-2pbyMP6G,path=/tmp/seabios-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140126-142507-2pbyMP6G,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/win2008r2-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device virtio-net-pci,mac=9a:66:67:68:69:6a,id=idhi5lc3,netdev=idFytmyo,bus=pci.0,addr=05  \
    -netdev tap,id=idFytmyo,vhost=on \
    -m 2048  \
    -smp 2,maxcpus=2,cores=1,threads=1,sockets=2  \
    -cpu 'Penryn',+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/isos/windows/winutils.iso \
    -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,bus=ide.0,unit=0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :1  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -snapshot \
    -enable-kvm \
    -monitor stdio

vm3:
/usr/libexec/qemu-kvm \
    -name 'vm3'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga std  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140126-142507-2pbyMP6G,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140126-142507-2pbyMP6G,path=/tmp/seabios-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140126-142507-2pbyMP6G,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/win2008r2-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device virtio-net-pci,mac=9a:66:67:68:69:6a,id=idhi5lc3,netdev=idFytmyo,bus=pci.0,addr=05  \
    -netdev tap,id=idFytmyo,vhost=on \
    -m 2048  \
    -smp 2,maxcpus=2,cores=1,threads=1,sockets=2  \
    -cpu 'Penryn',+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/isos/windows/winutils.iso \
    -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,bus=ide.0,unit=0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :2  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -snapshot \
    -enable-kvm \
    -monitor stdio

vm4:
/usr/libexec/qemu-kvm \
    -name 'vm4'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga std  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140126-142507-2pbyMP6G,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140126-142507-2pbyMP6G,path=/tmp/seabios-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140126-142507-2pbyMP6G,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/win2008r2-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device virtio-net-pci,mac=9a:66:67:68:69:6a,id=idhi5lc3,netdev=idFytmyo,bus=pci.0,addr=05  \
    -netdev tap,id=idFytmyo,vhost=on \
    -m 2048  \
    -smp 2,maxcpus=2,cores=1,threads=1,sockets=2  \
    -cpu 'Penryn',+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/isos/windows/winutils.iso \
    -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,bus=ide.0,unit=0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :3  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -snapshot \
    -enable-kvm \
    -monitor stdio

vm5:
/usr/libexec/qemu-kvm \
    -name 'vm5'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga std  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140126-142507-2pbyMP6G,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140126-142507-2pbyMP6G,path=/tmp/seabios-20140126-142507-2pbyMP6G,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140126-142507-2pbyMP6G,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/win2008r2-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device virtio-net-pci,mac=9a:66:67:68:69:6a,id=idhi5lc3,netdev=idFytmyo,bus=pci.0,addr=05  \
    -netdev tap,id=idFytmyo,vhost=on \
    -m 2048  \
    -smp 2,maxcpus=2,cores=1,threads=1,sockets=2  \
    -cpu 'Penryn',+kvm_pv_unhalt,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic \
    -drive id=drive_cd1,if=none,snapshot=off,aio=native,media=cdrom,file=/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/isos/windows/winutils.iso \
    -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,bus=ide.0,unit=0 \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :4  \
    -rtc base=localtime,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -snapshot \
    -enable-kvm \
    -monitor stdio
2.
3.

Actual results:
vm3 enter chkdsk step and cannot boot up normal.

Expected results:
the guests should be boot up successfully without error

Additional info:
host infos:
[root@intel-3323-24-2 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         23852        704      23147         16          1        375
-/+ buffers/cache:        328      23524
Swap:        12103         50      12053

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Xeon(R) CPU           X3323  @ 2.50GHz
stepping	: 10
microcode	: 0xa0b
cpu MHz		: 2500.000
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 3
initial apicid	: 3
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 dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 xsave lahf_lm dtherm tpr_shadow vnmi flexpriority
bogomips	: 4999.87
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

Comment 1 ShupingCui 2014-01-26 08:27:16 UTC
Created attachment 855635 [details]
chkdsk_snapshot1

Comment 2 ShupingCui 2014-01-26 08:27:34 UTC
Created attachment 855636 [details]
chkdsk_snapshot2

Comment 3 ShupingCui 2014-01-26 08:28:31 UTC
Created attachment 855637 [details]
chkdsk_log

get the chkdsk_log via eventvwr.msc

Comment 5 Ronen Hod 2014-01-28 13:10:39 UTC
Well, this is the expected behavior. Sharing an image without "snapshot=on" should not work.
Closing this bug.

Comment 6 ShupingCui 2014-02-24 08:26:24 UTC
Hi Ronen,

I have a question, i boot the vms with "-snapshot" option and i found the man doc about snapshot is:
=====
           snapshot=snapshot
               snapshot is "on" or "off" and allows to enable snapshot for given drive (see -snapshot).
=====

so i think it's a real qemu-kvm bug, pls fix me if I am wrong.


Best Regards,
Shuping

Comment 7 Fam Zheng 2014-02-25 06:39:34 UTC
Looking at the code, "-snapshot" only provides a "default" value, but does not override explicit ",snapshot=on/off" provided in "-drive" options.

See vl.c:4136:

qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot, NULL, 0);


and vl.c:1079:

static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
{
    if (NULL == qemu_opt_get(opts, "snapshot")) {
        qemu_opt_set(opts, "snapshot", "on");
    }
    return 0;
}