Skip to content

Commit b9c8154

Browse files
authored
Design proposal for supported image formats (#6308)
Proposing a new field field to get information about supported image formats for a given SR. This information is retrieved from SMAPIv1 plugins.
2 parents 7d1bd4a + 8bb3d19 commit b9c8154

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Add supported image formats in sm-list
3+
layout: default
4+
design_doc: true
5+
revision: 2
6+
status: proposed
7+
---
8+
9+
# Introduction
10+
11+
At XCP-ng, we are enhancing support for QCOW2 images in SMAPI. The primary
12+
motivation for this change is to overcome the 2TB size limitation imposed
13+
by the VHD format. By adding support for QCOW2, a Storage Repository (SR) will
14+
be able to host disks in VHD and/or QCOW2 formats, depending on the SR type.
15+
In the future, additional formats—such as VHDx—could also be supported.
16+
17+
We need a mechanism to expose to end users which image formats are supported
18+
by a given SR. The proposal is to extend the SM API object with a new field
19+
that clients (such as XenCenter, XenOrchestra, etc.) can use to determine the
20+
available formats.
21+
22+
# Design Proposal
23+
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.
27+
28+
The `supported-image-formats` field will be populated by retrieving information
29+
from the SMAPI drivers. Specifically, each driver will update its `DRIVER_INFO`
30+
dictionary with a new key, `supported_image_formats`, which will contain a list
31+
of strings representing the supported image formats
32+
(for example: `["vhd", "raw", "qcow2"]`).
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.
43+
44+
With this new information, listing all parameters of the SM object will return:
45+
46+
```bash
47+
# xe sm-list params=all
48+
```
49+
50+
will output something like:
51+
52+
```
53+
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
54+
name-label ( RO) : Local EXT3 VHD
55+
name-description ( RO) : SR plugin representing disks as VHD files stored on a local EXT3 filesystem, created inside an LVM volume
56+
type ( RO) : ext
57+
vendor ( RO) : Citrix Systems Inc
58+
copyright ( RO) : (C) 2008 Citrix Systems Inc
59+
required-api-version ( RO) : 1.0
60+
capabilities ( RO) [DEPRECATED] : SR_PROBE; SR_SUPPORTS_LOCAL_CACHING; SR_UPDATE; THIN_PROVISIONING; VDI_ACTIVATE; VDI_ATTACH; VDI_CLONE; VDI_CONFIG_CBT; VDI_CREATE; VDI_DEACTIVATE; VDI_DELETE; VDI_DETACH; VDI_GENERATE_CONFIG; VDI_MIRROR; VDI_READ_CACHING; VDI_RESET_ON_BOOT; VDI_RESIZE; VDI_SNAPSHOT; VDI_UPDATE
61+
features (MRO) : SR_PROBE: 1; SR_SUPPORTS_LOCAL_CACHING: 1; SR_UPDATE: 1; THIN_PROVISIONING: 1; VDI_ACTIVATE: 1; VDI_ATTACH: 1; VDI_CLONE: 1; VDI_CONFIG_CBT: 1; VDI_CREATE: 1; VDI_DEACTIVATE: 1; VDI_DELETE: 1; VDI_DETACH: 1; VDI_GENERATE_CONFIG: 1; VDI_MIRROR: 1; VDI_READ_CACHING: 1; VDI_RESET_ON_BOOT: 2; VDI_RESIZE: 1; VDI_SNAPSHOT: 1; VDI_UPDATE: 1
62+
configuration ( RO) : device: local device path (required) (e.g. /dev/sda3)
63+
driver-filename ( RO) : /opt/xensource/sm/EXTSR
64+
required-cluster-stack ( RO) :
65+
supported-image-formats ( RO) : vhd, raw, qcow2
66+
```
67+
68+
This change impacts the SM data model, and as such, the XAPI database version will
69+
be incremented.
70+
71+
# Impact
72+
73+
- **Data Model:** A new field (`supported-image-formats`) is added to the SM records.
74+
- **Client Awareness:** Clients like the `xe` CLI will now be able to query and display the supported image formats for a given SR.
75+
- **Database Versioning:** The XAPI database version will be updated to reflect this change.
76+

0 commit comments

Comments
 (0)