Bug 825131

Summary: [virtio-win][viostor] Online shrink used data image size cause guest hang
Product: Red Hat Enterprise Linux 6 Reporter: Sibiao Luo <sluo>
Component: virtio-winAssignee: Vadim Rozenfeld <vrozenfe>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, bcao, bsarathy, chayang, dawu, dyasny, fyang, juzhang, mdeng, michen, rhod, vrozenfe, 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: 2012-07-17 14:15:01 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:

Description Sibiao Luo 2012-05-25 08:14:05 UTC
Description of problem:
After increase the data image size, online shrink the used data image size cause guest hang. If the QMEU couldn't support re-size for the image which has been made file system, we need to handle this issue more gracefully, the QMEU can give some warning prompts. But the guest hang is not unacceptable, so i five a bug for this issue.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-274.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64
guest info:
guest name: windows_7_sp1_x86
WHQL driver: virtio-win-1.5.1-1

How reproducible:
100%

Steps to Reproduce:
1.create a raw format disk.
# qemu-img create -f raw my_data_disk.raw 15G
2.start a guest with this data disk.
3.initalize and format this data disk in Disk Management dialog.
4.(qemu) block_resize data_drive 20G
5.reboot the guest to take step 4 effect.
6.initalize and format the new "Unallocated Partition".
7.(qemu) block_resize data_drive 16G
 
Actual results:
after the step 7, the guest hang and QMEU prompts some error,
(qemu) block I/O error in device 'data_drive': Input/output error (5)
handle_dev_stop: stop
(qemu) info status 
VM status: paused (io-error)

Expected results:
The guest not hang, and the QMEU should give some warning prompts.

Additional info:
CLI: # /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu SandyBridge -enable-kvm -smp 2 -m 2G -usb -device usb-tablet,id=input0 -name windows_7_sp1_x86 -uuid `uuidgen` -drive file=windows_7_sp1_x86.qcow2,if=none,id=hd,format=qcow2,aio=native,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=hd,id=blk_image,scsi=off,bootindex=1 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -spice disable-ticketing,port=5931 -balloon none -device sga -chardev socket,id=serial0,path=/var/sluo,server,nowait -device isa-serial,chardev=serial0 -monitor unix:/tmp/monitor2,server,nowait -monitor stdio -drive file=/usr/share/virtio-win/virtio-win-1.5.1.iso,if=none,id=drive-ide0-0-3,werror=stop,rerror=stop,cache=none,format=raw,media=cdrom,readonly=on -device ide-drive,drive=drive-ide0-0-3,id=ide0-0-3,bus=ide.1,unit=1 -drive file=/usr/share/virtio-win/virtio-win-1.5.1.vfd,if=none,id=f1,format=raw,cache=none -global isa-fdc.driveA=f1 -drive file=my_data_disk.raw,if=none,id=data_drive,format=raw,aio=native,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=data_drive,id=blk_data

Comment 1 Vadim Rozenfeld 2012-07-10 08:13:56 UTC
(In reply to comment #0)
> Description of problem:
> After increase the data image size, online shrink the used data image size
> cause guest hang. If the QMEU couldn't support re-size for the image which
> has been made file system, we need to handle this issue more gracefully, the
> QMEU can give some warning prompts. But the guest hang is not unacceptable,
> so i five a bug for this issue.
> 
> Version-Release number of selected component (if applicable):
> host info:
> # uname -r && rpm -q qemu-kvm-rhev
> 2.6.32-274.el6.x86_64
> qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64
> guest info:
> guest name: windows_7_sp1_x86
> WHQL driver: virtio-win-1.5.1-1
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1.create a raw format disk.
> # qemu-img create -f raw my_data_disk.raw 15G
> 2.start a guest with this data disk.
> 3.initalize and format this data disk in Disk Management dialog.
> 4.(qemu) block_resize data_drive 20G
> 5.reboot the guest to take step 4 effect.
> 6.initalize and format the new "Unallocated Partition".
> 7.(qemu) block_resize data_drive 16G
>  
> Actual results:
> after the step 7, the guest hang and QMEU prompts some error,
> (qemu) block I/O error in device 'data_drive': Input/output error (5)
> handle_dev_stop: stop
> (qemu) info status 
> VM status: paused (io-error)
> 
> Expected results:
> The guest not hang, and the QMEU should give some warning prompts.
> 
> Additional info:
> CLI: # /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu SandyBridge -enable-kvm -smp
> 2 -m 2G -usb -device usb-tablet,id=input0 -name windows_7_sp1_x86 -uuid
> `uuidgen` -drive
> file=windows_7_sp1_x86.qcow2,if=none,id=hd,format=qcow2,aio=native,
> cache=none,werror=stop,rerror=stop -device
> virtio-blk-pci,drive=hd,id=blk_image,scsi=off,bootindex=1 -netdev
> tap,script=/etc/qemu-ifup,id=netdev0 -device
> virtio-net-pci,netdev=netdev0,id=device-net0 -spice
> disable-ticketing,port=5931 -balloon none -device sga -chardev
> socket,id=serial0,path=/var/sluo,server,nowait -device
> isa-serial,chardev=serial0 -monitor unix:/tmp/monitor2,server,nowait
> -monitor stdio -drive
> file=/usr/share/virtio-win/virtio-win-1.5.1.iso,if=none,id=drive-ide0-0-3,
> werror=stop,rerror=stop,cache=none,format=raw,media=cdrom,readonly=on
> -device ide-drive,drive=drive-ide0-0-3,id=ide0-0-3,bus=ide.1,unit=1 -drive
> file=/usr/share/virtio-win/virtio-win-1.5.1.vfd,if=none,id=f1,format=raw,
> cache=none -global isa-fdc.driveA=f1 -drive
> file=my_data_disk.raw,if=none,id=data_drive,format=raw,aio=native,cache=none,
> werror=stop,rerror=stop -device virtio-blk-pci,drive=data_drive,id=blk_data

we cannot shrink drive without shrinking volume first.
please try resizing volume between steps 6 and 7.

Comment 2 Ronen Hod 2012-07-17 09:40:39 UTC
Please do the following:
1. Shrink the partition and volume in Windows, and check that everything works
2. block_resize in qemu (but not bellow the volume size)
This is probably the same issue with bug 825144

Comment 3 Sibiao Luo 2012-07-17 10:39:53 UTC
(In reply to comment #1)
> (In reply to comment #0)
> we cannot shrink drive without shrinking volume first.
> please try resizing volume between steps 6 and 7.
(In reply to comment #2)
> Please do the following:
> 1. Shrink the partition and volume in Windows, and check that everything
> works
> 2. block_resize in qemu (but not bellow the volume size)
> This is probably the same issue with bug 825144

Hi Vadim and Ronen,

   Just as you said, I add one step re-sizing volume in Windows guest between steps 6 and 7, and check that everything works well, then block_resize in QEMU (but not bellow the volume size), it has no problem, the data image size can be online shrunk correctly. 

   Thanks for your kindly reminds.

Best wishes.
sluo

Comment 4 Vadim Rozenfeld 2012-07-18 08:10:58 UTC
Thank you, sluo.

I think that the above sequence is not so obvious and 
should be properly documented.

Cheers,
Vadim.