Import Disk VMDK-qcow2 Unsupported image type 'onolithicFlat

inno-forum

Active Member
Oct 28, 2021
69
3
28
32
I am trying to import a disk VMDK.

qm importdisk 164 Disk4.vmdk NAS2 --format qcow2

but I get this error

qemu-img: Could not open 'Disk4.vmdk': Unsupported image type 'onolithicFlat

How can I solve it?
 
For anyone who reached here via Google:

This "onolithicFlat" type is actually a very minor parsing issue. You just have to open the small VMDK file (not the -flat.vmdk) and put double quotes aroud the "monolithicFlat".
 
  • Like
Reactions: garnoux
Just ran into this issue. The solution is from 2015. This "very minor parsing issue" hasn't been fixed in a whole decade. Wow. Just wow.
 
I guess you mean you're amazed that whatever is writing these broken VMDK files isn't fixed.

If a field is supposed to be quoted, and isn't, that's not a problem with the parser, it is a problem with the writer. The only complaint you should have with the parser is that it didn't give a good error message.
 
The parser of qemu-img actually skips several checks. It doesn't check for "# Disk DescriptorFile", it just skips over the first line with "#". It doesn't care what characters comes exactly after createType, CID, parentCID etc. it just assumes it's a =. It completely ignores "encoding" which could result in mishandling a completey correct file. There could be a lot more. This is just what I got at a glance.

The VMDK specifications I could find lack RFC level clarity. The slightly better documentations that can also be found are apparently written retroactively based on the code in QEMU. So I can see why someone would assume the quotes to be optional. It could be a simple mistake in the generating code though, like forgetting to escape the quotes so that they are actually emitted.

Example in shell code:
echo "some text" -> result: some text
echo '"some text"' -> result: "some text


I've opened a case with Veeam which creates such files. I can only image that VMWare handles the lack of the quotes gracefully. Either hat or nobody is using that. I've also submitted a patch to the QEMU developers, so that the value for createType is also accepted without quotes around it.