Skip to contentSkip to conversation

vmdk stream-optimised format

Qemu-devel Alex Bligh 4 participants 11 messages Aug 19, 2013 – Aug 20, 2013

lore
Share & tools
lore

Alex Bligh

author
#0 lore raw

I note some recent work on vmdk file support. Has anyone looked at supporting vmdk streaming format as an /output/ file format (I think we currently support it as an input format). This is what you need to use to upload a VM to vCenter. Currently the route is convert to raw then use:

https://github.com/imcleod/VMDK-stream-converter

which is some Python from Ian McLeod <[email protected]> Life would be easier if qemu-img supported this directly. It does not look fantastically difficult.

Signature · 1 line
Alex Bligh
#1 lore raw
Quoted 6 lines · Alex Bligh

I note some recent work on vmdk file support. Has anyone looked at supporting vmdk streaming format as an /output/ file format (I think we currently support it as an input format). This is what you need to use to upload a VM to vCenter. Currently the route is convert to raw then use:

Quoted 9 lines

https://github.com/imcleod/VMDK-stream-converter

which is some Python from Ian McLeod <[email protected]> Life would be easier if qemu-img supported this directly. It does not look fantastically difficult.

Signature · 1 line
Alex Bligh

Yes, that would be something possible to do. Is it the only format to upload a VM to vCenter now, shouldn't normal VMDK be supported as well?

Thanks,

Fam

author
#2 lore raw
Quoted 2 lines · Fam Zheng

Yes, that would be something possible to do. Is it the only format to upload a VM to vCenter now, shouldn't normal VMDK be supported as well?

Ian puts it better than I can:

Quoted 3 lines

This format is only useful if you are attempting to import virtual machines into ESX using the vSphere SOAP API and HTTP POST uploads of image files. (In which case, it is required.)

IE it is the ONLY format you can use using the vSphere SOAP API, which is the only way to automate image uploading. vCenter converts other formats to this format.

Extensive testing with qemu in Q1 this year indicates that it is not possible to use qemu-img convert to produce anything that will upload. I went as far as hexdump at the time. I believe I tried compat6 and the various subformat options.

I believe we /read/ this format fine.

Signature · 1 line
Alex Bligh
#3 lore raw
Quoted 16 lines · Alex Bligh
Quoted 2 lines · Fam Zheng

Yes, that would be something possible to do. Is it the only format to upload a VM to vCenter now, shouldn't normal VMDK be supported as well?

Ian puts it better than I can:

Quoted 3 lines

This format is only useful if you are attempting to import virtual machines into ESX using the vSphere SOAP API and HTTP POST uploads of image files. (In which case, it is required.)

IE it is the ONLY format you can use using the vSphere SOAP API, which is the only way to automate image uploading. vCenter converts other formats to this format.

Quoted 7 lines

Extensive testing with qemu in Q1 this year indicates that it is not possible to use qemu-img convert to produce anything that will upload. I went as far as hexdump at the time. I believe I tried compat6 and the various subformat options.

I believe we /read/ this format fine.

OK, thanks for explaination. That sounds a valid use case for streamOptimized. However I am afraid QEMU and its users benefit not much from this feature anyway, because it's moving a VM away to VMware, :) that might be the reason it's not there yet, and I don't know about any plan to do it in the near future.

But if someone sends patches for this, I think it is possible to get in.

Thanks,
Fam

author
#4 lore raw
Quoted 5 lines · Fam Zheng

OK, thanks for explaination. That sounds a valid use case for streamOptimized. However I am afraid QEMU and its users benefit not much from this feature anyway, because it's moving a VM away to VMware, :) that might be the reason it's not there yet, and I don't know about any plan to do it in the near future.

Well, given it is an open source project, the more interoperability the better. Even if it just means users need not worry about lock in to faster hypervisors ... Being more serious, qemu-img is part of the project too.

Quoted 1 line

But if someone sends patches for this, I think it is possible to get in.

I guessed "send code" might be the answer :-)

What I'm not sure of is whether the streaming format has to be written sequentially from as opposed to random writes. I believe the way qemu-img convert works, one can't guarantee the writes are sequential.

