Bug 825144 - [virtio-win][viostor] fail to shrink the used data image size as we expected
[virtio-win][viostor] fail to shrink the used data image size as we expected
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virtio-win (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Vadim Rozenfeld
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-25 04:41 EDT by Sibiao Luo
Modified: 2012-07-17 10:14 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-17 10:14:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
after the step 5, we can see the data image size was still 15G via "Disk Management" dialog. (200.14 KB, image/png)
2012-05-25 04:46 EDT, Sibiao Luo
no flags Details

  None (edit)
Description Sibiao Luo 2012-05-25 04:41:46 EDT
Description of problem:
attach a data image to the guest, and initalize and format this data disk in "Disk Management" dialog. and then, shrink the data image size, reboot the guest to find that fail to shrink the data image size as we expected. I will attach the screenshot of the windows guest info later.

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 image and check the size info.
# qemu-img create -f raw my_data_disk.raw 15G
Formatting 'my_data_disk.raw', fmt=raw size=16106127360
# qemu-img info my_data_disk.raw
image: my_data_disk.raw
file format: raw
virtual size: 15G (16106127360 bytes)
disk size: 0
2.start a windows guest with this data image.
3.initalize and format this data image in Disk Management dialog.
4.(qemu) block_resize data_drive 10G
5.reboot the guest and check the data image size.
6.check the iamge size info via qemu-img.

Actual results:
after the step 5, we can see the data image size was still 15G via "Disk Management" dialog.
but after the step 6, the image size wa shrink to 10G
# qemu-img info my_data_disk.raw
image: my_data_disk.raw
file format: raw
virtual size: 10G (10737418240 bytes)
disk size: 86M

Expected results:
the data image size was shrink to 10G correctly.

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 Sibiao Luo 2012-05-25 04:46:42 EDT
Created attachment 586803 [details]
after the step 5, we can see the data image size was still 15G via "Disk Management" dialog.
Comment 2 Vadim Rozenfeld 2012-05-31 17:29:31 EDT
What happens if you shrink the corresponding volume with Disk Management dialog tools, between steps 3 and 4?
Comment 3 Sibiao Luo 2012-05-31 21:59:31 EDT
(In reply to comment #2)
> What happens if you shrink the corresponding volume with Disk Management
> dialog tools, between steps 3 and 4?

Hi Vadim,

   If i shrink the corresponding volum with the Disk Managerment dialog tools, shrink the data_disk to 0 and restart the guest to take effect for example, QEMU prompts some error, and the guest hang at "Shutting down...".

(qemu) block_resize data_drive 0G
(qemu) block I/O error in device 'data_drive': Input/output error (5)

(qemu) info status 
VM status: paused (io-error)
Comment 4 Sibiao Luo 2012-05-31 22:05:00 EDT
(In reply to comment #3)
> (In reply to comment #2)

> Hi Vadim,
> 
>    If i shrink the corresponding volum with the Disk Managerment dialog
> tools, shrink the data_disk to 0 and restart the guest to take effect for
> example, QEMU prompts some error, and the guest hang at "Shutting down...".
> 
> (qemu) block_resize data_drive 0G
> (qemu) block I/O error in device 'data_drive': Input/output error (5)
> 
> (qemu) info status 
> VM status: paused (io-error)

and fail to resume it via monitor.
(qemu) cont
(qemu) block I/O error in device 'data_drive': Input/output error (5)

(qemu) info status 
VM status: paused (io-error)
Comment 5 Ronen Hod 2012-07-17 05:41:43 EDT
Probably the same issue as https://bugzilla.redhat.com/show_bug.cgi?id=825131#c2
Comment 6 Sibiao Luo 2012-07-17 06:41:57 EDT
(In reply to comment #2)
> 
(In reply to comment #5)
> Probably the same issue as
> https://bugzilla.redhat.com/show_bug.cgi?id=825131#c2

Hi Vadim and Ronen,

   Just as you said, I add one step re-sizing volume in Windows guest between steps 3 and 4, 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

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