Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
c0aedf9
CP-47304: [Toolstack] - Add data model for anti-affinity group
BengangY Apr 18, 2024
92d51d8
UT - CP-47655: [Toolstack] - Associate/disassociate VM to/from anti-a…
BengangY Apr 18, 2024
55a5916
Merge pull request #5546 from BengangY/private/bengangy/CP-47304
robhoes Apr 18, 2024
2c920ed
CA-391880: Update related field 'groups' of VM when destroying VM group.
BengangY Apr 19, 2024
81a05a0
Merge pull request #5573 from BengangY/private/bengangy/CA-391880
robhoes Apr 22, 2024
1425790
CP-47302: VM start with anti-affinity
BengangY Apr 25, 2024
0de00ba
CP-47302: UT for VM start with anti-affinity
BengangY Apr 25, 2024
aeac4cc
Merge pull request #5577 from BengangY/private/bengangy/CP-47302
robhoes Apr 25, 2024
a77d149
Merge branch 'master' into feature/vm-anti-affinity
Apr 26, 2024
8a6c4c8
Merge pull request #5594 from gangj/feature/vm-anti-affinity
robhoes Apr 26, 2024
506fb31
CA-392177: Keep current group after reverting from snapshot
BengangY Apr 28, 2024
3bf62b7
Merge pull request #5598 from BengangY/private/bengangy/CA-392177
robhoes Apr 29, 2024
b9ae796
Merge branch 'master' into feature/vm-anti-affinity
May 1, 2024
8505ed1
Merge pull request #5607 from gangj/feature/vm-anti-affinity
robhoes May 1, 2024
69c8aaf
CP-47656 Anti-affinity feature - resolve cycle dependency issue
LunfanZhang Apr 29, 2024
22259d0
CP-47656 Anti-affinity feature generate alert
LunfanZhang Apr 29, 2024
da8ad7f
Merge pull request #5605 from LunfanZhang/private/luzhan_official/CP-…
gangj May 13, 2024
ab19a9c
CP-48570: Add a field 'recommendations' in pool
BengangY May 21, 2024
1f9d39e
CP-48570: Load recommendations from config file when Xapi starts
BengangY May 21, 2024
d03febe
Merge pull request #5637 from BengangY/private/bengangy/CP-48570
minglumlu May 23, 2024
606423e
CP-48011: Xapi Support anti-affinity feature flag
BengangY Apr 30, 2024
6529c0b
Merge pull request #5631 from BengangY/private/bengangy/CP-48011-review
minglumlu May 29, 2024
7fcef06
CA-393421: Special VMs cannot be added to VM groups
BengangY May 28, 2024
5a8614f
Merge branch 'master' into feature/vm-anti-affinity
May 30, 2024
3dc2b9e
Merge pull request #5658 from gangj/private/gangj/merge_from_master
robhoes May 30, 2024
1efaf1f
CP-48625: Code refactoring
May 16, 2024
d1316f1
CP-48625: Code refactoring
May 16, 2024
eaf7945
opam: add psq to xapi dependencies
May 23, 2024
6640b38
Merge pull request #5653 from BengangY/private/bengangy/CA-393421
robhoes May 30, 2024
25fa2eb
CP-49665: Anti-affinity support for host evacuation
May 16, 2024
fcbab2b
CP-48752: Update UT
Apr 2, 2024
c626cdb
CP-48752: Add UT for host evacuation with anti-affinity support
May 29, 2024
d9c6535
Merge pull request #5652 from gangj/private/gangj/CP-48625.Psq
minglumlu Jun 3, 2024
8a9074f
CP-48011: Xapi Support anti-affinity feature flag
BengangY Jun 3, 2024
de580e5
Merge pull request #5666 from BengangY/private/bengangy/CP-48011
robhoes Jun 3, 2024
6078991
Merge master into feature/vm-anti-affinity
BengangY Jun 19, 2024
6cd2d82
Merge pull request #5708 from BengangY/feature/vm-anti-affinity
psafont Jun 19, 2024
de02e53
CP-49953: Remove parse_uri, switch to using Uri module instead
Jun 25, 2024
5e51f8e
CP-49116: Replace fingerprint in certificate DB with sha256 and sha1
snwoods Jun 25, 2024
f11657e
Merge pull request #5670 from snwoods/private/stevenwo/CP-49116
snwoods Jul 2, 2024
5975562
CA-392887: set_tls_config immediately after enabling clustering
Vincent-lau Jun 18, 2024
ee8e800
CI: Update endcover step to v2 to fix CI (#5763)
bernhardkaindl Jul 2, 2024
813b3b5
Merge branch 'master' into feature/vm-anti-affinity
BengangY Jul 2, 2024
3c14607
CA-386173: Update the message of WLB authentication issue
BengangY Jul 2, 2024
753a655
Revert "CP-49953: Remove parse_uri, switch to using Uri module instead"
robhoes Jul 3, 2024
01fffd5
Merge pull request #5770 from xapi-project/revert-5726-private/asulta…
robhoes Jul 3, 2024
e53ce67
Fix a bug noticed by a quicktest run
Jul 3, 2024
dd9ba19
Merge pull request #5768 from BengangY/private/bengangy/CA-386173
minglumlu Jul 4, 2024
845ffdd
Eliminate unnecessary usage of List.length to check for empty lists
Jun 28, 2024
e61e0ac
Merge pull request #5765 from BengangY/private/bengangy/vm-anti-affin…
minglumlu Jul 4, 2024
99c4356
Transition from exception-raising Unix.getenv to Sys.getenv_opt with
Jun 19, 2024
7be240f
Replace Hashtbl.find with Hashtbl.find_opt in trivial cases
Jun 26, 2024
1869b44
Refactor Hashtbl.find out of resources/table.ml
Jun 26, 2024
47f3c3d
Refactor Hashtbl.find out of xenopsd/xc/readln.ml
Jun 26, 2024
d4be15e
Add a gate for Hashbtl.find
Jun 27, 2024
6dd7a48
Merge pull request #5775 from last-genius/private/asultanov/uri-impro…
robhoes Jul 4, 2024
e11436e
CP-50135: Bump datamodel_lifecycle for anti-affinity
BengangY Jul 5, 2024
16b79a0
IH-621: Add IPMI host power on support and remove DRAC
alexbrett Jun 18, 2024
6e09fc5
opam: generate xapi-forkexecd with dune
psafont Jul 5, 2024
3f5e62d
opam: remove unversioned opam dependencies
psafont Jul 5, 2024
832fd36
opam: generate xapi-networkd using dune
psafont Jul 5, 2024
f2fb3a0
Merge pull request #5782 from psafont/nosystemd
psafont Jul 5, 2024
1b06e51
IH-621 Add changed line to power_on_mode
alexbrett Jul 5, 2024
77987d5
fe_test: print stacktrace on unit test failure
edwintorok Jul 5, 2024
4ea6089
fix(fe_test): make it compatible with fd-send-recv 2.0.2
edwintorok Jul 5, 2024
331c564
IH-621: Python tweaks suggested by pylint
alexbrett Jul 5, 2024
92c51d7
Fix indentation in C code
freddy77 Jul 8, 2024
edcc894
Merge pull request #5785 from edwintorok/private/edvint/ocaml5-compat
psafont Jul 8, 2024
1db8c1b
Merge pull request #5788 from freddy77/indentation
psafont Jul 8, 2024
af4860b
Merge pull request #5762 from last-genius/private/asultanov/empty-len…
last-genius Jul 8, 2024
76f232d
Merge branch 'master' into private/asultanov/opt-refactoring
last-genius Jul 8, 2024
caff014
Merge pull request #5751 from last-genius/private/asultanov/opt-refac…
last-genius Jul 8, 2024
eee3f80
Merge pull request #5783 from alexbrett/IH-621
robhoes Jul 8, 2024
5519cf9
Merge pull request #5644 from Vincent-lau/private/shul2/tls-config
Vincent-lau Jul 8, 2024
d26f870
Fixes: 99c43569a0 ("Transition from exception-raising Unix.getenv to …
Jul 9, 2024
9f9c338
Merge pull request #5797 from last-genius/private/asultanov/opt-fix
robhoes Jul 9, 2024
73f5a30
IH-642 Restructure xs-trace to use Cmdliner
Jul 4, 2024
b0e0bab
Merge pull request #5778 from contificate/IH-642
Jul 9, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ jobs:
# To view the Coveralls results of the PR, click on the "Details" link to the right
# of the Coveralls Logo in the Checks section of the PR.
finish-parallel-coveralls-upload:
name: Finish coverage upload
needs: python-test # run after the python-test has completed uploading coverages
runs-on: ubuntu-latest
steps:
- name: Finish the parallel coverage upload to Coveralls
uses: coverallsapp/github-action@v1
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
continue-on-error: true # Do not fail CI if this step fails

deprecation-test:
name: Deprecation tests
Expand Down
17 changes: 9 additions & 8 deletions configure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ let () =
in
List.iter print_endline lines ;
(* Expand @LIBEXEC@ in udev rules *)
try
let xenopsd_libexecdir = Hashtbl.find config "XENOPSD_LIBEXECDIR" in
expand "@LIBEXEC@" xenopsd_libexecdir "ocaml/xenopsd/scripts/vif.in"
"ocaml/xenopsd/scripts/vif" ;
expand "@LIBEXEC@" xenopsd_libexecdir
"ocaml/xenopsd/scripts/xen-backend.rules.in"
"ocaml/xenopsd/scripts/xen-backend.rules"
with Not_found -> failwith "xenopsd_libexecdir not set"
match Hashtbl.find_opt config "XENOPSD_LIBEXECDIR" with
| Some xenopsd_libexecdir ->
expand "@LIBEXEC@" xenopsd_libexecdir "ocaml/xenopsd/scripts/vif.in"
"ocaml/xenopsd/scripts/vif" ;
expand "@LIBEXEC@" xenopsd_libexecdir
"ocaml/xenopsd/scripts/xen-backend.rules.in"
"ocaml/xenopsd/scripts/xen-backend.rules"
| None ->
failwith "xenopsd_libexecdir not set"
44 changes: 42 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,27 @@

(package
(name xapi-networkd)
(authors "Jon Ludlam")
(synopsis "The XCP networking daemon")
(depends
(alcotest :with-test)
astring
base-threads
(forkexec (= :version))
(http-lib (= :version))
mtime
netlink
re
rpclib
(xapi-idl (= :version))
xapi-inventory
(xapi-stdext-pervasives (= :version))
(xapi-stdext-std (= :version))
(xapi-stdext-threads (= :version))
(xapi-stdext-unix (= :version))
xapi-test-utils
(xen-api-client (= :version))
)
)

(package
Expand All @@ -241,6 +262,14 @@

(package
(name xapi-forkexecd)
(synopsis "Sub-process control service for xapi")
(description "This daemon creates and manages sub-processes on behalf of xapi.")
(depends
astring
(forkexec (= :version))
(uuid (= :version))
(xapi-stdext-unix (= :version))
)
)

(package
Expand Down Expand Up @@ -444,6 +473,19 @@ This package provides an Lwt compatible interface to the library.")

(package
(name forkexec)
(synopsis "Process-spawning library")
(description "Client and server library to spawn processes.")
(depends
base-threads
(fd-send-recv (>= "2.0.0"))
ppx_deriving_rpc
rpclib
(uuid (= :version))
(xapi-log (= :version))
(xapi-stdext-pervasives (= :version))
(xapi-stdext-unix (= :version))
(xapi-tracing (= :version))
)
)

(package
Expand Down Expand Up @@ -513,7 +555,6 @@ This package provides an Lwt compatible interface to the library.")
(synopsis "Xapi's standard library extension, Threads")
(authors "Jonathan Ludlam")
(depends
ocaml
base-threads
base-unix
(odoc :with-doc)
Expand Down Expand Up @@ -541,7 +582,6 @@ This package provides an Lwt compatible interface to the library.")
(synopsis "Xapi's standard library extension, Zerocheck")
(authors "Jonathan Ludlam")
(depends
ocaml
(odoc :with-doc)
)
)
52 changes: 29 additions & 23 deletions forkexec.opam
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
# This file is generated by dune, edit dune-project instead
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
opam-version: "2.0"
maintainer: "[email protected]"
authors: "[email protected]"
homepage: "https://github.com/xapi-project/"
synopsis: "Process-spawning library"
description: "Client and server library to spawn processes."
maintainer: ["Xapi project maintainers"]
authors: ["[email protected]"]
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"
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
tags: [ "org:xapi-project" ]

build: [[ "dune" "build" "-p" name "-j" jobs ]]

depends: [
"ocaml"
"dune"
"dune" {>= "3.0"}
"base-threads"
"fd-send-recv"
"fd-send-recv" {>= "2.0.0"}
"ppx_deriving_rpc"
"rpclib"
"uuid"
"xapi-log"
"xapi-stdext-pervasives"
"xapi-stdext-unix"
"xapi-tracing"
"uuid" {= version}
"xapi-log" {= version}
"xapi-stdext-pervasives" {= version}
"xapi-stdext-unix" {= version}
"xapi-tracing" {= version}
"odoc" {with-doc}
]
synopsis: "Sub-process control service for xapi"
description:
"This daemon creates and manages sub-processes on behalf of xapi."
url {
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
}
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
29 changes: 0 additions & 29 deletions forkexec.opam.template

This file was deleted.

5 changes: 1 addition & 4 deletions ocaml/database/db_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,5 @@ let is_session_registered session =

let get_registered_database session =
with_lock db_registration_mutex (fun () ->
if Hashtbl.mem foreign_databases session then
Some (Hashtbl.find foreign_databases session)
else
None
Hashtbl.find_opt foreign_databases session
)
14 changes: 8 additions & 6 deletions ocaml/database/db_conn_store.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ let read_db_connections () = !db_connections
let with_db_conn_lock db_conn f =
let db_conn_m =
with_lock db_conn_locks_m (fun () ->
try Hashtbl.find db_conn_locks db_conn
with _ ->
(* If we don't have a lock already for this connection then go make one dynamically and use that from then on *)
let new_dbconn_mutex = Mutex.create () in
Hashtbl.replace db_conn_locks db_conn new_dbconn_mutex ;
new_dbconn_mutex
match Hashtbl.find_opt db_conn_locks db_conn with
| Some x ->
x
| None ->
(* If we don't have a lock already for this connection then go make one dynamically and use that from then on *)
let new_dbconn_mutex = Mutex.create () in
Hashtbl.replace db_conn_locks db_conn new_dbconn_mutex ;
new_dbconn_mutex
)
in
with_lock db_conn_m (fun () -> f ())
7 changes: 3 additions & 4 deletions ocaml/database/stats.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ let sample (name : string) (x : float) : unit =
let x' = log x in
with_lock timings_m (fun () ->
let p =
if Hashtbl.mem timings name then
Hashtbl.find timings name
else
Normal_population.empty
Option.value
(Hashtbl.find_opt timings name)
~default:Normal_population.empty
in
let p' = Normal_population.sample p x' in
Hashtbl.replace timings name p'
Expand Down
3 changes: 2 additions & 1 deletion ocaml/forkexecd/test/fe_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ let test_internal_failure_error () =
Forkhelpers.safe_close_and_exec None (Some fd) None [] exe args |> ignore ;
fail "Expected an exception"
with
| Fd_send_recv.Unix_error _ ->
| Fd_send_recv.Unix_error _ | Unix.Unix_error (Unix.EBADF, _, _) ->
leak_fd_detect ()
| e ->
Printexc.print_backtrace stderr ;
fail "Failed with unexpected exception: %s" (Printexc.to_string e)

let master fds =
Expand Down
3 changes: 3 additions & 0 deletions ocaml/idl/datamodel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7866,6 +7866,7 @@ let all_system =
; Datamodel_diagnostics.t
; Datamodel_repository.t
; Datamodel_observer.t
; Datamodel_vm_group.t
]

(* If the relation is one-to-many, the "many" nodes (one edge each) must come before the "one" node (many edges) *)
Expand Down Expand Up @@ -7946,6 +7947,7 @@ let all_relations =
; ((_network_sriov, "physical_PIF"), (_pif, "sriov_physical_PIF_of"))
; ((_network_sriov, "logical_PIF"), (_pif, "sriov_logical_PIF_of"))
; ((_certificate, "host"), (_host, "certificates"))
; ((_vm, "groups"), (_vm_group, "VMs"))
]

let update_lifecycles =
Expand Down Expand Up @@ -8077,6 +8079,7 @@ let expose_get_all_messages_for =
; _vmpp
; _vmss
; _vm_appliance
; _vm_group
; _pci
; _pgpu
; _gpu_group
Expand Down
10 changes: 9 additions & 1 deletion ocaml/idl/datamodel_certificate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,16 @@ let t =
; field ~qualifier:StaticRO ~lifecycle ~ty:DateTime "not_after"
~default_value:(Some (VDateTime Date.never))
"Date before which the certificate is valid"
; field ~qualifier:StaticRO ~lifecycle ~ty:String "fingerprint"
; field ~qualifier:StaticRO
~lifecycle:
[(Published, rel_stockholm, ""); (Deprecated, "24.19.0", "")]
~ty:String "fingerprint" ~default_value:(Some (VString ""))
"Use fingerprint_sha256 instead"
; field ~qualifier:StaticRO ~lifecycle ~ty:String "fingerprint_sha256"
~default_value:(Some (VString ""))
"The certificate's SHA256 fingerprint / hash"
; field ~qualifier:StaticRO ~lifecycle ~ty:String "fingerprint_sha1"
~default_value:(Some (VString ""))
"The certificate's SHA1 fingerprint / hash"
]
~messages:[] ()
4 changes: 3 additions & 1 deletion ocaml/idl/datamodel_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ open Datamodel_roles
to leave a gap for potential hotfixes needing to increment the schema version.*)
let schema_major_vsn = 5

let schema_minor_vsn = 778
let schema_minor_vsn = 779

(* Historical schema versions just in case this is useful later *)
let rio_schema_major_vsn = 5
Expand Down Expand Up @@ -205,6 +205,8 @@ let _vm_guest_metrics = "VM_guest_metrics"

let _vm_appliance = "VM_appliance"

let _vm_group = "VM_group"

let _dr_task = "DR_task"

let _vmpp = "VMPP"
Expand Down
7 changes: 6 additions & 1 deletion ocaml/idl/datamodel_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,10 @@ let _ =
error Api_errors.wlb_timeout ["configured_timeout"]
~doc:"The communication with the WLB server timed out." () ;
error Api_errors.wlb_authentication_failed []
~doc:"WLB rejected our configured authentication details." () ;
~doc:
"Failed to authenticate with the WLB server, the provided credentials \
are invalid."
() ;
error Api_errors.wlb_malformed_request []
~doc:"WLB rejected the server's request as malformed." () ;
error Api_errors.wlb_malformed_response
Expand Down Expand Up @@ -1963,6 +1966,8 @@ let _ =
error Api_errors.host_evacuation_is_required ["host"]
~doc:"Host evacuation is required before applying updates." () ;

error Api_errors.too_many_groups [] ~doc:"VM can only belong to one group." () ;

message
(fst Api_messages.ha_pool_overcommitted)
~doc:
Expand Down
3 changes: 2 additions & 1 deletion ocaml/idl/datamodel_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ let set_power_on_mode =
[
(Published, rel_cowley, "")
; (Changed, rel_stockholm, "Removed iLO script")
; (Changed, "24.19.0", "Replaced DRAC mode with IPMI")
]
~in_product_since:rel_midnight_ride
~doc:"Set the power-on-mode, host, user and password"
Expand All @@ -1375,7 +1376,7 @@ let set_power_on_mode =
(Ref _host, "self", "The host")
; ( String
, "power_on_mode"
, "power-on-mode can be empty, wake-on-lan, DRAC or other"
, "power-on-mode can be empty, wake-on-lan, IPMI or other"
)
; (Map (String, String), "power_on_config", "Power on config")
]
Expand Down
Loading