Skip to content

Conversation

gthvn1
Copy link
Contributor

@gthvn1 gthvn1 commented Feb 25, 2025

At XCP-ng, we are working on overcoming the 2TiB limitation for VM disks while preserving essential features.
However, we currently cannot export a VDI to a Qcow2 file, nor import one. The purpose of this design proposal is to outline a solution for implementing VDI import/export in Qcow2 format.

At XCP-ng, we are working on overcoming the 2TiB limitation
for VM disks while preserving essential features.
However, we currently cannot export a VDI to a Qcow2 file,
nor import one. The purpose of this design proposal is to outline
a solution for implementing VDI import/export in Qcow2 format.

Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
Copy link
Contributor

@lindig lindig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends a bit abruptly; giving some details early and less and less as the document goes on. It's fine as a way to document an intent - but it is not a full design.

@gthvn1
Copy link
Contributor Author

gthvn1 commented Feb 25, 2025

This ends a bit abruptly; giving some details early and less and less as the document goes on. It's fine as a way to document an intent - but it is not a full design.

Agree. It is more to initiate the discussion and have some feedback but yes I need to improve it. Are you thinking about the part about qcow-tool? Because for this part I'm not sure about what is needed. I see that command vhd-tool serve and vhd-tool stream are used to deal with import and export of VDI so I think that we should be able to implement it with the qcow-tool. But I can go a little deeper for sure :)

Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work seems lmited scope and reasonable, although a bit light in the details surrounding the work that needs to be done.

I think it's worth explaining one aspect in particular:
What does adding support for Qcow 2 mean for the handler? That is, how does the detection of format work and how it should be modified?

@gthvn1
Copy link
Contributor Author

gthvn1 commented Feb 25, 2025

This work seems lmited scope and reasonable, although a bit light in the details surrounding the work that needs to be done.

I think it's worth explaining one aspect in particular: What does adding support for Qcow 2 mean for the handler? That is, how does the detection of format work and how it should be modified?

Ok sure. I will add details about this particular aspect and also in general.

@gthvn1 gthvn1 force-pushed the feature/add-qcow-tool-for-vdi-import-export branch from 0a8024c to d137934 Compare February 26, 2025 09:44
- Since the format is checked in the handler, we need to add support for `Qcow2`,
as currently only `Raw`, `Tar`, and `Vhd` are supported.
- This requires adding a new type in the `Importexport.Format` module and a new
content type: `"application/qcow2"`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no official type for qcow2, so I recommend against using a mime type that's not prepended with x-. Following qcow's mime type, I recommend application/x-qemu-disk-2, removing '-2' might also be acceptable.

Copy link
Contributor Author

@gthvn1 gthvn1 Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will update that thanks. I'm also trying to have a better understanding about how vhd-tool serve and vhd-tool stream are working because it is not clear yet what is the Unix file descriptor that is used and how it works within the XAPI. So I'm currently having a closer look to the code and I will update the section.
Thanks for the comment about mimetype 👍

Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mimetype for qcow2 (and qcow3) is application/octet-stream, but that's hardly useable for our case, using x-qemu-disk or similar is the way to go for detection. I don't have any other useful objections here, the rest looks reasonable.

@gthvn1 gthvn1 requested a review from lindig February 27, 2025 08:07
@lindig lindig added this pull request to the merge queue Feb 27, 2025
Merged via the queue into xapi-project:master with commit d5f67ad Feb 27, 2025
14 of 15 checks passed
@last-genius
Copy link
Contributor

Probably should have squashed the fixups before merging?

@psafont
Copy link
Member

psafont commented Feb 27, 2025

not sure why github allowed it

@gthvn1 gthvn1 deleted the feature/add-qcow-tool-for-vdi-import-export branch March 17, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants