-
Notifications
You must be signed in to change notification settings - Fork 292
Supported image formats #6712
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: master
Are you sure you want to change the base?
Supported image formats #6712
Conversation
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 <[email protected]>
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. It also adds 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 <[email protected]>
A new field supported_image_format and new parameters have been added for: - VM.migrate_send - VM.assert_can_migrate - VDI.pool_migrate Signed-off-by: Guillaume <[email protected]>
; field ~lifecycle:[] ~qualifier:DynamicRO | ||
~default_value:(Some (VSet [])) ~ty:(Set String) | ||
"supported_image_formats" | ||
"Image formats supported by the SR (VHD, RAW, Qcow2, ...)" |
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.
Is the capitalisation significant? Would be good to list the supported formats in the exact syntax. The … leaves some imagination.
; ( String | ||
, "dest_img_format" | ||
, "The image format to use on destination SR" | ||
) |
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.
Again, list supported formats in the exact syntax.
?(host_pending_features = []) ?(configuration = []) ?(other_config = []) | ||
?(driver_filename = "/dev/null") ?(required_cluster_stack = []) () = | ||
?(driver_filename = "/dev/null") ?(required_cluster_stack = []) | ||
?(supported_image_formats = []) () = |
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.
Is this a sensible default? Does this not force to set this parameter? Or is the empty list a special value?
let vdi = | ||
Client.VDI.get_by_uuid ~rpc ~session_id ~uuid:vdi_uuid | ||
in | ||
debug "GTNDEBUG: add image format %s,%s" vdi_uuid vdi_fmt ; |
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.
What is GTNDEBUG
?
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.
I'm using it for personal debug "Guillaume ThouveniN" 😉 . It is too make sure to remove them all before before pushing PR 😅 ...
let sr_uuid = Db.SR.get_uuid ~__context ~self:sr_ref in | ||
match List.assoc_opt vdi_ref vdi_format_map with | ||
| None -> | ||
debug "GTNDEBUG: read vdi %s, sr %s. No type specified for the VDI" |
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.
GTNDEBUG
?
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.
Oops 😅 I will check whether we want to keep this debug message. If yes, I'll remove GTNDEBUG
. I will also check for others GTNDEBUG
as well 👍
I would like to see more explicitly documented and checked the supported image formats. These appear to be some mysterious strings but the user of neither API or CLI should have to guess them, |
This PR implements the supported image format mechanism proposed in this design document: https://xapi-project.github.io/new-docs/design/sm-supported-image-formats/index.html
DRIVER_INFO
.This feature is particularly useful because XCP-ng is adding support for the Qcow2 format in SMAPI to allow VDIs larger than 2TB. So in the near future (we're currently releasing the beta version), some SRs will support multiple formats such as VHD, RAW, and Qcow2.
With this patch, it becomes possible to migrate a VM with VHD disks on one SR to another SR with Qcow2 disks. If an SM plugin does not provide information about the supported image formats, the behavior remains unchanged.
For more details see the specification.