Bug 1028990

Summary: QEMU could not handle VMDK description file
Product: Red Hat Enterprise Linux 6 Reporter: Fam Zheng <famz>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: acathrow, bsarathy, chayang, famz, juzhang, michen, mkenneth, qzhang, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.415.el6_5.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-28 05:49:57 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 Fam Zheng 2013-11-11 12:33:37 UTC
Create a monolithicFlat VMDK image and use "qemu-img info" to check it, it doesn't detect the correct info:

$ ./qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 1GFormatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=off subformat='monolithicFlat' zeroed_grain=off
$ ./qemu-img info /tmp/a.vmdk
image: /tmp/a.vmdk
file format: raw   <--------- This is wrong format detection
virtual size: 0 (0 bytes)
disk size: 4.0K


The cause is the QEMU block layer can't read unaligned bytes in the end of image. (modulo 512 bytes).

Comment 2 Sibiao Luo 2013-11-12 02:22:12 UTC
Tried with qemu-kvm-0.12.1.2-2.415.el6.x86_64, but did not meet such issue.
fam, did you use the upstream qemu version ?

host info:
# uname -r && rpm -q qemu-kvm
2.6.32-425.el6.x86_64
qemu-kvm-0.12.1.2-2.415.el6.x86_64

# qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 1G
Formatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=off subformat='monolithicFlat' zeroed_grain=off 
# qemu-img info /tmp/a.vmdk 
image: /tmp/a.vmdk
file format: vmdk
virtual size: 1.0G (1073741824 bytes)
disk size: 4.0K

Best Regards,
sluo

Comment 3 Sibiao Luo 2013-11-12 02:47:24 UTC
Also tried the qemu-kvm-0.12.1.2-2.415.el6_5.1.x86_64 and qemu-kvm-0.12.1.2-2.415.el6_5.2.x86_64 version that all of them are OK.

Comment 4 Sibiao Luo 2013-11-12 02:51:41 UTC
(In reply to Sibiao Luo from comment #3)
> Also tried the qemu-kvm-0.12.1.2-2.415.el6_5.1.x86_64 and
> qemu-kvm-0.12.1.2-2.415.el6_5.2.x86_64 version that all of them are OK.
Retried it again, this issue is on qemu-kvm-0.12.1.2-2.415.el6_5.1.x86_64 and we fixed it on qemu-kvm-0.12.1.2-2.415.el6_5.2.x86_64.

# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.415.el6_5.1.x86_64
# qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 1G
Formatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=off subformat='monolithicFlat' zeroed_grain=off 
# qemu-img info /tmp/a.vmdk
image: /tmp/a.vmdk
file format: raw
virtual size: 0 (0 bytes)
disk size: 4.0K

# rpm -Uvh qemu-kvm-0.12.1.2-2.415.el6_5.2/*
Preparing...                ########################################### [100%]
   1:qemu-img               ########################################### [ 20%]
   2:qemu-kvm               ########################################### [ 40%]
   3:qemu-kvm-tools         ########################################### [ 60%]
   4:qemu-kvm-debuginfo     ########################################### [ 80%]
   5:qemu-guest-agent       ########################################### [100%]
# qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 1G
Formatting '/tmp/a.vmdk', fmt=vmdk size=1073741824 compat6=off subformat='monolithicFlat' zeroed_grain=off 
# qemu-img info /tmp/a.vmdk
image: /tmp/a.vmdk
file format: vmdk
virtual size: 1.0G (1073741824 bytes)
disk size: 4.0K

Base on above, mark qa_ack+ to it.

Best regards,
sluo