Skip to content

Update feature/perf from master #5913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 219 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 176 commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
9291f21
CA-394343: After clock jump the xapi assumed the host is HOST_OFFLINE
minglumlu Jun 18, 2024
47a3f7d
Merge pull request #5798 from BengangY/private/bengangy/merge-master-…
minglumlu Jul 11, 2024
c024eee
Merge branch 'master' into private/bengangy/merge-master-to-non-cdn-u…
BengangY Jul 13, 2024
591916d
Merge pull request #5824 from BengangY/private/bengangy/merge-master-…
minglumlu Jul 15, 2024
6220147
CP-49212: Update datamodel for non-CDN update
BengangY Jul 15, 2024
4824a91
CP-49212: Add UT for update datamodel for non-CDN update
BengangY Jul 13, 2024
20136cd
Merge pull request #5764 from BengangY/private/bengangy/CP-49212
minglumlu Jul 16, 2024
f4e944f
CA-395512: process SMAPIv3 API calls concurrently (default off)
edwintorok Jul 10, 2024
459f683
CP-49213: Add new tar unpacking module
BengangY Jul 1, 2024
a9b0ef7
CP-49213: UT for add new tar unpacking module
BengangY Jul 1, 2024
bfa96cb
Merge pull request #5787 from BengangY/private/bengangy/CP-49213
minglumlu Jul 17, 2024
ccc0f31
vhd-tool, xen-api-client: Remove duplicated cohttp_unbuffered_io module
Jul 18, 2024
6e5893b
vhd-tool, ezxenstore: Remove duplicate xenstore module
Jul 18, 2024
56ef633
Fix Short/Long duration printing
edwintorok Jul 1, 2024
857be9e
forkexecd: do not clip commandline in logs
edwintorok Jul 3, 2024
fda9275
Merge pull request #5856 from last-genius/private/asultanov/duplicate…
psafont Jul 19, 2024
71c3960
CA-395174: Try to unarchive VM's metrics when they aren't running
psafont Jul 8, 2024
7fe1955
rrdd_proxy: Change *_at to specify the IP address
psafont Jul 8, 2024
6bb7702
rrdd_proxy: Use Option to encode where VMs might be available at
psafont Jul 8, 2024
110c112
http-lib: avoid double-queries to the radix tree
psafont Jul 18, 2024
3658806
rrdd_proxy: Return 400 on bad vm request
psafont Jul 19, 2024
c60e482
CA-394148: Fix dry-run handling in xe-restore-metadata
alexbrett Jul 16, 2024
0270f25
CA-393578: Fix vbd cleanup in metadata scripts
alexbrett Jul 16, 2024
6fb7738
CA-383491: [Security fix] Use debugfs on xe-restore-metadata probes
Sep 25, 2023
f51cb8c
Updates to Portable SR Functionality
alexbrett Jul 16, 2024
0a11d0b
Fixes for shellcheck
alexbrett Jul 16, 2024
2189996
Remove unused `yes` parameter in xe-backup-metadata
alexbrett Jul 19, 2024
4c77a5e
IH-662: Add tests for Helpers.filter_args
Jul 22, 2024
c148dbd
IH-662 - helpers.ml: Move to a threadsafe Re.Pcre instead of Re.Str
Jul 22, 2024
8337fa9
Remove ineffectual parameter wiping (#5868)
Jul 22, 2024
3026754
Merge pull request #5862 from edwintorok/private/edvint/epoll4.0-cleanup
psafont Jul 22, 2024
f39ea99
CP-47536: Drop posix_channel and channel_helper: unused and a mix of …
edwintorok Jul 22, 2024
d3460a3
opam: dunify vhd-tool's metadata
psafont Jul 22, 2024
541c03d
CP-47536: replace Protocol_unix.scheduler.Delay with Threadext.Delay
edwintorok May 10, 2024
d9590a0
fix(xapi-idl): replace PipeDelay with Delay, avoid another Thread.wai…
edwintorok Jun 10, 2024
0a92794
Merge pull request #5863 from edwintorok/private/edvint/epoll4.0-drop
edwintorok Jul 22, 2024
e60aeb5
Merge pull request #5807 from edwintorok/private/edvint/listen_p
edwintorok Jul 22, 2024
9e33053
Merge pull request #5872 from psafont/dune-vhd-tool
psafont Jul 22, 2024
54abab8
Merge pull request #5855 from psafont/rrd-unpack
psafont Jul 22, 2024
b411adc
Merge pull request #5861 from edwintorok/private/edvint/epoll4.0-delay
edwintorok Jul 22, 2024
4f587b0
opam: dunify message-switch-unix's metadata
psafont Jul 22, 2024
d88017e
IH-507: xapi_xenops: raise an error when the kernel isn't allowed
psafont Jul 22, 2024
5dc2900
IH-507: Do not allow guest kernels in /boot/
psafont Jul 23, 2024
090e846
Merge pull request #5700 from minglumlu/private/mingl/CA-394343
psafont Jul 23, 2024
1c92485
Merge pull request #5875 from psafont/dune-mswitch
psafont Jul 23, 2024
ba3f0e7
CP-50181: Percent decode all Uri paths before using them
Jul 22, 2024
1d0aae5
Merge pull request #5874 from psafont/private/paus/minions
psafont Jul 23, 2024
a7b7a26
[maintenance] bump minimum dune language version to 3.7
edwintorok Mar 20, 2023
5353e3e
[maintenance]: bump dune language version to 3.15
edwintorok Jul 23, 2024
d802d43
[maintenance] regenerate opam after dune version bump
edwintorok Mar 20, 2023
197adc9
[maintenance]: do not build bytecode versions of internal libraries
edwintorok Mar 20, 2023
ac6b7b4
[maintenance]: add server.mli
edwintorok Jul 22, 2024
ed78088
[maintenance]: xapi-aux does not need to depend on xapi-types
edwintorok Mar 20, 2023
f07b9d7
[maintenance]: preprocess only modules containing @@deriving
edwintorok Mar 20, 2023
d3869c1
[maintenance]: split server.ml into separate library
edwintorok Mar 20, 2023
bc1a58c
[maintenance]: remove API.API
edwintorok Mar 20, 2023
3f6228b
[maintenance]: remove dependency between most tests and server.ml
edwintorok Mar 20, 2023
f823835
[maintenance]: remove unneeded dependencies
edwintorok Jul 22, 2024
ebbc4c6
[maintenance]: break dependency of gen_api_main on xapi_version
edwintorok Jul 22, 2024
c8e828e
[maintenance]: xapi-types should not depend on xapi-idl
edwintorok Jul 22, 2024
9c85ed7
[maintenance]: use bytecode for gen_api_main
edwintorok Jul 22, 2024
bf35097
[maintenance]: further split xapi_internal_server
edwintorok Jul 22, 2024
62ff5e7
[maintenance]: reduce basic-rpc-test time
edwintorok Mar 20, 2023
7530d5e
[maintenance]: try to reconnect to message-switch every 0.5s
edwintorok Mar 20, 2023
a6406ea
[maintenance]: add back the 5s message-switch test as a stresstest
edwintorok Jul 24, 2024
bc549cd
Merge pull request #5876 from edwintorok/private/edvint/maintenance2
edwintorok Jul 24, 2024
e5fa761
maintenance: delete unused fields
psafont Jul 24, 2024
9fd09c8
datamodel_lifecycle: automated bump
psafont Jul 24, 2024
adf27d5
Merge pull request #5880 from psafont/nowarns
psafont Jul 25, 2024
cd16298
maintenance: restore dune utop
psafont Jul 25, 2024
e2c0ac6
xapi: update mirage-crypto version
psafont Jul 5, 2024
34ee1ef
mirage-rng: Initialize it only in tests and selfcert
psafont Jul 23, 2024
842de7b
Merge pull request #5882 from psafont/utop
psafont Jul 25, 2024
231bb73
Merge pull request #5878 from psafont/up
psafont Jul 26, 2024
f4b9bcf
clock: use external qcheck-alcotest
psafont Jul 26, 2024
afe5fec
Merge pull request #5885 from psafont/qcheck-core
psafont Jul 26, 2024
eb58c7d
CP-50448: move quickcheck tests into internal libraries
edwintorok Jul 25, 2024
efcb7af
CP-50448: run the QuickCheck tests in QuickTest
edwintorok Jul 25, 2024
0623d8d
Catch system exit in observer.py to close gracefully
snwoods Jul 22, 2024
a03b3da
Merge branch 'master' into private/bengangy/merge-master-to-non-cdn-u…
BengangY Jul 29, 2024
d7682dc
Merge pull request #5889 from BengangY/private/bengangy/merge-master-…
gangj Jul 29, 2024
7dfcd28
CP-49214: Upload and sync bundle file
BengangY Jul 24, 2024
3dff387
CP-49214: Allowed operations for sync bundle
BengangY Jul 24, 2024
8f4c71b
CP-49214: UT for upload and sync bundle file
BengangY Jul 24, 2024
c870b26
CP-49214: Refactor cli_operations
BengangY Jul 24, 2024
76b3db6
Merge pull request #5884 from edwintorok/private/edvint/ci-to-quicktest
edwintorok Jul 29, 2024
29344a7
CP-49876: Create spans for observer.py itself
snwoods Jul 22, 2024
5c68118
Merge pull request #5851 from BengangY/private/bengangy/CP-49214
gangj Jul 30, 2024
670cb99
CP-50121: Remove bc package from XS9 dom0
DeliZhangX Jul 29, 2024
f7860c7
dune: declare stresstests dependencies
psafont Jul 30, 2024
bc7e730
Merge pull request #5891 from DeliZhangX/private/deliz/CP-50121
liulinC Jul 31, 2024
f7d087b
Merge pull request #5877 from last-genius/private/asultanov/uri-path
last-genius Jul 31, 2024
83cded6
Update qcheck-alcotest dependencies
edwintorok Jul 31, 2024
4fd5242
docs: add design documents for certificate-related features
psafont Jul 29, 2024
1be062b
Merge pull request #5892 from psafont/stressdune
psafont Jul 31, 2024
9741ad4
Merge pull request #5898 from edwintorok/master
psafont Jul 31, 2024
39199a5
CA-396479: Use default value for unknown enums in Java
danilo-delbusso Jul 31, 2024
eb34314
Default to "UNRECOGNIZED" when using `toString()` of Type enums
danilo-delbusso Jul 31, 2024
62db5cb
xapi-idl: Delete String.{explode,implode} functions
psafont May 23, 2024
bc511a3
xapi-idl: do not use custom operators for bit manipulations
psafont May 24, 2024
4b691d1
xapi-idl: Refactor out find_index and add it to Listext
psafont May 24, 2024
57bb11e
CP-50426: Factor out module signature prefix
Jul 31, 2024
8827140
CP-50426: Propagate __context in Auth_signature
Jul 31, 2024
4acf937
CP-50426: Add tracing to external auth functions
Jul 31, 2024
10e6156
ci: use the names of binaries, not libraries in stresstests
psafont Aug 1, 2024
787a01e
Merge pull request #5902 from psafont/runs
psafont Aug 1, 2024
6159aa3
Merge pull request #5901 from contificate/CP-50426
Aug 1, 2024
4ab22bc
CA-395789: Add polling to cluster health state update
Vincent-lau Jul 16, 2024
3efc36a
Merge pull request #5881 from psafont/xen_types
psafont Aug 2, 2024
58a1420
Add more detailed debug message
Vincent-lau Aug 1, 2024
b33c0a7
ci: Avoid breaking through the opam sandbox in tests
psafont Aug 2, 2024
3c6d064
Merge pull request #5905 from psafont/private/paus/osandbox
psafont Aug 2, 2024
195f932
Merge pull request #5871 from Vincent-lau/private/shul2/health-poll
Vincent-lau Aug 2, 2024
00e4457
ci: use ocaml-setup v3
psafont Aug 2, 2024
f8ac0cb
ci: Do not spend time pinning packages
psafont Aug 2, 2024
a849c1d
Merge pull request #5906 from psafont/ci
psafont Aug 2, 2024
f66981b
CA-389345: fix incorrect data type in python3
chunjiez Aug 5, 2024
6d8d219
CP-50444: New `with_child_trace` function added to `tracing.ml`
edwintorok Jul 25, 2024
c37859d
CP-50444: Intrument `http_svr`
GabrielBuica Jul 23, 2024
a4bbf25
Merge branch 'master' into private/asultanov/restr_removal
last-genius Aug 5, 2024
4ac5dec
CP-49526: Resolve non-CDN design comments
BengangY Aug 2, 2024
65e35bc
CA-396540: Add API error for bundle syncing failure
BengangY Aug 2, 2024
3673379
Merge pull request #5869 from last-genius/private/asultanov/restr_rem…
psafont Aug 5, 2024
a836eb3
Merge pull request #5890 from psafont/certdocs
psafont Aug 5, 2024
cb3cd2d
CI: use ubuntu-22.04 for SDK too
edwintorok Aug 5, 2024
aeeade1
CI: avoid mixing caches from different OSes
edwintorok Aug 5, 2024
2097a16
Merge pull request #5912 from edwintorok/master
edwintorok Aug 5, 2024
5fa500c
Merge pull request #5904 from BengangY/private/bengangy/non-cdn-bug-fix
minglumlu Aug 6, 2024
82bff7e
Merge branch 'master' into feature/non-cdn-update
BengangY Aug 6, 2024
ecafbe5
Merge pull request #5909 from chunjiez/master
minglumlu Aug 6, 2024
bc76f7c
Merge pull request #5870 from snwoods/private/stevenwo/CP-49876
snwoods Aug 6, 2024
6ebdd14
openvswitch-config-update: fix python2ism in python3
ydirson Aug 7, 2024
ccf3882
Merge pull request #5918 from xcp-ng/fix-openvswitch
liulinC Aug 8, 2024
31e29c1
CA-396635: Wait for corosync to update its info
Vincent-lau Aug 2, 2024
714cd53
CP-50518: Add stub for crypt_r to ocaml/auth
Aug 6, 2024
e405431
CP-50518: Add quicktests for crypt_r
Aug 6, 2024
727592b
CP-50518: Add safer crypt API to Pam
Aug 8, 2024
a41c3fe
Merge pull request #5916 from contificate/crypt_r
Aug 8, 2024
07db59a
CP-50444: Intrument `request_of_bio`
GabrielBuica Jul 23, 2024
3fbcfb1
tracing: fix `make check` warnings
GabrielBuica Jul 29, 2024
fcb7818
tracing: increase the default maximum number of spans in a trace
GabrielBuica Jul 30, 2024
0fd7d6b
CP-50444: Add specialized function for tracing http requests to `Http…
GabrielBuica Aug 1, 2024
cc90d32
Output if parameter is required in JSON backend
Aug 9, 2024
cc66500
Merge pull request #5888 from GabrielBuica/private/dbuica/CP-50444
last-genius Aug 9, 2024
15f2a17
CP-49217: Update datamodel_lifecycle
BengangY Aug 12, 2024
a61b853
CP-49217: Update schem in Cli_operations.pool_sync_bundle
BengangY Aug 12, 2024
458f1cc
Merge pull request #5927 from BengangY/private/bengangy/CP-49217
minglumlu Aug 12, 2024
95014a7
Merge branch 'xapi-project:feature/non-cdn-update' into feature/non-c…
BengangY Aug 12, 2024
571832e
Python SDK: Move "Packaging" section out of the public docs
edwintorok Aug 12, 2024
2f7d39c
Merge pull request #5926 from contificate/is_required_param
Aug 12, 2024
f72aff2
Merge pull request #5928 from edwintorok/private/edvint/pysdk
Aug 13, 2024
6b85e87
Allow remediation commits for DCO
Aug 13, 2024
2b3a0a6
CI: fix spurious failure on busy system
edwintorok Aug 13, 2024
47cc0de
Merge pull request #5931 from contificate/remediation
edwintorok Aug 13, 2024
f33d7f6
CA-397171: Replace libjemalloc.so.1 with libjemalloc.so.2
stephenchengCloud Aug 12, 2024
9256139
CA-392685: Replace /tmp/network-reset with /var/tmp/network-reset to…
ashwin9390 Aug 5, 2024
69ee5b9
Retroactively sign off 8337fa94b76097428621d1e1987
Aug 13, 2024
403cc51
Merge pull request #5934 from contificate/cleanse
edwintorok Aug 13, 2024
b33ceee
CA-396751: write updated RRDD data before headers
MarkSymsCtx Aug 6, 2024
42d0418
Merge pull request #5930 from stephenchengCloud/private/stephenche/CA…
edwintorok Aug 13, 2024
1a1d5ce
CP-49217: Bump up schema vsn
BengangY Aug 14, 2024
aae22a0
Merge pull request #5932 from edwintorok/private/edvint/sleepy
edwintorok Aug 14, 2024
fc89ed5
Merge pull request #5933 from ashwin9390/private/ashwin/CA-392685
liulinC Aug 14, 2024
09fe917
Merge pull request #5907 from Vincent-lau/private/shul2/coro-wait
Vincent-lau Aug 14, 2024
ce24e0a
CA-397268: vbd.create failed: The device name is invalid
minglumlu Aug 13, 2024
d04ba27
CA-397268: Add unit test for valid_device
minglumlu Aug 14, 2024
d5b3623
Quicktest: actually run the quickcheck tests too
edwintorok Aug 5, 2024
ac485b4
xapi-fd-test: fix compatibility with old losetup
edwintorok Aug 5, 2024
79b81dc
xapi-fd-test: fix BLK tests
edwintorok Aug 5, 2024
8f89e63
xapi-fd-test: fix BLK EBADF
edwintorok Aug 5, 2024
2bf0dd6
Quicktest: add unixext_test
edwintorok Aug 5, 2024
ccd8197
xapi_fd_test: introduce testable_file_kind
edwintorok Jul 29, 2024
aaec96d
xapi-fd-test: introduce with kind list
edwintorok Jul 29, 2024
60a47d4
xapi-fd-test: introduce testable_file_kinds
edwintorok Aug 5, 2024
592cc2d
xapi-fd-test: generate inputs for select
edwintorok Aug 5, 2024
a5ce54d
unixext_test: add test for select
edwintorok Aug 5, 2024
d9d3001
CP-32622: introduce select-as-epoll in Unixext
edwintorok Jul 18, 2024
5b756b2
xapi-fd-test: switch to testing Unixext.select
edwintorok Aug 5, 2024
9208739
CP-32622: Thread.wait_timed_read/wait_timed_write
edwintorok Jul 22, 2024
0fbc9d5
CP-51042: Raise error in sr-scan when SR.stat finds an unhealthy SR
Vincent-lau Aug 9, 2024
68f318b
Merge pull request #5939 from Vincent-lau/private/shul2/sr-scan-health
Vincent-lau Aug 16, 2024
d8ff15b
CP-49217: Refine test_tar_ext and add copyright
BengangY Aug 19, 2024
42f5d3f
Merge pull request #5914 from BengangY/feature/non-cdn-update
gangj Aug 19, 2024
9dab8fa
Add temporary exception for deprecation of `xmlStringDecodeEntities`
danilo-delbusso Aug 21, 2024
f91e90d
new-docs: Toggle hidden documentation only on header clicks
Aug 21, 2024
14c2bb1
Merge pull request #5947 from last-genius/private/asultanov/showhide-…
last-genius Aug 21, 2024
c40a48c
Revert "CP-51042: Raise error in sr-scan when SR.stat finds an unheal…
Vincent-lau Aug 21, 2024
393373c
Merge pull request #5946 from danilo-delbusso/dev/add-deprecation-exc…
kc284 Aug 22, 2024
9390123
Merge pull request #5948 from Vincent-lau/private/shul2/sr-scan-health
robhoes Aug 22, 2024
7303ce9
xenctrlext: remove xenforeignmemory module
psafont Aug 23, 2024
a73860f
IH-676: Add debug information for xe-cli's bash autocompletion
Aug 13, 2024
b0e2dd3
IH-676: Clean up autocompletion tech debt
Aug 13, 2024
da7ee28
IH-676: Remove autocompletion for deprecated VMPP functionality
Aug 15, 2024
16f042c
IH-676: Add a space before the vm-selectors help string.
Aug 13, 2024
8bfbb75
IH-676: Split main command completion into groups, then subcommands.
Aug 13, 2024
19547ed
IH-676: Add 'xe help' autocompletion
Aug 13, 2024
7c6501e
IH-676: Add autocompletion for data sources, group the suggested words
Aug 13, 2024
d921d41
IH-676: Add help strings to suggested commands
Aug 14, 2024
b9b39cd
IH-676: Add name labels to suggested UUIDs
Aug 14, 2024
6c8ac1a
IH-676: Add autocompletion for boolean parameters
Aug 15, 2024
6481ad0
IH-676: Fix autocompletion for 'type' param in vmss-related commands
Aug 15, 2024
7e6fcae
IH-676: Improve handling of selectors, records (with ':' as separators)
Aug 15, 2024
0ad6b20
IH-676: Don't suggest values for illegal parameters
Aug 15, 2024
a78633f
IH-676: Remove curly brackets when they're unnecessary
Aug 16, 2024
37e77d3
IH-676: Don't suggest deprecated parameters
Aug 16, 2024
6334cbd
IH-676: Do not suggest already entered parameters
Aug 16, 2024
8704c79
IH-676: Distinguish between required and optional parameters in autoc…
Aug 16, 2024
83f4397
IH-676: Add a Ctrl-r+q shortcut to insert names of required xe parame…
Aug 19, 2024
b6064f6
Merge pull request #5949 from psafont/strip_xfm
psafont Aug 23, 2024
b277b4f
Allow xapi_globs specifications with descriptions
Aug 20, 2024
bc72b76
CP-50053: Functionalise external authentication
Jul 25, 2024
839dfee
CP-50053: Add bounded priority search queue
Aug 13, 2024
74683dd
CP-50054: Add unit tests for bounded PSQ
Aug 14, 2024
2d49ad4
CP-50053: Add authentication cache
Aug 13, 2024
09ef43e
CP-50054: Add unit tests for authentication cache
Aug 15, 2024
2854357
CP-50053: Add concrete cache implementation
Aug 13, 2024
832d8e9
CP-50054: Add authentication cache options
Aug 13, 2024
6b2d4c7
Cache external authentication results
Aug 15, 2024
61ca8fb
Merge pull request #5910 from edwintorok/private/edvint/epoll-tests
edwintorok Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
allowRemediationCommits:
individual: true
thirdParty: true
3 changes: 1 addition & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ jobs:
run: sudo apt-get update

- name: Use ocaml
uses: ocaml/setup-ocaml@v2
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repositories: |
xs-opam: ${{ steps.dotenv.outputs.repository }}
dune-cache: true
opam-pin: false
opam-depext: false

- name: Install ocamlformat
run: opam install ocamlformat
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-and-build-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
generate-sdk-sources:
name: Generate SDK sources
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/setup-xapi-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ runs:
shell: bash
run: |
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env
cat /etc/os-release

- name: Download XE_SR_ERRORCODES.xml
shell: bash
Expand Down Expand Up @@ -42,15 +43,21 @@ runs:
echo "TMPDIR=${TMPDIR}" >>"$GITHUB_ENV"
echo "XDG_CACHE_HOME=${XDG_CACHE_HOME}" >>"$GITHUB_ENV"

- name: Get runner OS info
uses: kenchan0130/actions-system-info@master
id: system-info

# We set DUNE_CACHE_STORAGE_MODE, it is required for dune cache to work inside opam for now,
# otherwise it gets EXDEV and considers it a cache miss
- name: Use ocaml
uses: ocaml/setup-ocaml@v2
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repositories: |
xs-opam: ${{ steps.dotenv.outputs.repository }}
dune-cache: true
opam-pin: false
cache-prefix: v3-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}
env:
DUNE_CACHE_STORAGE_MODE: copy

Expand Down
4 changes: 3 additions & 1 deletion clock.opam
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
homepage: "https://xapi-project.github.io/"
bug-reports: "https://github.com/xapi-project/xen-api/issues"
depends: [
"dune" {>= "3.0"}
"dune" {>= "3.15"}
"ocaml" {>= "4.12"}
"alcotest" {with-test}
"astring"
"mtime"
"ptime"
"qcheck-core" {with-test}
"qcheck-alcotest" {with-test}
"odoc" {with-doc}
]
build: [
Expand Down
374 changes: 374 additions & 0 deletions doc/content/design/pool-certificates.md

Large diffs are not rendered by default.

271 changes: 271 additions & 0 deletions doc/content/design/user-certificates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
---
title: User-installable host certificates
layout: default
design_doc: true
revision: 2
status: released (8.2)
---

## Introduction

It is often necessary to replace the TLS certificate used to secure
communications to Xenservers hosts, for example to allow a XenAPI user such as
Citrix Virtual Apps and Desktops (CVAD) to validate that the host is genuine
and not impersonating the actual host.

Historically there has not been a supported mechanism to do this, and as a
result users have had to rely on guides written by third parties that show how
to manually replace the xapi-ssl.pem file on a host. This process is
error-prone, and if a mistake is made, can result in an unuseable system.
This design provides a fully supported mechanism to allow replacing the
certificates.

## Design proposal

It is expected that an API caller will provide, in a single API call, a private
key, and one or more certificates for use on the host. The key will be provided
in PKCS #8 format, and the certificates in X509 format, both in
base-64-encoded PEM containers.

Multiple certificates can be provided to cater for the case where an
intermediate certificate or certificates are required for the caller to be able
to verify the certificate back to a trusted root (best practice for Certificate
Authorities is to have an 'offline' root, and issue certificates from an
intermediate Certificate Authority). In this situation, it is expected (and
common practice among other tools) that the first certificate provided in the
chain is the host's unique server certificate, and subsequent certificates form
the chain.

To detect mistakes a user may make, certain checks will be carried out on the
provided key and certificate(s) before they are used on the host. If all checks
pass, the key and certificate(s) will be written to the host, at which stage a
signal will be sent to stunnel that will cause it to start serving the new
certificate.

## Certificate Installation

### API Additions

Xapi must provide an API call through Host RPC API to install host
certificates:

```ocaml
let install_server_certificate = call
~lifecycle:[Published, rel_stockholm, ""]
~name:"install_server_certificate"
~doc:"Install the TLS server certificate."
~versioned_params:
[{ param_type=Ref _host; param_name="host"; param_doc="The host"
; param_release=stockholm_release; param_default=None}
;{ param_type=String; param_name="certificate"
; param_doc="The server certificate, in PEM form"
; param_release=stockholm_release; param_default=None}
;{ param_type=String; param_name="private_key"
; param_doc="The unencrypted private key used to sign the certificate, \
in PKCS#8 form"
; param_release=stockholm_release; param_default=None}
;{ param_type=String; param_name="certificate_chain"
; param_doc="The certificate chain, in PEM form"
; param_release=stockholm_release; param_default=Some (VString "")}
]
~allowed_roles:_R_POOL_ADMIN
()
```

This call should be implemented within xapi, using the already-existing crypto
libraries available to it.

Analogous to the API call, a new CLI call `host-server-certificate-install`
must be introduced, which takes the parameters `certificate`, `key` and
`certificate-chain` - these parameters are expected to be filenames, from which
the key and certificate(s) must be read, and passed to the
`install_server_certificate` RPC call.

The CLI will be defined as:
```ocaml
"host-server-certificate-install",
{
reqd=["certificate"; "private-key"];
optn=["certificate-chain"];
help="Install a server TLS certificate on a host";
implementation=With_fd Cli_operations.host_install_server_certificate;
flags=[ Host_selectors ];
};
```

### Validation

Xapi must perform the following validation steps on the provided key and
certificate. If any validation step fails, the API call must return an error
with the specified error code, providing any associated text:

### Private Key

* Validate that it is a pem-encoded PKCS#8 key, use error
`SERVER_CERTIFICATE_KEY_INVALID []` and exposed as
"The provided key is not in a pem-encoded PKCS#8 format."

* Validate that the algorithm of the key is RSA, use error
`SERVER_CERTIFICATE_KEY_ALGORITHM_NOT_SUPPORTED, [<algorithms's ASN.1 OID>]`
and exposed as "The provided key uses an unsupported algorithm."

* Validate that the key length is ≥ 2048, and ≤ 4096 bits, use error
`SERVER_CERTIFICATE_KEY_RSA_LENGTH_NOT_SUPPORTED, [length]` and exposed as
"The provided RSA key does not have a length between 2048 and 4096."

* The library used does not support multi-prime RSA keys, when it's
encountered use error `SERVER_CERTIFICATE_KEY_RSA_MULTI_NOT_SUPPORTED []` and
exposed as "The provided RSA key is using more than 2 primes, expecting only
2"

#### Server Certificate
* Validate that it is a pem-encoded X509 certificate, use error
`SERVER_CERTIFICATE_INVALID []` and exposed as "The provided certificate is not
in a pem-encoded X509."

* Validate that the public key of the certificate matches the public key from
the private key, using error `SERVER_CERTIFICATE_KEY_MISMATCH []` and exposing
it as "The provided key does not match the provided certificate's public key."

* Validate that the certificate is currently valid. (ensure all time
comparisons are done using UTC, and any times presented in errors are using
ISO8601 format):

* Ensure the certificate's `not_before` date is ≤ NOW
`SERVER_CERTIFICATE_NOT_VALID_YET, [<NOW>; <not_before>]` and exposed as
"The provided certificate certificate is not valid yet."

* Ensure the certificate's `not_after` date is > NOW
`SERVER_CERTIFICATE_EXPIRED, [<NOW>; <not_after>]` and exposed as "The
provided certificate has expired."

* Validate that the certificate signature algorithm is SHA-256
`SERVER_CERTIFICATE_SIGNATURE_NOT_SUPPORTED []` and exposed as
"The provided certificate is not using the SHA256 (SHA2) signature algorithm."

#### Intermediate Certificates
* Validate that it is an X509 certificate, use
`SERVER_CERTIFICATE_CHAIN_INVALID []` and exposed as "The provided
intermediate certificates are not in a pem-encoded X509."

### Filesystem Interaction

If validation has been completed successfully, a temporary file must be created
with permissions 0x400 containing the key and certificate(s), in that order,
separated by an empty line.

This file must then be atomically moved to /etc/xensource/xapi-ssl.pem in
order to ensure the integrity of the contents. This may be done using rename
with the origin and destination in the same mount-point.

## Alerting

A daily task must be added. This task must check the expiry date of the first
certificate present in /etc/xensource/xapi-ssl.pem, and if it is within 30
days of expiry, generate a `message` to alert the administrator that the
certificate is due to expire shortly.

The body of the message should contain:
```
<body>
<message>
The TLS server certificate is expiring soon
</message>
<date>
<expiry date in ISO8601 'YYYY-MM-DDThh:mm:ssZ' format>`
</date>
</body>

```

The priority of the message should be based on the number of days to expiry as
follows:

| Number of days | Priority |
| -------------- | -------- |
| 0-7 | 1 |
| 8-14 | 2 |
| 14+ | 3 |

The other fields of the message should be:

| Field | Value |
| ----- | ----- |
| name | HOST_SERVER_CERTIFICATE_EXPIRING |
| class | Host |
| obj-uuid | < Host UUID > |

Any existing `HOST_SERVER_CERTIFICATE_EXPIRING` messages with this host's UUID
should be removed to avoid a build-up of messages.

Additionally, the task may also produce messages for expired server
certificates which must use the name `HOST_SERVER_CERTIFICATE_EXPIRED`.
These kind of message must contain the message "The TLS server certificate has
expired." as well as the expiry date, like the expiring messages.
They also may replace the existing expiring messages in a host.

## Expose Certificate metadata

Currently xapi exposes a CLI command to print the certificate being used to
verify external hosts. We would like to also expose through the API and the
CLI useful metadata about the certificates in use by each host.

The new class is meant to cover server certificates and trusted certificates.

### Schema

A new class, Certificate, will be added with the following schema:

| Field | Type | Notes |
| ---------- | --------- | ----- |
| uuid | |
| type | CA | Certificate trusted by all hosts
| | Host | Certificate that the host present sto normal clients
| name | String | Name, only present for trusted certificates
| host | Ref _host | Host where the certificate is installed
| not_before | DateTime | Date after which the certificate is valid
| not_after | DateTime | Date before which the certificate is valid
| fingerprint_sha256 | String | The certificate's SHA256 fingerprint / hash
| fingerprint_sha1 | String | The certificate's SHA1 fingerprint / hash

### CLI / API

There are currently-existing CLI parameters for certificates:
`pool-certificate-{install,uninstall,list,sync}`,
`pool-crl-{install,uninstall,list}` and `host-get-server-certificate`.

The new command must show the metadata of installed server certificates in
the pool.
It must be able to show all of them in the same call, and be able to filter
the certificates per-host.

To make it easy to separate it from the previous calls and to reflect that
certificates are a class type in xapi the call will be named `certificate-list`
and it will accept the parameter `host-uuid=<uuid>`.

## Recovery mechanism

In the case a certificate is let to expire TLS clients connecting to the host
will refuse establish the connection.
This means that the host is going to be unable to be managed using the xapi
API (Xencenter, or a CVAD control plane)

There needs to be a mechanism to recover from this situation.
A CLI command must be provided to install a self-signed certificate, in the
same way it is generated during the setup process at the moment.
The command will be `host-emergency-reset-server-certificate`.
This command is never to be forwarded to another host and will call openssl to
create a new RSA private key

The command must notify stunnel to make sure stunnel uses the newly-created
certificate.

# Miscellaneous

The auto-generated `xapi-ssl.pem` currently contains Diffie-Hellman (DH)
Parameters, specifically 512 bits worth. We no longer support any ciphers which
require DH parameters, so these are no longer needed, and it is acceptable for
them to be lost as part of installing a new certificate/key pair.

The generation should also be modified to avoid creating these for new
installations.
13 changes: 6 additions & 7 deletions doc/layouts/xenapi/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ <h2 class="title" onclick="showhide(document.getElementById('class_{{$c}}_detail
<h3>Enums</h3>

{{ range $i, $x := .enums }}
<div id="enum_{{$x.name}}" class="{{ if modBool $i 2 }}field{{ else }}field2{{ end }}" onclick="showhide(document.getElementById('enum_{{$x.name}}_details'))">
<div class="field-name">{{ $x.name }}</div>
<div id="enum_{{$x.name}}" class="{{ if modBool $i 2 }}field{{ else }}field2{{ end }}" >
<div class="field-name" onclick="showhide(document.getElementById('enum_{{$x.name}}_details'))">{{ $x.name }}</div>
<div id="enum_{{$x.name}}_details" style="display: none">

<table class="field-table">
Expand All @@ -87,7 +87,7 @@ <h3>Enums</h3>
<h3>Fields</h3>

{{ range $i, $x := sort .fields "name" }}
<div class="{{ if modBool $i 2 }}field{{ else }}field2{{ end }}" onclick="showhide(document.getElementById('{{$x.name}}_details'))">
<div class="{{ if modBool $i 2 }}field{{ else }}field2{{ end }}" >
{{ with $x.lifecycle }}
<div class="lifecycle">
{{ if eq .state "Prototyped_s" }}
Expand All @@ -99,7 +99,7 @@ <h3>Fields</h3>
{{ end }}
</div>
{{ end }}
<div>
<div onclick="showhide(document.getElementById('{{$x.name}}_details'))">
<span class="inline-type">{{replace $x.type "->" "→"}}</span>
<span class="field-name">{{$x.name}}</span>
<span class="inline-qualifier">[{{$x.qualifier}}]</span>
Expand Down Expand Up @@ -133,8 +133,7 @@ <h3 style="padding-right: 0">
</h3>

{{ range $i, $x := sort .messages "name" }}
<div class="{{ if modBool $i 2 }}field{{ else }}field2{{ end }} {{ if $x.implicit }}implicit{{ end }}"
onclick="showhide(document.getElementById('{{$x.name}}_details'))">
<div class="{{ if modBool $i 2 }}field{{ else }}field2{{ end }} {{ if $x.implicit }}implicit{{ end }}" >
{{ with $x.lifecycle }}
<div class="lifecycle">
{{ if eq .state "Prototyped_s" }}
Expand All @@ -146,7 +145,7 @@ <h3 style="padding-right: 0">
{{ end }}
</div>
{{ end }}
<div>
<div onclick="showhide(document.getElementById('{{$x.name}}_details'))">
<span class="inline-type">{{replace (index $x.result 0) "->" "→"}}</span>
<span class="field-name">{{$x.name}}</span>
{{ $ptypes := slice }}
Expand Down
Loading
Loading