Bug 1257910

Summary: based image can not bootup after disk image commit
Product: Red Hat Enterprise Linux 7 Reporter: Xueqiang Wei <xuwei>
Component: qemu-kvmAssignee: Jeff Cody <jcody>
Status: CLOSED WORKSFORME QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: huding, juzhang, knoel, pezhang, rbalakri, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1260494 (view as bug list) Environment:
Last Closed: 2016-02-15 02:08:23 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: 1260494    
Attachments:
Description Flags
screenshot-1
none
screenshot-2 none

Description Xueqiang Wei 2015-08-28 11:35:29 UTC
Description of problem:

based image can not bootup after disk image commit. 

Hit this issue by autotest script. I tried 10 times manually, not hit this issue.

if drive format is virtio-scsi, can reproduce this issue by autotest script. And if drive format is virtio-blk, not hit this issue.

I downgrade to qemu-kvm-1.5.3-100.el7 to try 30 times, both virtio-scsi and virtio-blk not hit this issue. 


autotest script commandline and parameters:
python ConfigTest.py --testcase=qemu_disk_img.commit --imageformat=qcow2 --driveformat=virtio_scsi --nicmodel=virtio_net --clone=no --guestname=RHEL.7.2 --post_check=no --verbose=yes --nrepeat=10

host: RHEL7.2
guest: RHEL7.2
image format: qocw2
drive format: virtio_scsi
nic model: virtio_net
display: spice


Version-Release number of selected component (if applicable):
kernel-3.10.0-306.el7.x86_64
qemu-kvm-1.5.3-101.el7


How reproducible:
2/10


Steps to Reproduce:

1. create snapshot image --> Create image by command: /bin/qemu-img create -f qcow2 -b /home/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.2-64-virtio-scsi.qcow2 -F qcow2 /home/autotest-devel/client/tests/virt/shared/data/images/sn1.qcow2 20G
2. start vm with snapshot
 /usr/libexec/qemu-kvm \
    -S  \
    -name 'virt-tests-vm1'  \
    -sandbox off  \
    -machine pc  \
    -nodefaults  \
    -vga cirrus  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20150826-025843-IumUfPKH,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=qmp_id_catch_monitor,path=/tmp/monitor-catch_monitor-20150826-025843-IumUfPKH,server,nowait \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idYv6WkU  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20150826-025843-IumUfPKH,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20150826-025843-IumUfPKH,path=/tmp/seabios-20150826-025843-IumUfPKH,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20150826-025843-IumUfPKH,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=04 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/home/autotest-devel/client/tests/virt/shared/data/images/sn1.qcow2 \
    -device scsi-hd,id=image1,drive=drive_image1 \
    -device virtio-net-pci,mac=9a:87:88:89:8a:8b,id=idKdQLao,vectors=4,netdev=id7YFBic,bus=pci.0,addr=05  \
    -netdev tap,id=id7YFBic,vhost=on,vhostfd=25,fd=21  \
    -m 16384  \
    -smp 16,maxcpus=16,cores=8,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm
3. connect the snapshot and verify it works well
 {"execute":"qmp_capabilities"}
 {"execute":"cont"}
 {"execute":"query-cpus"}
4. create file and copy to guest
 # dd if=/dev/urandom of=/var/tmp/test.img bs=4k count=250
 # scp test.img root@$guest-ip:/var/tmp/
 save file('/var/tmp/test.img') md5sum in guest
5. Shutdown the guest
6. commit snapshot to backingfile
 /bin/qemu-img commit -f qcow2 /home/autotest-devel/client/tests/virt/shared/data/images/sn1.qcow2 
7. start vm with based image
 /usr/libexec/qemu-kvm \
    -S  \
    -name 'virt-tests-vm1'  \
    -sandbox off  \
    -machine pc  \
    -nodefaults  \
    -vga cirrus  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20150826-025922-GXnWAwqO,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=qmp_id_catch_monitor,path=/tmp/monitor-catch_monitor-20150826-025922-GXnWAwqO,server,nowait \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idezGJ2O  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20150826-025922-GXnWAwqO,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20150826-025922-GXnWAwqO,path=/tmp/seabios-20150826-025922-GXnWAwqO,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20150826-025922-GXnWAwqO,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=04 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/home/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.2-64-virtio-scsi.qcow2 \
    -device scsi-hd,id=image1,drive=drive_image1 \
    -device virtio-net-pci,mac=9a:8c:8d:8e:8f:90,id=idgudKRB,vectors=4,netdev=idlVoj8v,bus=pci.0,addr=05  \
    -netdev tap,id=idlVoj8v,vhost=on,vhostfd=29,fd=23  \
    -m 16384  \
    -smp 16,maxcpus=16,cores=8,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off,strict=off \
    -enable-kvm 


Actual results:
after step 7, the based guest can not bootup

Expected results:
the based guest bootup, the file "test.img" is in folder "/var/tmp" and the md5sum is not changed.   


Additional info:

the based image bootup normally before snapshot and no force quit during the test.

Comment 2 Xueqiang Wei 2015-08-28 11:38:29 UTC
Created attachment 1067957 [details]
screenshot-1

Comment 3 Xueqiang Wei 2015-08-28 11:38:59 UTC
Created attachment 1067958 [details]
screenshot-2

Comment 5 Xueqiang Wei 2016-01-07 05:34:45 UTC
repeat 150 times by autotest script, not hit this issue.

tested version:
kernel-3.10.0-327.2.1.el7.x86_64
qemu-kvm-1.5.3-105.el7_2.1

Comment 6 Jeff Cody 2016-02-15 02:08:23 UTC
Since this bug cannot be reproduced anymore per comment #5, closing it as WORKSFORME.