2
2
title : Add supported image formats in sm-list
3
3
layout : default
4
4
design_doc : true
5
- revision : 2
5
+ revision : 3
6
6
status : proposed
7
7
---
8
8
@@ -22,32 +22,41 @@ available formats.
22
22
# Design Proposal
23
23
24
24
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.
27
27
28
- The ` supported-image-formats ` field will be populated by retrieving information
28
+ The ` supported_image_formats ` field will be populated by retrieving information
29
29
from the SMAPI drivers. Specifically, each driver will update its ` DRIVER_INFO `
30
30
dictionary with a new key, ` supported_image_formats ` , which will contain a list
31
31
of strings representing the supported image formats
32
32
(for example: ` ["vhd", "raw", "qcow2"] ` ).
33
33
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.
38
-
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.
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 on the receiving side determines which format to use when creating or
37
+ migrating a VDI. This approach ensures compatibility with both current and future
38
+ drivers.
39
+
40
+ When creating new VDI, user can choose the format by passing the option
41
+ ` type=qcow2 ` to the ` sm_config ` parameter. If no format is specified, it is
42
+ up to the driver to choose its preferred format.
43
+
44
+ During the migration of a VDI, the API client needs a way to specify the desired
45
+ image format when an SR supports multiple storage types. To achieve this, a new
46
+ field, ` destination_image_format ` , is introduced and provided during the migration
47
+ process. This field is added as a new parameter to ` VDI.pool_migrate ` and accepts
48
+ a string. The string specifies a preferred format (e.g., * qcow2* ), ensuring that the
49
+ VDI is migrated in the correct format. If the chosen or default format cannot be
50
+ used (e.g., due to size limitations), an error will be generated. The error should
51
+ be detected as early as possible to prevent disruption during an ongoing migration.
43
52
44
53
With this new information, listing all parameters of the SM object will return:
45
54
46
55
``` bash
47
56
# xe sm-list params=all
48
57
```
49
58
50
- will output something like:
59
+ Output of the command will look like (notice that CLI uses hyphens) :
51
60
52
61
```
53
62
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
@@ -70,7 +79,7 @@ be incremented.
70
79
71
80
# Impact
72
81
73
- - ** Data Model:** A new field (` supported-image-formats ` ) is added to the SM records.
82
+ - ** Data Model:** A new field (` supported_image_formats ` ) is added to the SM records.
74
83
- ** Client Awareness:** Clients like the ` xe ` CLI will now be able to query and display the supported image formats for a given SR.
75
84
- ** Database Versioning:** The XAPI database version will be updated to reflect this change.
76
85
0 commit comments