Bug 1006159 - [RFE] qemu-img: Add/improve support for VHD/VHDX format
[RFE] qemu-img: Add/improve support for VHD/VHDX format
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
All All
unspecified Severity low
: rc
: ---
Assigned To: Jeff Cody
Virtualization Bugs
: FutureFeature
Depends On: 879234 1007176 1008755
Blocks: 961854 977441 1063559 1088700 1090866 1090867
  Show dependency treegraph
Reported: 2013-09-10 02:51 EDT by Sibiao Luo
Modified: 2016-04-26 09:29 EDT (History)
18 users (show)

See Also:
Fixed In Version: qemu-kvm-
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 879234
: 1088700 1090866 1090867 (view as bug list)
Last Closed: 2014-10-14 02:50:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 1 Sibiao Luo 2013-09-10 02:55:16 EDT
Qemu-img should support image creation/convertion for VHD(X) image format in RHEL6.5, for v2v. Once this issue is fixed, then we will be able to use the qemu-img to create VHDX images.
Comment 9 Miroslav Rezanina 2014-07-25 03:51:00 EDT
Fixes already in build, patch not properly updated.
Comment 11 Sibiao Luo 2014-07-28 02:17:32 EDT
Verified this issue with qemu-kvm-rhev-

host info:
# uname -r && rpm -q qemu-kvm-rhev

#### scenarios 1.
Use qemu-img to create and read the vpc/vhdx image correctly, and then attach it in KVM as a second disk specified readonly=on.

1.Use qemu-img to create and read the vpc/vhdx image.
# qemu-img create -f vpc my-data-disk.vpc 10G
Formatting 'my-data-disk.vpc', fmt=vpc size=10737418240 
# qemu-img info my-data-disk.vpc
image: my-data-disk.vpc
file format: vpc
virtual size: 10G (10737893376 bytes)
disk size: 24K
cluster_size: 2097152
# qemu-img create -f vhdx my-data-disk.vhdx 10G
Formatting 'my-data-disk.vhdx', fmt=vhdx size=10737418240 log_size=1048576 block_size=0 block_state_zero=off 
# qemu-img info my-data-disk.vhdx
image: my-data-disk.vhdx
file format: vhdx
virtual size: 10G (10737418240 bytes)
disk size: 272K
cluster_size: 16777216
2.using QEMU, launch a guest with the VHDX data disk as a secondary disk.
e.g:...-drive file=/home/my-data-disk.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop,readonly=on -device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-disk

after step 1, use qemu-img to create and read the vpc/vhdx image successfully.
after step 2, using QEMU to launch a guest with the VHDX data disk as a secondary disk(readonly) successfully.

#### scenarios 2.
Use Hyper-V to install OS and generate an image(clean dynamic & fixed image files), then convert it to qcow2/raw format via qemu-img and boot it in KVM environment.

1.Use Hyper-V to install OS and generate an image(clean dynamic & fixed image files).
2.convert it to qcow2/raw format via qemu-img.
# qemu-img convert -p -f vhdx RHEL-7.0.z-Server-x86_64.vhdx -O qcow2 RHEL-7.0.z-Server-x86_64.qcow2
3.boot it in KVM with simulate driver.
e.g:# /usr/libexec/qemu-kvm -M pc -cpu Opteron_G2 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/RHEL-7.0.z-Server-x86_64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native -device ide-drive,drive=drive-system-disk,id=system-disk,bus=ide.0,unit=0 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio
4.reboot/shutdown/poweroff guest. 

after step 2, it convert successfully.
after step 3, boot up in KVM successfully.
after step 4, reboot/shutdown/poweroff VM successfully.

Base on above, this issue has been fixed correctly, move to VERIFIED status, please correct me if any mistake.

Best Regards,
Comment 12 errata-xmlrpc 2014-10-14 02:50:48 EDT
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.