Skip to content

Commit abee315

Browse files
committed
Design proposal for supported image formats (v3)
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]>
1 parent 5ec5732 commit abee315

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

doc/content/design/sm-supported-image-formats.md

+21-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Add supported image formats in sm-list
33
layout: default
44
design_doc: true
5-
revision: 2
5+
revision: 3
66
status: proposed
77
---
88

@@ -22,32 +22,39 @@ available formats.
2222
# Design Proposal
2323

2424
To expose the available image formats to clients (e.g., XenCenter, XenOrchestra, etc.),
25-
we propose adding a new field called `supported-image-formats` to the Storage Manager (SM)
26-
module. This field will be included in the output of the `SM.get_all_records` call.
25+
we propose adding a new field called `supported_image_formats` to the Storage Manager
26+
(SM) module. This field will be included in the output of the `SM.get_all_records` call.
2727

28-
The `supported-image-formats` field will be populated by retrieving information
28+
The `supported_image_formats` field will be populated by retrieving information
2929
from the SMAPI drivers. Specifically, each driver will update its `DRIVER_INFO`
3030
dictionary with a new key, `supported_image_formats`, which will contain a list
3131
of strings representing the supported image formats
3232
(for example: `["vhd", "raw", "qcow2"]`).
3333

34-
The list designates the driver's preferred VDI format as its first entry. That
35-
means that when migrating a VDI, the destination storage repository will
36-
attempt to create a VDI in this preferred format. If the default format cannot
37-
be used (e.g., due to size limitations), an error will be generated.
34+
If a driver does not provide this information (as is currently the case with
35+
existing drivers), the default value will be an empty array. This signifies that
36+
the driver determines which format to use when creating or migrating a VDI.
37+
This approach ensures compatibility with both current and future drivers.
3838

39-
If a driver does not provide this information (as is currently the case with existing
40-
drivers), the default value will be an empty array. This signifies that it is the
41-
driver that decides which format it will use. This ensures that the modification
42-
remains compatible with both current and future drivers.
39+
When creating new VDI, user can choose the format by passing the option
40+
`type=qcow2` to the `sm_config` parameter. If no format is specified, it is
41+
up to the driver to choose its preferred format.
42+
43+
During the migration of a VDI, the API client needs a way to specify the desired
44+
image format when an SR supports multiple storage types. To achieve this, a new
45+
field, `destination_image_format`, is introduced and provided during the migration
46+
process. This field is added as a new parameter to `VDI.pool_migrate` and accepts
47+
a string. The string specifies a preferred format (e.g., qcow2), ensuring that the
48+
VDI is migrated in the correct format. If the chosen or default format cannot be
49+
used (e.g., due to size limitations), an error will be generated.
4350

4451
With this new information, listing all parameters of the SM object will return:
4552

4653
```bash
4754
# xe sm-list params=all
4855
```
4956

50-
will output something like:
57+
will output something like (notice that CLI uses hyphens):
5158

5259
```
5360
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
@@ -70,7 +77,7 @@ be incremented.
7077

7178
# Impact
7279

73-
- **Data Model:** A new field (`supported-image-formats`) is added to the SM records.
80+
- **Data Model:** A new field (`supported_image_formats`) is added to the SM records.
7481
- **Client Awareness:** Clients like the `xe` CLI will now be able to query and display the supported image formats for a given SR.
7582
- **Database Versioning:** The XAPI database version will be updated to reflect this change.
7683

0 commit comments

Comments
 (0)