Bug 1299116

Summary: qemu-img created VMDK images lead to "Not a supported disk format (sparse VMDK version too old)"
Product: Red Hat Enterprise Linux 7 Reporter: Robert Scheck <redhat-bugzilla>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED ERRATA QA Contact: Ping Li <pingl>
Severity: medium Docs Contact: Yehuda Zimmerman <yzimmerm>
Priority: unspecified    
Version: 7.2CC: chayang, huding, jherrman, juzhang, knoel, kwolf, pingl, ppostler, rbalakri, virt-maint, yzimmerm
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: https://github.com/qemu/qemu/commit/3efffc3292d94271a15b1606b4a56adf6c6f04ed
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-111.el7 Doc Type: Release Note
Doc Text:
VMDK images with streamOptimized sub-format are accepted Previously, a Virtual Machine Disk (VMDK) image with a streamOptimized sub-format created by the qemu-img tool was rejected by Elastic Sky X (ESX) services, because the version number of the VMDK image was too low. In this update, the sub-format number of streamOptimized VMDK images are automatically increased. This results in the VMDK image being accepted by ESX services.
Story Points: ---
Clone Of:
: 1299185 (view as bug list) Environment:
Last Closed: 2016-11-03 20:09:31 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:
Bug Depends On: 1299250    
Bug Blocks: 1203710, 1305606, 1313485    
Attachments:
Description Flags
qemu-img-bug.ovf
none
create ovf file none

Description Robert Scheck 2016-01-16 00:47:15 UTC
Created attachment 1115355 [details]
qemu-img-bug.ovf

Description of problem:
qemu-img only creates broken VMDK image files that can't be used for within
an OVA file for importing a virtual machine into VMware vSphere/ESXi. Every
VMDK file created by qemu-img leads during import to the error message:

  Not a supported disk format (sparse VMDK version too old)

Version-Release number of selected component (if applicable):
qemu-img-1.5.3-105.el7_2.1.x86_64
qemu-img-2.5.0-3.fc24.x86_64 (rebuilt from Fedora Rawhide for RHEL 7)
VMware vSphere Client, Version 5.1.0, Build 1064113
VMware ESXi, Version 5.1.0, Build 1065491, German-000

How reproducible:
Everytime, see above and below.

Steps to Reproduce:
1. cd /tmp/
2. dd if=/dev/zero of=qemu-img-bug.img bs=1M count=1
3. qemu-img convert qemu-img-bug.img -O vmdk \
     -o adapter_type=lsilogic,subformat=streamOptimized,compat6 \
     qemu-img-bug.vmdk
4. tar cf qemu-img-bug.ova qemu-img-bug.ovf qemu-img-bug.vmdk
5. Try to import qemu-img-bug.ova into VMware -> fails with error above
6. printf '\x03' | dd conv=notrunc of=qemu-img-bug.vmdk bs=1 seek=$((0x4))
7. tar cf qemu-img-bug.ova qemu-img-bug.ovf qemu-img-bug.vmdk
8. Try to import qemu-img-bug.ova into VMware -> works as expected now

Actual results:
qemu-img created VMDK images lead to "Not a supported disk format (sparse
VMDK version too old)".

Expected results:
qemu-img created VMDK images should not lead to any error message during
import into VMware.

Additional info:
Credit for printf/dd combination at point 6 goes to Radoslav Gerganov.

Comment 2 Robert Scheck 2016-01-18 00:25:21 UTC
Btw, point 6 isn't the ultimate solution, qemu-img created images are still
unusable with OVAs on VMware, see also bug #1299250 for details.

Comment 3 Ademar Reis 2016-01-19 17:01:25 UTC
Robert, thanks for taking the time to enter a bug report with us. We use reports like yours to keep improving the quality of our products and releases. That said, we're not able to guarantee the timeliness or suitability of a resolution for issues entered here because this is not a mechanism for requesting support.

If this issue is critical or in any way time sensitive, please raise a ticket through your regular Red Hat support channels to make certain it receives the proper attention and prioritization that will result in a timely resolution.

For information on how to contact the Red Hat production support team, please visit: https://www.redhat.com/support/process/production/#howto

Comment 4 Robert Scheck 2016-01-19 17:38:34 UTC
Ademar, thanks for the reminder.

Cross-filed case 01569297 on the Red Hat customer portal.

Comment 5 Fam Zheng 2016-01-20 04:29:36 UTC
We should revisit the upstream patch that is waiting for testing/reviewing/merging:

https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg04496.html

Comment 8 Robert Scheck 2016-02-15 11:00:50 UTC
Does this mean there is something to test? If so, may you share the testing
update with me (either here or via the ticket), please?

Comment 9 Fam Zheng 2016-02-15 13:22:25 UTC
Yes. Replied in bz 1299250.

Comment 10 Robert Scheck 2016-02-21 14:13:14 UTC
I would like to confirm that the updated RPM (qemu-img-1.5.3-108.el7.test)
works fine for me and passed all my tests regarding this issue.

Comment 11 Fam Zheng 2016-02-22 01:39:25 UTC
Thanks for your testing and confirmation, Robert!

Comment 12 Mike McCune 2016-03-28 22:35:49 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 13 Miroslav Rezanina 2016-05-05 06:38:08 UTC
Fix included in qemu-kvm-1.5.3-111.el7

Comment 15 Ping Li 2016-07-26 05:22:23 UTC
Created attachment 1184059 [details]
create ovf file

Reproduced the issue with qemu-kvm-1.5.3-110.el7.x86_64. 
After step5, get an error "Not a supported disk format(sparse VMDK version too old)". After step 8, qemu-img-bug.ova can be imported successfully.

Verified the issue with qemu-kvm-1.5.3-111.el7.x86_64.
After step5, qemu-img-bug.ova can be imported successfully.

Steps to reproduce:
1. #dd if=/dev/zero of=qemu-img-bug.img bs=1M count=1
2. #qemu-img convert qemu-img-bug.img -O vmdk -o adapter_type=lsilogic,subformat=streamOptimized,compat6 qemu-img-bug.vmdk
3. #sh create_ovf.sh
4. #tar cf qemu-img-bug.ova qemu-img-bug.ovf qemu-img-bug.vmdk
5. Import qemu-img-bug.ova into ESXi 5.1
6. printf '\x03' | dd conv=notrunc of=qemu-img-bug.vmdk bs=1 seek=$((0x4))
7. #tar cf qemu-img-bug.ova qemu-img-bug.ovf qemu-img-bug.vmdk
8. Import qemu-img-bug.ova into ESXi 5.1

Comment 19 errata-xmlrpc 2016-11-03 20:09:31 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.

https://rhn.redhat.com/errata/RHSA-2016-2585.html