Skip to content

Design proposal for supported image formats (v3) #6360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gthvn1
Copy link
Contributor

@gthvn1 gthvn1 commented Mar 14, 2025

In the previous version of the design some questions were always raised. In this version we added explanations about how to choose the format when the VDI is created but also the destination format during migration.
We no longer rely on the order of the parameters passed by the driver because it is not guaranteed. Instead we propose to use some existing parameters to choose the format of the VDI when it is created and the format that should be used during migration. If no parameters are specified it will be up to the driver to do what he wants.

storage, we need a way to specify which format should be used. To achieve this,
we propose adding a preferred image format for a given SR. When the SR is created,
based on the list retrieved using `supported_image_formats` from the SM, we can
pass `preferred-image-format=qcow2` to the `sm_config` parameter of the SR. If no
Copy link
Member

@psafont psafont Mar 14, 2025

Choose a reason for hiding this comment

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

This is a very roundabout way of selecting the type, and if there's migrations happening at the same time, a format for each of them doesn't seem possible.

Why can 't the VDI migration have an additional parameter selecting the type?

Also, which drivers gets to pick the format, the one that's exportting, the one that's importing, both?

Copy link
Contributor Author

@gthvn1 gthvn1 Mar 14, 2025

Choose a reason for hiding this comment

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

In fact it is a simple way to specify a format without modifying the API but I completely agree on both points.

  1. With this modification all migrations will have the same format and
  2. it would be better to be able to choose the destination format per VDI.

And if the user doesn't make a choice the driver that manages the destination SR makes the choice.
I will add a proposition for a new parameter for VDI pool migrate. But about VM migrate? Because the user migrate a VM that has a VDI that is not on shared storage it will call the VDI pool migrate no? As I'm not sure here what to do that's why I proposed as first approach to fix the destination format using the preferred-image-format=qcow2.

@gthvn1 gthvn1 force-pushed the feature/supported-image-formats-v3 branch from 1c0c7c8 to abee315 Compare March 14, 2025 16:29
@gthvn1 gthvn1 requested a review from psafont March 15, 2025 14:09
be used (e.g., due to size limitations), an error will be generated.
If a driver does not provide this information (as is currently the case with
existing drivers), the default value will be an empty array. This signifies that
the driver determines which format to use when creating or migrating a VDI.
Copy link
Member

Choose a reason for hiding this comment

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

On migration, which of the sides decides what format to use? The receiving end? Or is there a negotiation between both sides needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I see it, if no extra information is provided, it is up to the receiving end to decide the default format. Since the supported formats are not exposed, the client cannot make any assumptions. Therefore, only the receiving side can determine its default format, and there is no negotiation between both sides.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other solution is to check in XAPI that the same format is available for both side and if it is the case keep the same format. Otherwise we use the destination format. It is not clear yet how to check that in XAPI so that's why using the default format of the destination is maybe easier as a first approach...

Copy link
Member

Choose a reason for hiding this comment

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

Can the fact that it's the receiving side that decides be written here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure. I'm not sure which solution is better. So I'm waiting for other opinions if any and will update the PR accordingly 👍

Comment on lines 47 to 49
a string. The string specifies a preferred format (e.g., qcow2), ensuring that the
VDI is migrated in the correct format. If the chosen or default format cannot be
used (e.g., due to size limitations), an error will be generated.
Copy link
Member

Choose a reason for hiding this comment

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

Can this error be calculated before the mgiration happens, and not when the limit is reached? I'd like to have the time the check is done written down in the design

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok sure. I will check that.

@gthvn1 gthvn1 force-pushed the feature/supported-image-formats-v3 branch 2 times, most recently from e3bf586 to d237624 Compare March 20, 2025 16:17
@gthvn1 gthvn1 closed this Apr 29, 2025
@gthvn1 gthvn1 deleted the feature/supported-image-formats-v3 branch April 29, 2025 08:26
@gthvn1 gthvn1 restored the feature/supported-image-formats-v3 branch April 29, 2025 08:38
@gthvn1
Copy link
Contributor Author

gthvn1 commented Apr 29, 2025

Closed by mistake.

@gthvn1 gthvn1 reopened this Apr 29, 2025
In this version we added explanation about how to choose the format when the
VDI is created but also the destination format during migration. We also fix
some typos.

Signed-off-by: Guillaume <[email protected]>
@gthvn1 gthvn1 force-pushed the feature/supported-image-formats-v3 branch from d237624 to c81e182 Compare April 29, 2025 09:11
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.

2 participants