Skip to content

Commit 1c0c7c8

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 <guillaume.thouvenin@vates.tech>
1 parent 5ec5732 commit 1c0c7c8

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

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

Lines changed: 20 additions & 12 deletions
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,40 @@ 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+
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.
3846

3947
If a driver does not provide this information (as is currently the case with existing
4048
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.
4351

4452
With this new information, listing all parameters of the SM object will return:
4553

4654
```bash
4755
# xe sm-list params=all
4856
```
4957

50-
will output something like:
58+
will output something like (notice that CLI uses hyphens):
5159

5260
```
5361
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
@@ -70,7 +78,7 @@ be incremented.
7078

7179
# Impact
7280

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.
7482
- **Client Awareness:** Clients like the `xe` CLI will now be able to query and display the supported image formats for a given SR.
7583
- **Database Versioning:** The XAPI database version will be updated to reflect this change.
7684

0 commit comments

Comments
 (0)