Signature · 1 line
Alex Bligh
#5 lore raw
Quoted 14 lines · Alex Bligh
Quoted 5 lines · Fam Zheng

OK, thanks for explaination. That sounds a valid use case for streamOptimized. However I am afraid QEMU and its users benefit not much from this feature anyway, because it's moving a VM away to VMware, :) that might be the reason it's not there yet, and I don't know about any plan to do it in the near future.

Well, given it is an open source project, the more interoperability the better. Even if it just means users need not worry about lock in to faster hypervisors ... Being more serious, qemu-img is part of the project too.

Quoted 9 lines
Quoted 1 line

But if someone sends patches for this, I think it is possible to get in.

I guessed "send code" might be the answer :-)

What I'm not sure of is whether the streaming format has to be written sequentially from as opposed to random writes. I believe the way qemu-img convert works, one can't guarantee the writes are sequential.

The order of sectors doesn't matter, but granularity should be aligned to, as the data is compressed cluster by cluster. And no overwrite, of course. The challenge may be that header comes at the end of file (well, called footer), which is not decided at create time.

Thanks,
Fam

#6 lore raw

Il 20/08/2013 09:08, Fam Zheng ha scritto:

Quoted 24 lines · Alex Bligh
Quoted 14 lines · Fam Zheng
Quoted 6 lines

OK, thanks for explaination. That sounds a valid use case for streamOptimized. However I am afraid QEMU and its users benefit not much from this feature anyway, because it's moving a VM away to VMware, :) that might be the reason it's not there yet, and I don't know about any plan to do it in the near future.

Well, given it is an open source project, the more interoperability the better. Even if it just means users need not worry about lock in to faster hypervisors ... Being more serious, qemu-img is part of the project too.

Quoted 9 lines
Quoted 1 line

But if someone sends patches for this, I think it is possible to get in.

I guessed "send code" might be the answer :-)

What I'm not sure of is whether the streaming format has to be written sequentially from as opposed to random writes. I believe the way qemu-img convert works, one can't guarantee the writes are sequential.

Quoted 4 lines

The order of sectors doesn't matter, but granularity should be aligned to, as the data is compressed cluster by cluster. And no overwrite, of course. The challenge may be that header comes at the end of file (well, called footer), which is not decided at create time.

It doesn't look too different from what "qemu-img convert -c" does, except that you need to use the right "-o" incantation to specify the format type.

Paolo

author
#7 lore raw
Quoted 3 lines · Paolo Bonzini

It doesn't look too different from what "qemu-img convert -c" does, except that you need to use the right "-o" incantation to specify the format type.

Extensive incanting did not produce a result that works. Possibly inadequate haruspication on my part. I suspect it's only a minor modification to support it.

Signature · 1 line
Alex Bligh
#8 lore raw

Il 20/08/2013 15:37, Alex Bligh ha scritto:

Quoted 10 lines · Paolo Bonzini
Quoted 4 lines

It doesn't look too different from what "qemu-img convert -c" does, except that you need to use the right "-o" incantation to specify the format type.

Extensive incanting did not produce a result that works. Possibly inadequate haruspication on my part. I suspect it's only a minor modification to support it.

Yes, because vmdk does not implement bdrv_write_compressed. Sorry for leaving out the small "detail". :(

Paolo

author
#9 lore raw
Quoted 2 lines · Paolo Bonzini

Yes, because vmdk does not implement bdrv_write_compressed. Sorry for leaving out the small "detail". :(

Would that be easy for me to fix?

Signature · 1 line
Alex Bligh
#10 lore raw
In reply to Alex Bligh
Quoted 4 lines · Alex Bligh

What I'm not sure of is whether the streaming format has to be written sequentially from as opposed to random writes. I believe the way qemu-img convert works, one can't guarantee the writes are sequential.

It should be possible to support stream-optimized VMDK writing in qemu-img convert.

The file format supports non-sequential layout of data - each piece of guest data also has a logical block address with it. You can write out the grain table/directory at the end of the image file once you know how data is layed out.

The VMDK spec is not great so I guess you'll also need a VMware setup to verify your code changes.

Stefan