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,40 @@ 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
+ When creating new VDI, you can choose the format by passing the option
35
+ ` type=qcow2 ` to the ` sm_config ` parameter. If no format is specified, it is
36
+ up to the driver to choose its preferred format.
37
+
38
+ During the migration of a VDI, since an SR can now support different types of
39
+ storage, we need a way to specify which format should be used. To achieve this,
40
+ we propose adding a preferred image format for a given SR. When the SR is created,
41
+ based on the list retrieved using ` supported_image_formats ` from the SM, we can
42
+ pass ` preferred-image-format=qcow2 ` to the ` sm_config ` parameter of the SR. If no
43
+ format is specified, it is up to the driver to choose its preferred format. If the
44
+ default format cannot be used (e.g., due to size limitations), an error will be
45
+ generated.
38
46
39
47
If a driver does not provide this information (as is currently the case with existing
40
48
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.
49
+ driver that decides which format it will use to create or migrate a VDI. This ensures
50
+ that the modification remains compatible with both current and future drivers.
43
51
44
52
With this new information, listing all parameters of the SM object will return:
45
53
46
54
``` bash
47
55
# xe sm-list params=all
48
56
```
49
57
50
- will output something like:
58
+ will output something like (notice that CLI uses hyphens) :
51
59
52
60
```
53
61
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
@@ -70,7 +78,7 @@ be incremented.
70
78
71
79
# Impact
72
80
73
- - ** Data Model:** A new field (` supported-image-formats ` ) is added to the SM records.
81
+ - ** Data Model:** A new field (` supported_image_formats ` ) is added to the SM records.
74
82
- ** Client Awareness:** Clients like the ` xe ` CLI will now be able to query and display the supported image formats for a given SR.
75
83
- ** Database Versioning:** The XAPI database version will be updated to reflect this change.
76
84
0 commit comments