-
Notifications
You must be signed in to change notification settings - Fork 6
Adding supported image formats in sm-list (XCP-ng 8.3) #10
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
base: v25.6.0-8.3
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we confident about this? Or do we want to create a separate QCOW branch with this and other associated patches?
Pull Request Test Coverage Report for Build 15923352984Details
💛 - Coveralls |
I think that it should be a default feature for XCP-ng as XO will display this information. And it will probably be used to allow the selection of a file format when the user creates a VDI. So I think that we don't need a specific branch for this. I mean we need to provide this feature. |
fca1aa5
to
afc2368
Compare
9f45b71
to
526ccd6
Compare
aa7e2dd
to
b83f906
Compare
raise | ||
Api_errors.( | ||
Server_error | ||
( vdi_incompatible_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we return incompatible type that makes sense I think but we can also create a new kind of error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the comments, looks good to me overall. Would also be great if you could split the second commit into two:
vdi_pool_migrate: Add the destination_format parameter
vm.migrate_send: Add the vdi_format_map parameter
These are independent pieces of work and it would be great to be able to revert them separately, if needed.
The first commit title could also be changed to something like:
datamodel: Add supported_image_formats field to the SM object
Since the fact that the new field shows up in sm-list
is really a consequence of this
In fact I think I will split it in the other way because vdi.pool_migrate uses vm.migrate_send. So I think it makes more sense to start with vm migration and then vdi pool migrate. |
Note: I set this PR back to draft because the goal, once we agree that it looks correct, is to rebase it upstream and propose it upstream. Here it is easier for testing and review to be based on XCP-ng 8.3 but the goal is to push it upstream at the end. |
1edd1a2
to
167884d
Compare
485a767
to
bb34238
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Could probably split the schema hash and datamodel version bump into a separate commit since they do not really only belong to the first one
And let's see what the upstream says :) |
When running `xe sm-list params=all` you will now have the info of supported image formats if the SM plugin specified it in its DRIVER_INFO. The field is called `supported-image-formats`. If the plugin doesn't provide the info the field will be empty. This patch modifies the datamodel and add a new field to store this information into the SM object. Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
This patch allows specifying the destination format for individual VDIs mapped to a destination SR. It adds a new parameter to `VM.migrate_send` and `VM.assert_can_migrate` API. It also adds a new parameter to XE CLI. The format to specify the image format is `image-format:<source VDI UUID>=<destination image format>`. If the given image format cannot be validated, an error is returned. Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
This patch add a new parameter to `VDI.pool-migrate`. This new parameter allows to provide a string that is the destination format. This string is used to check whether the destination SR supports the expected format. If the check fails or cannot be performed due to missing information on the destination SR, an error is returned. Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
A new field supported_image_format has been added to SM object and a new field has been added to: - VM.migrate_send - VM.assert_can_migrate - VDI.pool_migrate Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
4b03dc3
to
3a0e8fd
Compare
This patch adds the field
supported-image-format
to SM object of the XAPI database. As it modifies the database we cannot have the same patch for our 8.3 and upstream because version of XAPI database or not the same. So upstream modifications conflicts with our modification. And the branch that follows the upstream one cannot be merged without conflicts.So for testing and start review I created this patch that can be applied on our XCP-ng 8.3 branch so it is easy to test. Once reviewed I will rebase it upstream and see how we can do a PR.