Bug 852348 - fail to block_resize local data disk with IDE/AHCI disk_interface
fail to block_resize local data disk with IDE/AHCI disk_interface
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.0
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: John Snow
Virtualization Bugs
:
: 918831 (view as bug list)
Depends On: 852257
Blocks: 918831
  Show dependency treegraph
 
Reported: 2012-08-28 05:02 EDT by Paolo Bonzini
Modified: 2015-03-05 04:41 EST (History)
15 users (show)

See Also:
Fixed In Version: qemu-kvm-rhev-2.1.2-2.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 852257
: 918831 (view as bug list)
Environment:
Last Closed: 2015-03-05 04:41:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Comment 1 Sibiao Luo 2013-03-08 05:12:16 EST
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 14:37:03 EST
*** Bug 918831 has been marked as a duplicate of this bug. ***
Comment 4 John Snow 2014-08-01 15:37:21 EDT
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 14:06:45 EDT
fix is posted upstream, will backport pending review.
Comment 6 Miroslav Rezanina 2014-09-18 11:31:29 EDT
Fix included in qemu-kvm-1.5.3-71.el7
Comment 7 Miroslav Rezanina 2014-09-24 09:27:45 EDT
Revert to post as patch built in incorrect package.
Comment 10 Miroslav Rezanina 2014-10-10 03:34:04 EDT
Fix included in qemu-kvm-rhev-2.1.2-2.el7
Comment 12 mazhang 2014-10-28 03:10:41 EDT
Reproduce this bug on qemu-kvm-rhev-2.1.0-1.el7.

Result:
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.

Host:
qemu-kvm-rhev-2.1.2-5.el7.x86_64
qemu-img-rhev-2.1.2-5.el7.x86_64
qemu-kvm-common-rhev-2.1.2-5.el7.x86_64
qemu-kvm-rhev-debuginfo-2.1.2-5.el7.x86_64
qemu-kvm-tools-rhev-2.1.2-5.el7.x86_64
kernel-3.10.0-191.el7.x86_64

Guest:
kernel-3.10.0-189.el7.x86_64

Result:
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 03:23:54 EDT
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://10.66.106.25/gv0/rhel7-64.qcow2,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 03:27:37 EDT
Base on comment#12 and comment#13, this bug has been fixed.
Comment 17 errata-xmlrpc 2015-03-05 04:41:47 EST
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.

https://rhn.redhat.com/errata/RHSA-2015-0624.html

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