Bug 852348 - fail to block_resize local data disk with IDE/AHCI disk_interface
Summary: fail to block_resize local data disk with IDE/AHCI disk_interface
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.0
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: John Snow
QA Contact: Virtualization Bugs
: 918831 (view as bug list)
Depends On: 852257
Blocks: 918831
TreeView+ depends on / blocked
Reported: 2012-08-28 09:02 UTC by Paolo Bonzini
Modified: 2015-03-05 09:41 UTC (History)
15 users (show)

Fixed In Version: qemu-kvm-rhev-2.1.2-2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 852257
: 918831 (view as bug list)
Last Closed: 2015-03-05 09:41:47 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0624 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2015-03-05 14:37:36 UTC

Comment 1 Sibiao Luo 2013-03-08 10:12:16 UTC
after this bug fixed, QE need to verify both the IDE and AHCI, both bug 918831 and bug 852348.

Comment 2 Ademar Reis 2013-11-05 19:37:03 UTC
*** Bug 918831 has been marked as a duplicate of this bug. ***

Comment 4 John Snow 2014-08-01 19:37:21 UTC
I've patched this as far as the size will be updated on a soft reboot, but currently despite the rescan command (and observing that new, updated IDENTIFY information was resent to the guest OS) fdisk -l does not recognize the new updated size.

#1 - echo 1 > /sys/block/sda/device/rescan does not trigger a new IDENTIFY packet to be requested.
#2 - partprobe, however, does.
#3 - after running both, in either order, Linux refuses to observe a change in size until a soft reboot.

Guest is Linux 3.11.10-301.fc20.x86_64

I can actually get fdisk to see the new values if I do this:
# echo "- - -" > /sys/class/scsi_host/host5/scan
but that has the unsavory effect of re-materializing the drive as /dev/sdb instead of /dev/sda, which gums up the works pretty badly.

Comment 5 John Snow 2014-08-19 18:06:45 UTC
fix is posted upstream, will backport pending review.

Comment 6 Miroslav Rezanina 2014-09-18 15:31:29 UTC
Fix included in qemu-kvm-1.5.3-71.el7

Comment 7 Miroslav Rezanina 2014-09-24 13:27:45 UTC
Revert to post as patch built in incorrect package.

Comment 10 Miroslav Rezanina 2014-10-10 07:34:04 UTC
Fix included in qemu-kvm-rhev-2.1.2-2.el7

Comment 12 mazhang 2014-10-28 07:10:41 UTC
Reproduce this bug on qemu-kvm-rhev-2.1.0-1.el7.

After block resize, then rescan scsi host/reboot guest the size of ide disk didn't change.

Test this bug on qemu-kvm-rhev-2.1.2-5.el7.x86_64.



1. Boot vm with ide disk.
-drive file=/home/storage0.raw,format=raw,if=none,id=ide-disk,cache=none,werror=stop,rerror=stop,aio=native \
-device ide-drive,bus=ide.0,unit=0,drive=ide-disk,id=ide_data \

2. block_resize.
(qemu) block_resize ide-disk 20G

3. Check the size of disk image.
[root@dhcp-11-16 home]# qemu-img info storage0.raw 
image: storage0.raw
file format: raw
virtual size: 20G (21474836480 bytes)
disk size: 454M

4. Rescan scsi host inside guest.
# echo "- - -" > /sys/class/scsi_host/host0/scan

5. Check the size in guest by "fdisk -l"
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Also tested qcow2 format.
For raw format, both shrink and enlarge works well.
For qcow2 format, enlarge works well.

Comment 13 mazhang 2014-10-28 07:23:54 UTC
Also test ahci interface on qemu-kvm-rhev-2.1.2-5.el7.x86_64.

Command line:
/usr/libexec/qemu-kvm \
-M q35 \
-cpu SandyBridge \
-m 2G \
-smp 4,maxcpus=160,cores=2,threads=1,sockets=2 \
-enable-kvm \
-name rhel7 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-rtc base=localtime,clock=host,driftfix=slew \
-nodefaults \
-monitor stdio \
-qmp tcp:0:5555,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-monitor unix:/tmp/monitor2,server,nowait \
-vga qxl \
-spice port=5900,disable-ticketing \
-usb \
-device usb-tablet,id=tablet0 \
-drive file=gluster://,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,bus=pcie.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-drive file=/home/storage0.qcow2,format=qcow2,if=none,id=ide-disk,cache=none,werror=stop,rerror=stop,aio=native \
-device ide-drive,bus=ide.0,unit=0,drive=ide-disk,id=ide_data \

For raw format, both shrink and enlarge works well.
For qcow2 format, enlarge works well.

Comment 14 mazhang 2014-10-28 07:27:37 UTC
Base on comment#12 and comment#13, this bug has been fixed.

Comment 17 errata-xmlrpc 2015-03-05 09:41:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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