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,39 @@ 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 .
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 .
38
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.
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.
43
50
44
51
With this new information, listing all parameters of the SM object will return:
45
52
46
53
``` bash
47
54
# xe sm-list params=all
48
55
```
49
56
50
- will output something like:
57
+ will output something like (notice that CLI uses hyphens) :
51
58
52
59
```
53
60
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
@@ -70,7 +77,7 @@ be incremented.
70
77
71
78
# Impact
72
79
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.
74
81
- ** Client Awareness:** Clients like the ` xe ` CLI will now be able to query and display the supported image formats for a given SR.
75
82
- ** Database Versioning:** The XAPI database version will be updated to reflect this change.
76
83
0 commit comments