Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
d823e04
Improve the xapi_observer debug logs by adding more context
snwoods May 22, 2025
13042fd
Reduce code duplication by using a common Observer Interface
snwoods May 27, 2025
4ab193a
CA-409431: Use an Observer forwarder for xapi-storage-script
snwoods May 27, 2025
0b9f900
xapi: Move cpu_info keys to xapi-consts from xapi_globs to be used ac…
last-genius Jun 9, 2025
c23f1a3
xapi-cli-server: Fix host-get-cpu-features and add pool-get-cpu-features
last-genius Jun 9, 2025
11ab8a6
unixext: Add a raise_with_preserved_backtrace function
last-genius Jun 10, 2025
929eefd
xapi_vgpu_type: Don't pollute the logs with non-critical errors
last-genius Jun 10, 2025
a4b992c
networkd: Add ENOENT to the list of expected errors in Sysfs.read_one…
last-genius Jun 10, 2025
3f0e977
xenguestHelper: Don't dump errors on End_of_file
last-genius Jun 10, 2025
743565c
Don't pollute the logs with some errors (#6518)
last-genius Jun 11, 2025
3b7278f
xe-cli completion: Remove "<not in database>" from completion suggest…
last-genius Jun 11, 2025
4e5012f
xe-cli completion: Fix debug logging
last-genius Jun 11, 2025
0ba2168
xe-cli completion: Eliminate duplicate suggestions early on
last-genius Jun 11, 2025
32a772a
xe-cli completion: Improve completion for 'resident-on=' and 'affinity='
last-genius Jun 11, 2025
2a8e55b
xe-cli completion: Handle suggestions for 'suspend-{VDI,SR}-uuid'
last-genius Jun 11, 2025
ff8f112
xapi/helpers: Note that get_localhost can fail while the database is …
last-genius Jun 11, 2025
e544d85
xapi_host: missing UEFI certificates warrant a warning, not an error
last-genius Jun 11, 2025
3ceb3d2
Improve `xe-cli` completion (#6524)
last-genius Jun 12, 2025
6fe7c9e
CA-412164: XSI-1901: uid-info does not support `:` in gecos
liulinC Jun 11, 2025
af0769d
CA-412164: XSI-1901: uid-info does not support `:` (#6522)
liulinC Jun 12, 2025
3d75583
CP-47063: Instrument xenops vm non-atomic functions.
GabrielBuica Jun 4, 2025
5138375
CP-47063: Instrument `switch_rpc` and message-switch client
GabrielBuica Jun 4, 2025
7825873
xe-cli completion: Fix regex for checking previously provided parameters
last-genius Jun 12, 2025
1f83af9
xapi-cli-server: Add some of the missing parameters to cli_frontend
last-genius Jun 12, 2025
065b2a6
xapi-cli-server: Remove old commented-out code
last-genius Jun 12, 2025
80c6afe
xe-cli completion: Add more boolean parameters
last-genius Jun 12, 2025
502fc45
CP-47063: Tracing instrumentation around message-switch send (#6503)
edwintorok Jun 12, 2025
69087b1
CA-412313: Tracing_export: flush on XAPI exit
edwintorok Jun 11, 2025
a54505e
CA-412313: xs-trace: introduce a pp command
edwintorok Jun 11, 2025
afb3678
CA-412313: don't lose distributed tracing spans when XAPI is shut dow…
last-genius Jun 12, 2025
c5a9145
xenopsd: Allow to override the default NUMA placement
psafont Jun 12, 2025
8b1ec25
More small logs and `xe-cli` completion improvements (#6526)
last-genius Jun 13, 2025
b8f3ab4
Fix `message-switch` opam metadata
GabrielBuica Jun 13, 2025
a3a7ca4
opam: generate xapi-log with dune
psafont Jun 13, 2025
c35e8e2
xapi-log: remove circular dependency on tests
psafont Jun 13, 2025
baed6a9
Fix `message-switch` opam metadata (#6531)
edwintorok Jun 13, 2025
87f82e7
datamodel_lifecycle: automatic update
GabrielBuica Jun 13, 2025
2c6912a
datamodel_lifecycle: automatic update (#6533)
psafont Jun 13, 2025
d32c7ce
CA-412146 Filter out VF when scan
changlei-li Jun 12, 2025
61374b3
Update datamodel_host
BengangY Jun 16, 2025
62b4733
Update XE_SR_ERRORCODES from SM
BengangY Jun 16, 2025
a14bc90
Update datamodel_host (#6535)
BengangY Jun 16, 2025
a98bfc5
CA-409431: Use an Observer forwarder for xapi-storage-script (#6488)
psafont Jun 16, 2025
80bd494
Update XE_SR_ERRORCODES from SM (#6536)
psafont Jun 16, 2025
aa94245
xenopsd: Allow to override the default NUMA placement (#6534)
psafont Jun 16, 2025
c3186c4
CA-412146 Filter out VF when scan (#6528)
robhoes Jun 16, 2025
b56df25
Fix `xe host-get-cpu-features` command, add `pool-get-cpu-features` (…
robhoes Jun 16, 2025
97e82c9
opam: generate xapi-log with dune (#6532)
psafont Jun 16, 2025
a4602b5
CP-308253: `Task.destroy` spans should no longer be orphaned
GabrielBuica Jun 18, 2025
63eef6f
CP-308392: Create specialized functions
GabrielBuica Jun 18, 2025
3b76902
xapi-idl: Clean up xenops-related interfaces
last-genius Jun 19, 2025
c568697
xapi_xenops: Remove unnecessary Helpers.get_localhost call
last-genius Jun 18, 2025
fa28105
xapi_xenops: Split update_vm internals into a separate function
last-genius Jun 18, 2025
fa3488f
Clean up `xapi_xenops` and more (#6543)
last-genius Jun 19, 2025
58e9def
CA-408552: 1/3 Improve bootstrom performance by save db ops
liulinC Jun 20, 2025
e8440b3
CA-408552: 2/3 Improve bootstrom performance by save db ops
liulinC Jun 20, 2025
e1a57fa
CA-408552: 3/3 Improve bootstrom performance by save db ops
liulinC Jun 20, 2025
d236751
xenops_server_plugin: Refer to the type alias instead of its definition
last-genius Jun 19, 2025
7a3788a
xapi-idl/updates: Make filterfn in inject_barrier only look at keys
last-genius Jun 19, 2025
4316e6b
xapi_xenops: Refactor update_vm_internal
last-genius Jun 20, 2025
efdf9a1
CP-308253: `Task.destroy` spans should no longer be orphaned (#6542)
GabrielBuica Jun 20, 2025
ba144c2
CP-308253: Instrument `Consumers` Spans in `Message-switch`.
GabrielBuica Jun 5, 2025
7a49235
CP-50001: Instrument `xapi_xenops.ml` -- `dbg` carrier
GabrielBuica Jun 5, 2025
d9a3268
CP-50001: Instrument `xapi_xenops.ml` -- `context` carrier
GabrielBuica Jun 6, 2025
cb64cd6
CP-50001: Instrument `Xapi_xenops.events_watch`
GabrielBuica Jun 6, 2025
7bede83
CP-50001: Add attributes to updates in `events_watch`
GabrielBuica Jun 18, 2025
4210768
CA-408552: Improve bootstrom performance by save db ops (#6541)
liulinC Jun 21, 2025
9d24689
CA-406770: Improve error message
BengangY Jun 16, 2025
e572953
CP-308253 & CP-50001: Instruments `Message-switch` process and `xapi…
psafont Jun 23, 2025
ad5cbe5
xenopsd: Remove data/updated from the list of watched paths
last-genius Jun 23, 2025
a7e874d
CA-406770: Improve error message (#6537)
BengangY Jun 23, 2025
5d0fb87
xapi_xenops: Simplify update_* functions
last-genius Jun 23, 2025
acb9732
CP-308201: make unimplemented function more obvious
snwoods Jun 20, 2025
95b765f
Optimize `xapi<->xenopsd` communication (#6549)
last-genius Jun 23, 2025
f7ee5aa
CP-308201: make unimplemented function more obvious (#6548)
psafont Jun 23, 2025
3ae8ff9
Use just id_of vbd for attached_vdis key instead of the (VM, VBD) tuple
snwoods Apr 2, 2025
0728527
CA-410965: Modify default ref of console
BengangY Jun 24, 2025
38256eb
Design proposal for supported image formats (v3)
gthvn1 Mar 13, 2025
ec612ae
CA-411477: Fix SM API version check failure
BengangY Jun 24, 2025
1f346bd
Design proposal for supported image formats (v3) (#6550)
psafont Jun 25, 2025
5351b0b
CP-54207: Move VBD_attach outside of VM migrate downtime
snwoods Apr 2, 2025
4697489
xenopsd/xc: do try to allocate pages to a particular NUMA node
psafont Jun 19, 2025
d09bcec
xenopsd/xc: Expect an error when claiming pages from a single NUMA node
psafont Jun 19, 2025
43a7ab2
xenopsd/xc: fail when claiming pages for a single NUMA node
psafont Jun 19, 2025
1a68634
xenopsd/xc: upstream more NUMA changes (#6554)
psafont Jun 25, 2025
ee85085
CA-410965: Modify default ref of console (#6553)
BengangY Jun 26, 2025
24ebb5b
idl: Remove unused vm_lacks_feature_* errors
last-genius Jun 26, 2025
d9233f9
python: Add qcow2-to-stdout.py script
last-genius Apr 22, 2025
978765b
python3/qcow2-to-stdout: Remove unused code
last-genius Jun 26, 2025
7708c45
python3/qcow2-to-stdout: Update to handle block special files
last-genius Apr 22, 2025
8d3bf09
python3/qcow2-to-stdout: Add --diff option to export only changed clu…
last-genius May 15, 2025
2f3eec3
idl: Remove unused `vm_lacks_feature_*` errors (#6558)
last-genius Jun 26, 2025
b92d19e
CA-411477: Fix SM API version check failure (#6552)
BengangY Jun 27, 2025
c115a6d
rrdp-squeezed: Don't collect metrics from a domain with missing counters
psafont Jun 26, 2025
165bdec
rrdp-squeezed: generate per-vm memory target datasources
psafont Jun 26, 2025
a38ee7f
rrdp-squeezed: collect agent-collected per-vm free memory metrics
psafont Jun 26, 2025
0fef829
monitor_mem: Prepare xapi to consolidate memory metrics into a single…
psafont Jun 12, 2025
f601c12
rrdp-squeezed: move remaining memory metrics to this plugin
psafont Jun 12, 2025
fa5bc72
xcp-rrdd: remove duplicated code to fetch domains
psafont Jun 26, 2025
1b20f51
Move collection of memory metrics from xcp-rrdd to rrdp-squeezed (#6561)
psafont Jun 27, 2025
57cbad4
Move common retry_econnrefused function to xcp_client
snwoods Jun 25, 2025
f9e7969
CP-54207: Move VBD_attach outside of VM migrate downtime (#6489)
snwoods Jul 1, 2025
267c414
CA-412636: hostname changed to localhost with static IP and reboot
liulinC Jun 17, 2025
aa1653a
CA-412636: hostname changed to localhost with static IP and reboot (#…
liulinC Jul 1, 2025
4927eef
Add mlis for observer_helpers and observer_skeleton
snwoods Jun 16, 2025
fc5f98b
CA-393417: Drop device controller of cgroup v1
liulinC Jul 1, 2025
56bd7c6
CP-308455 VM.sysprep start with skeleton
Jun 9, 2025
8d35ebc
CP-308455 VM.sysprep implement mkdtemp
Jun 11, 2025
c6bee52
CP-308455 VM.sysprep make iso
Jun 12, 2025
0e6f6ee
CP-308455 VM.sysprep Add logging
Jun 12, 2025
b88c199
CP-308455 VM.sysprep Add SR creation
Jun 12, 2025
2061e2e
CP-308455 VM.sysprep Find VBD for VM's CDR
Jun 16, 2025
b22f441
CP-308455 VM.sysprep Implement trigger
Jun 17, 2025
84e5a47
CP-308455 VM.sysprep log sysprep status
Jun 18, 2025
6372672
CP-308455 VM.sysprep watch execution, clean up
Jun 18, 2025
bf3ef79
CP-308455 VM.sysprep add feature flag
Jun 19, 2025
4c3e27d
CP-308455 VM.syspreo add some comments
Jun 19, 2025
20e33e7
CP-308455 VM.sysprep unify error handling
Jun 20, 2025
57dbab7
CP-308455 VM.sysprep list genisoimage as resource
Jun 23, 2025
b16b6d8
CP-308455 VM.sysprep improve error handling, use API.Client
Jun 23, 2025
c9e3bfd
CP-308455 VM.sysprep declare XML content as SecretString
Jul 1, 2025
903737d
Revert "CP-308455 VM.sysprep declare XML content as SecretString"
Jul 2, 2025
6118d47
xapi_vm_lifecycle: Stop assuming PV driver's presence implies all fea…
last-genius Jun 30, 2025
3209c5f
Add mlis for observer_helpers and observer_skeleton (#6539)
snwoods Jul 2, 2025
a215870
CP-308455 Save backtrace in error case
Jul 2, 2025
01981bd
CP-308455 VM.sysprep create better SR name label
Jul 2, 2025
9ce41c5
CP-308455 improve locating local ISO SR
Jul 2, 2025
191db16
CP-308455 VM.sysprep save backtrace
Jul 2, 2025
d736b73
CP-308455 VM.sysprep fix saving backtrace
Jul 2, 2025
630ec57
CP-308455 VM.sysprep write VDI UUID to xenstore
Jul 2, 2025
eaf2050
CP-308455 VM.sysprep make delay configurable
Jul 2, 2025
9153fb5
CP-308455 VM.sysprep guard on_startup with feature flag
Jul 2, 2025
4fb79a7
Move common retry_econnrefused function to xcp_client (#6564)
snwoods Jul 3, 2025
813b8ec
Add VM.sysprep API call (#6547)
lindig Jul 3, 2025
c895469
xapi_vm_lifecycle: Disallow suspend when cant_suspend_reason is present
last-genius Jul 2, 2025
30c0ba1
CA-413304: Restore VBD.unplug function to keep old functionality
snwoods Jul 3, 2025
8017a4e
CP-308455 VM.sysprep make delay configurable
lindig Jul 3, 2025
232013d
CP-308455 VM.sysprep make delay configurable (#6570)
edwintorok Jul 3, 2025
5733419
`xapi_vm_lifecycle`: Improve feature handling, avoid crashes (#6569)
last-genius Jul 4, 2025
c941af3
Add a `qcow2-to-stdout` Python script (#6559)
last-genius Jul 4, 2025
0fd510f
CA-393417: Bind mount /proc/<pid> into chroot
liulinC Jul 4, 2025
7501f70
CA-413304: Restore VBD.unplug function to keep old functionality (#6571)
BengangY Jul 4, 2025
c725281
xapi-stdext-threads: calibrate ratio for delay times
psafont Jul 3, 2025
ce39acf
xapi-stdext-threads: calibrate ratio for delay times (#6568)
psafont Jul 7, 2025
51a97e7
Downgrade unknown SM.feature errors to warnings
gthvn1 Jul 7, 2025
03980fc
CP-308455 VM.sysprep use watch to detect sysprep running
edwintorok Jul 3, 2025
a124c37
Downgrade unknown SM.feature errors to warnings (#6578)
lindig Jul 7, 2025
5be84a4
CP-308455 VM.sysprep use watch to detect sysprep running (#6579)
last-genius Jul 7, 2025
5416081
CA-393417: Fix CI failure
liulinC Jul 7, 2025
5a4e109
CA-393417: Drop device controller of cgroup v1 and fix USB passthroug…
liulinC Jul 8, 2025
41cb7df
datamodel_lifecycle: automatic update
BengangY Jul 8, 2025
9c145a0
datamodel_lifecycle: automatic update (#6581)
psafont Jul 8, 2025
12826e8
CA-413412: Fail to designate new master
BengangY Jul 8, 2025
278ab35
CA-413412: Fail to designate new master (#6582)
BengangY Jul 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 114 additions & 24 deletions doc/content/design/sm-supported-image-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Add supported image formats in sm-list
layout: default
design_doc: true
revision: 2
revision: 3
status: proposed
---

Expand All @@ -22,32 +22,16 @@ available formats.
# Design Proposal

To expose the available image formats to clients (e.g., XenCenter, XenOrchestra, etc.),
we propose adding a new field called `supported-image-formats` to the Storage Manager (SM)
module. This field will be included in the output of the `SM.get_all_records` call.
we propose adding a new field called `supported_image_formats` to the Storage Manager
(SM) module. This field will be included in the output of the `SM.get_all_records` call.

The `supported-image-formats` field will be populated by retrieving information
from the SMAPI drivers. Specifically, each driver will update its `DRIVER_INFO`
dictionary with a new key, `supported_image_formats`, which will contain a list
of strings representing the supported image formats
(for example: `["vhd", "raw", "qcow2"]`).

The list designates the driver's preferred VDI format as its first entry. That
means that when migrating a VDI, the destination storage repository will
attempt to create a VDI in this preferred format. If the default format cannot
be used (e.g., due to size limitations), an error will be generated.

If a driver does not provide this information (as is currently the case with existing
drivers), the default value will be an empty array. This signifies that it is the
driver that decides which format it will use. This ensures that the modification
remains compatible with both current and future drivers.

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

```bash
# xe sm-list params=all
```

will output something like:
Output of the command will look like (notice that CLI uses hyphens):

```
uuid ( RO) : c6ae9a43-fff6-e482-42a9-8c3f8c533e36
Expand All @@ -65,12 +49,118 @@ required-cluster-stack ( RO) :
supported-image-formats ( RO) : vhd, raw, qcow2
```

This change impacts the SM data model, and as such, the XAPI database version will
be incremented.
## Implementation details

The `supported_image_formats` field will be populated by retrieving information
from the SMAPI drivers. Specifically, each driver will update its `DRIVER_INFO`
dictionary with a new key, `supported_image_formats`, which will contain a list
of strings representing the supported image formats
(for example: `["vhd", "raw", "qcow2"]`). Although the formats are listed as a
list of strings, they are treated as a set-specifying the same format multiple
times has no effect.

### Driver behavior without `supported_image_formats`

If a driver does not provide this information (as is currently the case with
existing drivers), the default value will be an empty list. This signifies
that the driver determines which format to use when creating VDI. During a migration,
the destination driver will choose the format of the VDI if none is explicitly
specified. This ensures backward compatibility with both current and future drivers.

### Specifying image formats for VDIs creation

If the supported image format is exposed to the client, then, when creating new VDI,
user can specify the desired format via the `sm_config` parameter `image-format=qcow2` (or
any format that is supported). If no format is specified, the driver will use its
preferred default format. If the specified format is not supported, an error will be
generated indicating that the SR does not support it. Here is how it can be achieved
using the XE CLI:

```bash
# xe vdi-create \
sr-uuid=cbe2851e-9f9b-f310-9bca-254c1cf3edd8 \
name-label="A new VDI" \
virtual-size=10240 \
sm-config:image-format=vhd
```

### Specifying image formats for VDIs migration

When migrating a VDI, an API client may need to specify the desired image format if
the destination SR supports multiple storage formats.

#### VDI pool migrate

To support this, a new parameter, `dest_img_format`, is introduced to
`VDI.pool_migrate`. This field accepts a string specifying the desired format (e.g., *qcow2*),
ensuring that the VDI is migrated in the correct format. The new signature of
`VDI.pool_migrate` will be
`VDI ref pool_migrate (session ref, VDI ref, SR ref, string, (string -> string) map)`.

If the specified format is not supported or cannot be used (e.g., due to size limitations),
an error will be generated. Validation will be performed as early as possible to prevent
disruptions during migration. These checks can be performed by examining the XAPI database
to determine whether the SR provided as the destination has a corresponding SM object with
the expected format. If this is not the case, a `format not found` error will be returned.
If no format is specified by the client, the destination driver will determine the appropriate
format.

```bash
# xe vdi-pool-migrate \
uuid=<VDI_UUID> \
sr-uuid=<SR_UUID> \
dest-img-format=qcow2
```

#### VM migration to remote host

A VDI migration can also occur during a VM migration. In this case, we need to
be able to specify the expected destination format as well. Unlike `VDI.pool_migrate`,
which applies to a single VDI, VM migration may involve multiple VDIs.
The current signature of `VM.migrate_send` is `(session ref, VM ref, (string -> string) map,
bool, (VDI ref -> SR ref) map, (VIF ref -> network ref) map, (string -> string) map,
(VGPU ref -> GPU_group ref) map)`. Thus there is already a parameter that maps each source
VDI to its destination SR. We propose to add a new parameter that allows specifying the
desired destination format for a given source VDI: `(VDI ref -> string)`. It is
similar to the VDI-to-SR mapping. We will update the XE cli to support this new format.
It would be `image_format:<source-vdi-uuid>=<destination-image-format>`:

```bash
# xe vm-migrate \
host-uuid=<HOST_UUID> \
remote-master=<IP> \
remote-password=<PASS> \
remote-username=<USER> \
vdi:<VDI1_UUID>=<SR1_DEST_UUID> \
vdi:<VDI2_UUID>=<SR2_DEST_UUID> \
image-format:<VDI1_UUID>=vhd \
image-format:<VDI2_UUID>=qcow2 \
uuid=<VM_UUID>
```
The destination image format would be a string such as *vhd*, *qcow2*, or another
supported format. It is optional to specify a format. If omitted, the driver
managing the destination SR will determine the appropriate format.
As with VDI pool migration, if this parameter is not supported by the SM driver,
a `format not found` error will be returned. The validation must happen before
sending a creation message to the SM driver, ideally at the same time as checking
whether all VDIs can be migrated.

To be able to check the format, we will need to modify `VM.assert_can_migrate` and
add the mapping from VDI references to their image formats, as is done in `VM.migrate_send`.

# Impact

- **Data Model:** A new field (`supported-image-formats`) is added to the SM records.
It should have no impact on existing storage repositories that do not provide any information
about the supported image format.

This change impacts the SM data model, and as such, the XAPI database version will
be incremented. It also impacts the API.

- **Data Model:**
- A new field (`supported_image_formats`) is added to the SM records.
- A new parameter is added to `VM.migrate_send`: `(VDI ref -> string) map`
- A new parameter is added to `VM.assert_can_migrate`: `(VDI ref -> string) map`
- A new parameter is added to `VDI.pool_migrate`: `string`
- **Client Awareness:** Clients like the `xe` CLI will now be able to query and display the supported image formats for a given SR.
- **Database Versioning:** The XAPI database version will be updated to reflect this change.

16 changes: 14 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,17 @@
(name xapi-nbd))

(package
(name xapi-log))
(name xapi-log)
(synopsis "A Logs library required by xapi")
(description
"This package is provided for backwards compatibility only. No new package should use it.")
(depends
astring
fmt
logs
mtime
xapi-backtrace
(xapi-stdext-pervasives (= :version))))

(package
(name xapi-idl))
Expand Down Expand Up @@ -651,6 +661,7 @@
(= :version))
(xapi-stdext-threads
(= :version))
(xapi-tracing (= :version))
(odoc :with-doc)))

(package
Expand All @@ -669,7 +680,8 @@
ppx_deriving_rpc
rpclib
(xapi-stdext-threads
(= :version))))
(= :version))
(xapi-tracing (= :version))))

(package
(name message-switch))
Expand Down
25 changes: 5 additions & 20 deletions ocaml/idl/datamodel_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -532,28 +532,10 @@ let _ =
"You attempted an operation on a VM which requires a more recent version \
of the PV drivers. Please upgrade your PV drivers."
() ;
error Api_errors.vm_lacks_feature_shutdown ["vm"]
~doc:
"You attempted an operation which needs the cooperative shutdown feature \
on a VM which lacks it."
() ;
error Api_errors.vm_lacks_feature_vcpu_hotplug ["vm"]
~doc:
"You attempted an operation which needs the VM hotplug-vcpu feature on a \
VM which lacks it."
() ;
error Api_errors.vm_lacks_feature_suspend ["vm"]
~doc:
"You attempted an operation which needs the VM cooperative suspend \
feature on a VM which lacks it."
() ;
error Api_errors.vm_lacks_feature_static_ip_setting ["vm"]
~doc:
"You attempted an operation which needs the VM static-ip-setting feature \
on a VM which lacks it."
() ;
error Api_errors.vm_lacks_feature ["vm"]
~doc:"You attempted an operation on a VM which lacks the feature." () ;
error Api_errors.vm_non_suspendable ["vm"; "reason"]
~doc:"You attempted an operation on a VM which is not suspendable." () ;
error Api_errors.vm_is_template ["vm"]
~doc:"The operation attempted is not valid for a template VM" () ;
error Api_errors.other_operation_in_progress ["class"; "object"]
Expand Down Expand Up @@ -2068,6 +2050,9 @@ let _ =
enable it in XC or run xe pool-enable-tls-verification instead."
() ;

error Api_errors.sysprep ["vm"; "message"]
~doc:"VM.sysprep error with details in the message" () ;

message
(fst Api_messages.ha_pool_overcommitted)
~doc:
Expand Down
10 changes: 5 additions & 5 deletions ocaml/idl/datamodel_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ let create_params =
param_type= Bool
; param_name= "ssh_enabled"
; param_doc= "True if SSH access is enabled for the host"
; param_release= numbered_release "25.20.0-next"
; param_release= numbered_release "25.21.0"
; param_default= Some (VBool Constants.default_ssh_enabled)
}
; {
Expand All @@ -1314,7 +1314,7 @@ let create_params =
"The timeout in seconds after which SSH access will be automatically \
disabled (0 means never), this setting will be applied every time the \
SSH is enabled by XAPI"
; param_release= numbered_release "25.20.0-next"
; param_release= numbered_release "25.21.0"
; param_default= Some (VInt Constants.default_ssh_enabled_timeout)
}
; {
Expand All @@ -1323,7 +1323,7 @@ let create_params =
; param_doc=
"The time in UTC after which the SSH access will be automatically \
disabled"
; param_release= numbered_release "25.20.0-next"
; param_release= numbered_release "25.21.0"
; param_default= Some (VDateTime Date.epoch)
}
; {
Expand All @@ -1332,7 +1332,7 @@ let create_params =
; param_doc=
"The timeout in seconds after which idle console will be automatically \
terminated (0 means never)"
; param_release= numbered_release "25.20.0-next"
; param_release= numbered_release "25.21.0"
; param_default= Some (VInt Constants.default_console_idle_timeout)
}
]
Expand All @@ -1348,7 +1348,7 @@ let create =
kept for host joined a pool"
)
; ( Changed
, "25.20.0-next"
, "25.21.0"
, "Added --ssh_enabled --ssh_enabled_timeout --ssh_expiry \
--console_idle_timeout options to allow them to be configured for \
new host"
Expand Down
4 changes: 3 additions & 1 deletion ocaml/idl/datamodel_lifecycle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,16 @@ let prototyped_of_message = function
Some "25.2.0"
| "host", "set_numa_affinity_policy" ->
Some "24.0.0"
| "VM", "sysprep" ->
Some "25.24.0"
| "VM", "get_secureboot_readiness" ->
Some "24.17.0"
| "VM", "set_uefi_mode" ->
Some "24.17.0"
| "VM", "restart_device_models" ->
Some "23.30.0"
| "VM", "call_host_plugin" ->
Some "25.21.0-next"
Some "25.22.0"
| "VM", "set_groups" ->
Some "24.19.1"
| "pool", "set_console_idle_timeout" ->
Expand Down
11 changes: 11 additions & 0 deletions ocaml/idl/datamodel_vm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2211,6 +2211,7 @@ let operations =
; ("reverting", "Reverting the VM to a previous snapshotted state")
; ("destroy", "refers to the act of uninstalling the VM")
; ("create_vtpm", "Creating and adding a VTPM to this VM")
; ("sysprep", "Performing a Windows sysprep on this VM")
]
)

Expand Down Expand Up @@ -2369,6 +2370,15 @@ let restart_device_models =
~allowed_roles:(_R_VM_POWER_ADMIN ++ _R_CLIENT_CERT)
()

let sysprep =
call ~name:"sysprep" ~lifecycle:[]
~params:
[
(Ref _vm, "self", "The VM")
; (String, "unattend", "XML content passed to sysprep")
]
~doc:"Pass unattend.xml to Windows sysprep" ~allowed_roles:_R_VM_ADMIN ()

let vm_uefi_mode =
Enum
( "vm_uefi_mode"
Expand Down Expand Up @@ -2571,6 +2581,7 @@ let t =
; set_blocked_operations
; add_to_blocked_operations
; remove_from_blocked_operations
; sysprep
]
~contents:
([
Expand Down
2 changes: 1 addition & 1 deletion ocaml/idl/schematest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let hash x = Digest.string x |> Digest.to_hex
(* BEWARE: if this changes, check that schema has been bumped accordingly in
ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *)

let last_known_schema_hash = "4cd835e2557dd7b5cbda6c681730c447"
let last_known_schema_hash = "9cd32d98d092440c36617546a3d995bd"

let current_schema_hash : string =
let open Datamodel_types in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/libs/log/test/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(executable
(name log_test)
(libraries log xapi-stdext-threads threads.posix xapi-backtrace))
(libraries log threads.posix xapi-backtrace))

(cram
(package xapi-log)
Expand Down
6 changes: 5 additions & 1 deletion ocaml/libs/log/test/log_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ let a = [||]

let buggy () = a.(1) <- 0

let with_lock mutex f =
let finally () = Mutex.unlock mutex in
Mutex.lock mutex ; Fun.protect ~finally f

let () =
Printexc.record_backtrace true ;
Debug.log_to_stdout () ;
()
|> Debug.with_thread_associated "main" @@ fun () ->
try Xapi_stdext_threads.Threadext.Mutex.execute m buggy
try with_lock m buggy
with e ->
D.log_backtrace e ;
D.warn "Got exception: %s" (Printexc.to_string e)
2 changes: 1 addition & 1 deletion ocaml/libs/log/test/log_test.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[|error||0 |main|backtrace] 1/4 log_test.exe Raised at file ocaml/libs/log/test/log_test.ml, line 7
[|error||0 |main|backtrace] 2/4 log_test.exe Called from file fun.ml, line 33
[|error||0 |main|backtrace] 3/4 log_test.exe Called from file fun.ml, line 38
[|error||0 |main|backtrace] 4/4 log_test.exe Called from file ocaml/libs/log/test/log_test.ml, line 14
[|error||0 |main|backtrace] 4/4 log_test.exe Called from file ocaml/libs/log/test/log_test.ml, line 18
[|error||0 |main|backtrace]
[| warn||0 |main|log_test.ml] Got exception: Invalid_argument("index out of bounds")

Loading
Loading