Skip to content

Commit b2cbd68

Browse files
committed
Merge branch 'master' into feature/trusted-certs
2 parents 7fd25d7 + 5a326ad commit b2cbd68

33 files changed

Lines changed: 810 additions & 225 deletions

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
ocaml-version: "4.14.2"
3333
experimental: true
3434
- runs-on: "ubuntu-22.04"
35-
ocaml-version: "5.4.0"
35+
ocaml-version: "5.4.1"
3636
experimental: true
3737

3838
continue-on-error: ${{ matrix.experimental }}

doc/content/design/external-auth-ldaps.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,21 @@ client ldap sasl wrapping = <ldaps | seal>
180180
tls verify peer = ca_and_name_if_available
181181
tls trust system cas = yes
182182
tls cafile = /etc/trusted-certs/ca-bundle-[ldaps|general].pem
183+
tls priority = NONE:+VERS-TLS1.2:+AES-256-GCM:+AES-128-GCM:+AEAD:+ECDHE-RSA:+SIGN-ALL:+GROUP-SECP384R1:+COMP-NULL:%SERVER_PRECEDENCE
183184
```
184185

185186
- Switch between `ldap` and `ldaps` will flip `client ldap sasl wrapping` between `seal` and `ldaps`
186187
- `tls cafile` points to a CA bundle used to verify DC certs. Details refer to 4.1.2
188+
- `tls priority` is following stunnel TLS configuration, this result to TLS 1.2 with cipher suite TLS_ECDHE_RSA_AES_128_GCM_SHA256, TLS_ECDHE_RSA_AES_256_GCM_SHA384, Windows Server 2008R2 and later as DC support it
189+
- NONE: starts with empty set
190+
- +VERS-TLS1.2: Enbale TLS 1.2
191+
- +AES-256-GCM:+AES-128-GCM: Enable AES-256-GCM and AES-128-GCM cipher
192+
- +AEAD: Enable AEAD MAC, required for GCM
193+
- +ECDHE-RSA: Enable ECDHE-RSA key exchange
194+
- +SIGN-ALL: Enable all signature algorithms, this will limit to TLS1.2
195+
- +GROUP-SECP384R1: Enable secp384r1 curve
196+
- +COMP-NULL: No compression (required in modern TLS)
197+
- %SERVER_PRECEDENCE: Server chooses cipher order
187198

188199
#### 4.1.2 Certificate Selection
189200

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: Migration Stream Compression inside XenGuest
3+
layout: default
4+
design_doc: true
5+
revision: 1
6+
status: proposed
7+
---
8+
# Migration Stream Compression inside XenGuest
9+
10+
To reduce VM migration time, we want to compress the VM migration data
11+
stream. This document describes a new approach that might replace an
12+
existing feature, described first below.
13+
14+
## Existing Stream Compression
15+
16+
Xapi implements external migration stream compression. This uses an
17+
external zstd process each to compress (source) and decompress
18+
(destination) the VM and GPU streams, restively. The compression is
19+
transparent to the underlying daemons like XenGuest and vgpu/demu. It is
20+
controlled by an optional boolean parameter `compress` to the VM.migrate
21+
API/XE call. When not explicitly provided, a boolean pool parameter
22+
`Pool.migration_compression` is used. The current default (false) is to
23+
not use use compression for migration. A pool-level default simplifies
24+
managing the policy to use for migration compared to a host-level
25+
default.
26+
27+
This feature requires to communicate the use of compression to the
28+
receiving host such that it can set up the decompression; this is done
29+
using cookies. Both VM and GPU memory is compressed during VM migration.
30+
31+
Benchmarking found that this compression scheme is only beneficial when
32+
using slow networks (like 10Gb Ethernet). It comes with considerable
33+
internal overhead from using processes and pipe communication for the
34+
compression and decompression work. That is the reason stream
35+
compression is not enabled by default.
36+
37+
The main implementation of the feature (with some changes added later)
38+
is in commit:
39+
40+
* f14fb91137197f24a4784612dd0f2d863ee22fb1
41+
* CP-39640/CP-39157 Add stream compression for VM migration
42+
43+
## XenGuest-based Stream Compression
44+
45+
This design is about adding an alternative stream compression. This one
46+
is implemented inside XenGuest such that the stream it produces is
47+
internally using compression. XenGuest is not using an external process
48+
for this and hence incurs less overhead because no process
49+
intercommunication is required. Benchmarking confirmed the performance
50+
advantage of this architecture.
51+
52+
The use of compression on the source side needs to be signaled by
53+
Xenopsd via a command line argument to emu0manager and XenGuest. On the
54+
receiving side XenGuest will recognise the compressed stream and does
55+
not require special signaling.
56+
57+
Xapi only permits migration from older to newer versions of the Xapi
58+
Toolstack. This implies that no older XenGuest version will ever receive
59+
a potentially compressed stream that it would not be equipped to handle.
60+
For backward compatibility, xapi still needs to be able to receive a
61+
compressed migration stream using external compression - even if future
62+
Xapi implementation chose no longer to create them.
63+
64+
Currently only the stream created by XenGuest would use compression, but
65+
not the stream containing GPU data created by vgpu/demu. This might
66+
change in the future when we decide to implement in-stream compression
67+
there, too.
68+
69+
Theoretically, internal compression implemented in XenGuest and existing
70+
external compression are independent and could be used both. However,
71+
this would apply a compression to an already compressed stream, which is
72+
unlikely to be effective and we don't plan to support this feature.
73+
74+
## API Design
75+
76+
* VM.pool_migrate API and `xe vm-migrate` remain unchanged. Both accept
77+
an optional boolean value that indicates whether to use compression or
78+
not. In the absence of this parameter, the default is taken from
79+
`Pool.migration_compression` (which is currently `false`).
80+
81+
* The compression method used when `Pool.migration_compression=true` is
82+
*not* controlled by the API or the customer but is controlled by a
83+
default in xenopsd which can be changed in xenopd.conf for testing.
84+
85+
In summary, this means the API and XE CLI interface remain unchanged.
86+
87+
## Implementation
88+
89+
Outside the changes described here, the following other components are
90+
affected:
91+
92+
* EMU Manager needs to accept a new flag to indicated that compression
93+
is used during migration.
94+
95+
* XenGuest needs to accept a flag passed by EMU Manager to use
96+
compression.
97+
98+
## Upgrade
99+
100+
Xapi will always accept stream/external compressed migration streams but
101+
might stop using them for migration.
102+
103+
## Outlook
104+
105+
* We might add internal compression to vGPU migration in the future. The
106+
API would be unaffected by this.
107+
108+
* The current design forces all destinations to accept all compression
109+
streams because compatibility is not negotiate between source and
110+
destination. This is a general problem and not limited to compression.
111+
We could expose a general table to clients that lists features
112+
supported by xenopsd such that any other xenopsd would send data in
113+
the preferred format.

ocaml/idl/datamodel.ml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8925,6 +8925,23 @@ module Message = struct
89258925
~params:[(Set (Ref _message), "messages", "Messages to destroy")]
89268926
~allowed_roles:_R_POOL_OP ()
89278927

8928+
let destroy_all =
8929+
call ~name:"destroy_all" ~lifecycle:[]
8930+
~params:
8931+
[
8932+
( Map (String, String)
8933+
, "filters"
8934+
, "Optional filters identifying messages to destroy: before (RFC3339 \
8935+
DateTime, destroy messages dated before this timestamp), after \
8936+
(RFC3339 DateTime, destroy messages dated after this timestamp), \
8937+
and priority (int, only destroy messages with this priority). All \
8938+
provided conditions must be met (logical AND). If no filters are \
8939+
provided, all messages are destroyed. If no timezone is specified \
8940+
in a timestamp, UTC is assumed."
8941+
)
8942+
]
8943+
~allowed_roles:_R_POOL_OP ()
8944+
89288945
let get_all =
89298946
call ~name:"get_all"
89308947
~lifecycle:[(Published, rel_orlando, "")]
@@ -9012,6 +9029,7 @@ module Message = struct
90129029
create
90139030
; destroy
90149031
; destroy_many
9032+
; destroy_all
90159033
; get
90169034
; get_all
90179035
; get_since

ocaml/idl/datamodel_errors.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,11 @@ let _ =
893893
again."
894894
() ;
895895
error Api_errors.pool_joining_pool_cannot_enable_clustering_on_vlan_network
896-
["vlan"] ~doc:"The remote pool cannot enable clustering on vlan network" () ;
896+
["vlan"]
897+
~doc:
898+
"The host attempted to join a pool with clustering enabled on a \
899+
non-management VLAN network, which is not supported."
900+
() ;
897901
error Api_errors.pool_joining_host_must_have_only_one_IP_on_clustering_network
898902
[]
899903
~doc:

ocaml/idl/datamodel_lifecycle.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ let prototyped_of_message = function
233233
Some "24.14.0"
234234
| "PCI", "disable_dom0_access" ->
235235
Some "24.14.0"
236+
| "message", "destroy_all" ->
237+
Some "26.5.0-next"
236238
| "message", "destroy_many" ->
237239
Some "22.19.0"
238240
| "VTPM", "set_contents" ->

ocaml/libs/stunnel/stunnel.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ let pool =
152152
; crl_dir= None
153153
}
154154
155+
let world = {appliance with cert_bundle_path= "/etc/ssl/certs/ca-bundle.crt"}
156+
155157
let external_host ext_host_cert_file =
156158
{
157159
sni= None

ocaml/libs/stunnel/stunnel.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ val appliance : verification_config
6060

6161
val pool : verification_config
6262

63+
val world : verification_config
64+
6365
val external_host : string -> verification_config
6466

6567
val with_connect :

ocaml/libs/stunnel/stunnel_client.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ let pool () = get_verification_config Stunnel.pool
3333

3434
let appliance () = get_verification_config Stunnel.appliance
3535

36+
let world () = get_verification_config Stunnel.world
37+
3638
let external_host cert_file =
3739
Stunnel.external_host cert_file |> get_verification_config
3840

ocaml/libs/stunnel/stunnel_client.mli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ val appliance : unit -> Stunnel.verification_config option
2424
(** [appliance ()] returns the configuration that's meant to be used to connect
2525
to appliances providing services, like WLB or a licensing server. *)
2626

27+
val world : unit -> Stunnel.verification_config option
28+
(** [world ()] returns the configuration that performs chain
29+
verification using the system's default CA trust store
30+
(/etc/ssl/certs/ca-bundle.crt). *)
31+
2732
val external_host : string -> Stunnel.verification_config option
2833
(** [external_host path] returns the configuration that's meant to be used to connect to
2934
a xapi hosts outside the pool. This is useful, for example, to provide an

0 commit comments

Comments
 (0)