Skip to content

merge master to feature/easier-pool-join #6079

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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
43d9ee9
fix(test): avoid running XAPI hooks in unit tests
edwintorok Oct 2, 2024
1e55415
CA-392674: nbd_client_manager retry connect on nbd device busy
liulinC Sep 27, 2024
2c651f2
IH-715 - rrdp-netdev: Remove double (de)serialization
Oct 2, 2024
008a813
http-lib: add backtrace to logs on connection without response
psafont Oct 1, 2024
ed96146
http-lib: convert bash script to cram tests
psafont Oct 4, 2024
3bef65f
http-lib: prepare test client for more commands
psafont Oct 4, 2024
d8bd9f2
http-libs: add test about error logging
psafont Oct 7, 2024
cda6194
http-lib: use let@ for perf testing of the client
psafont Oct 9, 2024
4f86441
http-lib: make perf shorter
psafont Oct 9, 2024
aa09cb8
CA-399256: Ensure AD domain name check is case insensitive
ElijahSadorra Oct 9, 2024
2715234
fixup! IH-715 - rrdp-netdev: Remove double (de)serialization
Oct 10, 2024
59ea7bc
http-lib: add backtrace to logs on connection without response (#6028)
psafont Oct 10, 2024
01b6205
CA-399256: Ensure AD domain name check is case insensitive (#6047)
lindig Oct 10, 2024
f06d920
Replace fold with of_list in rbac
Oct 11, 2024
f7c3e7f
Replace fold with of_list in rbac (#6051)
contificate Oct 11, 2024
6631d38
maintenance: write interface files for vhd-tool
psafont Oct 11, 2024
c4a9e25
maintenance: add interface to vhd-tool's Chunked
psafont Oct 11, 2024
4284169
maintenance: remove data from chd-tool's chunked datastructure
psafont Oct 11, 2024
7670247
maintenance: add interface files for vhd-tool (#6052)
lindig Oct 11, 2024
310429c
Revert "CP-48676: Don't check resuable pool session validity by default"
edwintorok Oct 11, 2024
76008ce
Revert "CP-48676: Reuse pool sessions on slave logins."
edwintorok Oct 11, 2024
ab2acfc
maintenance: remove unused code from stream_vdi
psafont Oct 11, 2024
34a8796
CA-392674: nbd_client_manager retry connect on nbd device busy (#6021)
liulinC Oct 14, 2024
bb41b46
Revert changes causing deadlock (#6053)
lindig Oct 14, 2024
97565ca
maintenance: remove unused code from stream_vdi (#6054)
lindig Oct 14, 2024
445ef24
chore: update datamodel versions
psafont Oct 14, 2024
9eb5740
chore: update datamodel versions (#6055)
robhoes Oct 14, 2024
bd4dda5
IH-715 - rrdp-netdev: Remove double (de)serialization (#6046)
last-genius Oct 15, 2024
a2d9fbe
IH-577 Implement v7 UUID generation
Jul 3, 2024
e650ca0
IH-577 Implement v7 UUID generation (#5866)
lindig Oct 16, 2024
9507369
Update wire-protocol.md to have working Python3 code examples
alexbrett Oct 16, 2024
1683f8f
Update wire-protocol.md to have working Python3 code examples (#6058)
lindig Oct 16, 2024
00c13da
Added WLB_VM_RELOCATION to the list of recognized messages.
kc284 Oct 14, 2024
3a727d2
Python command correction.
kc284 Oct 16, 2024
80528e0
Remove unused Http_svr.Chunked module
robhoes Oct 17, 2024
1113299
chore: Fix some grammatical errors in cluster alerts
Vincent-lau Oct 17, 2024
34352ac
Small correction to PR#6058 and a C# SDK addition for client L10n pur…
kc284 Oct 17, 2024
ad018ce
chore: Fix some grammatical errors in cluster alerts (#6062)
Vincent-lau Oct 17, 2024
8465e1b
buf_io: remove unused function input_line
robhoes Oct 17, 2024
5770f42
Access pvsproxy via a socket in /run
rosslagerwall Oct 17, 2024
c02f653
http-svr: change request_of_bio(_exn) to read_request(_exn)
robhoes Oct 17, 2024
a49ae63
xmlrpc_client: remove us of Buf_io
robhoes Oct 17, 2024
8a829ec
http-svr: remove read from Buf_io in read_body
robhoes Oct 17, 2024
8d2bd13
xapi_http: unify cases in add_handler
robhoes Oct 17, 2024
ff9ce6d
Remove BufIO HTTP handler type completely
robhoes Oct 17, 2024
8e02455
Remove now-unused Buf_io and associated tests
robhoes Oct 17, 2024
3ae129d
Access pvsproxy via a socket in /run (#6063)
lindig Oct 18, 2024
aafb2bb
fix(test): avoid running XAPI hooks in unit tests (#6037)
lindig Oct 18, 2024
45d934e
Remove Buf_io from the HTTP server (#6064)
robhoes Oct 18, 2024
99b8ad6
CA-400860: make CPU and netdev RRDD plugins pick up changes in domains
Oct 21, 2024
c647985
CP-51683: Make Cluster_health non-exp feature
Vincent-lau Sep 30, 2024
daa9938
CP-51683: Make Cluster_health non-exp feature (#6023)
Vincent-lau Oct 21, 2024
f1d892f
CA-400860: make CPU and netdev RRDD plugins pick up changes in domain…
lindig Oct 21, 2024
264558d
CA-398341: Populate fingerprints of CA certificates on startup
psafont Aug 29, 2024
ed90086
CP-51527: Add --force option to pool-uninstall-ca-certificate
snwoods Sep 17, 2024
97aa03f
CA-398341: Populate fingerprints of CA certificates on startup (#6006)
psafont Oct 22, 2024
98384e8
CA-400924 - networkd: Add bonds to `devs` in network_monitor_thread
Oct 23, 2024
46f0f42
CA-400924 - networkd: Add bonds to `devs` in network_monitor_thread (…
lindig Oct 23, 2024
0f093b8
Merge branch 'master' into private/bengangy/merge-master-to-easier-po…
BengangY Oct 24, 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: 2 additions & 2 deletions ocaml/database/database_server_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ let _ =
let socket = Http_svr.bind sockaddr "unix_rpc" in
let server = Http_svr.Server.empty () in
Http_svr.Server.add_handler server Http.Post "/post_remote_db_access"
(Http_svr.BufIO remote_database_access_handler_v1) ;
remote_database_access_handler_v1 ;
Http_svr.Server.add_handler server Http.Post "/post_remote_db_access_v2"
(Http_svr.BufIO remote_database_access_handler_v2) ;
remote_database_access_handler_v2 ;
Http_svr.start ~conn_limit:1024 server socket ;
Printf.printf "server listening\n%!" ;
if !self_test then (
Expand Down
5 changes: 2 additions & 3 deletions ocaml/database/db_remote_cache_access_v1.ml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ module DBCacheRemoteListener = struct
raise e
end

let handler req bio _ =
let fd = Buf_io.fd_of bio in
let handler req fd _ =
(* fd only used for writing *)
let body =
Http_svr.read_body ~limit:Db_globs.http_limit_max_rpc_size req bio
Http_svr.read_body ~limit:Db_globs.http_limit_max_rpc_size req fd
in
let body_xml = Xml.parse_string body in
let reply_xml = DBCacheRemoteListener.process_xmlrpc body_xml in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/database/db_remote_cache_access_v1.mli
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
val handler : Http.Request.t -> Buf_io.t -> 'a -> unit
val handler : Http.Request.t -> Unix.file_descr -> 'a -> unit
(** HTTP handler for v1 of the remote DB access protocol *)
5 changes: 2 additions & 3 deletions ocaml/database/db_remote_cache_access_v2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ let process_rpc (req : Rpc.t) =
Response.Too_many_values (x, y, z)
)

let handler req bio _ =
let fd = Buf_io.fd_of bio in
let handler req fd _ =
(* fd only used for writing *)
let body =
Http_svr.read_body ~limit:Db_globs.http_limit_max_rpc_size req bio
Http_svr.read_body ~limit:Db_globs.http_limit_max_rpc_size req fd
in
let request_rpc = Jsonrpc.of_string body in
let reply_rpc = process_rpc request_rpc in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/database/db_remote_cache_access_v2.mli
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
val handler : Http.Request.t -> Buf_io.t -> 'a -> unit
val handler : Http.Request.t -> Unix.file_descr -> 'a -> unit
(** HTTP handler for v2 of the remote DB access protocol *)
73 changes: 45 additions & 28 deletions ocaml/doc/wire-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,21 @@ $ python3

### Using the XML-RPC Protocol

Import the library `xmlrpclib` and create a
Import the library `xmlrpc.client` and create a
python object referencing the remote server as shown below:

```python
>>> import xmlrpclib
>>> xen = xmlrpclib.Server("https://localhost:443")
>>> import xmlrpc.client
>>> xen = xmlrpc.client.ServerProxy("https://localhost:443")
```

Note that you may need to disable SSL certificate validation to establish the
connection, this can be done as follows:

```python
>>> import ssl
>>> ctx = ssl._create_unverified_context()
>>> xen = xmlrpc.client.ServerProxy("https://localhost:443", context=ctx)
```

Acquire a session reference by logging in with a username and password; the
Expand Down Expand Up @@ -547,35 +556,46 @@ To retrieve all the VM records in a single call:

```python
>>> records = xen.VM.get_all_records(session)['Value']
>>> records.keys()
>>> list(records.keys())
['OpaqueRef:1', 'OpaqueRef:2', 'OpaqueRef:3', 'OpaqueRef:4' ]
>>> records['OpaqueRef:1']['name_label']
'Red Hat Enterprise Linux 7'
```

### Using the JSON-RPC Protocol

For this example we are making use of the package `python-jsonrpc` due to its
simplicity, although other packages can also be used.
For this example we are making use of the package `jsonrpcclient` and the
`requests` library due to their simplicity, although other packages can also be
used.

First, import the library `pyjsonrpc` and create the object referencing the
remote server as follows:
First, import the `requests` and `jsonrpcclient` libraries:

```python
>>> import pyjsonrpc
>>> client = pyjsonrpc.HttpClient(url = "https://localhost/jsonrpc:443")
>>> import requests
>>> import jsonrpcclient
```

Acquire a session reference by logging in with a username and password; the
library `pyjsonrpc` returns the response's `result` member, which is the session
reference:
Now we construct a utility method to make using these libraries easier:

```python
>>> def jsonrpccall(method, params):
... r = requests.post("https://localhost:443/jsonrpc",
... json=jsonrpcclient.request(method, params=params),
... verify=False)
... p = jsonrpcclient.parse(r.json())
... if isinstance(p, jsonrpcclient.Ok):
... return p.result
... raise Exception(p.message, p.data)
```

Acquire a session reference by logging in with a username and password:

```python
>>> session = client.call("session.login_with_password",
... "user", "passwd", "version", "originator")
>>> session = jsonrpccall("session.login_with_password",
... ("user", "password", "version", "originator"))
```

`pyjsonrpc` uses the JSON-RPC protocol v2.0, so this is what the serialized
`jsonrpcclient` uses the JSON-RPC protocol v2.0, so this is what the serialized
request looks like:

```json
Expand All @@ -591,7 +611,7 @@ Next, the user may acquire a list of all the VMs known to the system (note the
call takes the session reference as the only parameter):

```python
>>> all_vms = client.call("VM.get_all", session)
>>> all_vms = jsonrpccall("VM.get_all", (session,))
>>> all_vms
['OpaqueRef:1', 'OpaqueRef:2', 'OpaqueRef:3', 'OpaqueRef:4' ]
```
Expand All @@ -603,22 +623,19 @@ find the subset of template VMs using a command like the following:

```python
>>> all_templates = filter(
... lambda x: client.call("VM.get_is_a_template", session, x),
all_vms)
... lambda x: jsonrpccall("VM.get_is_a_template", (session, x)),
... all_vms)
```

Once a reference to a VM has been acquired, a lifecycle operation may be invoked:

```python
>>> from pyjsonrpc import JsonRpcError
>>> try:
... client.call("VM.start", session, all_templates[0], False, False)
... except JsonRpcError as e:
... e.message
... e.data
... jsonrpccall("VM.start", (session, next(all_templates), False, False))
... except Exception as e:
... e
...
'VM_IS_TEMPLATE'
[ 'OpaqueRef:1', 'start' ]
Exception('VM_IS_TEMPLATE', ['OpaqueRef:1', 'start'])
```

In this case the `start` message has been rejected because the VM is
Expand All @@ -629,7 +646,7 @@ Rather than querying fields individually, whole _records_ may be returned at onc
To retrieve the record of a single object as a python dictionary:

```python
>>> record = client.call("VM.get_record", session, all_templates[0])
>>> record = jsonrpccall("VM.get_record", (session, next(all_templates)))
>>> record['power_state']
'Halted'
>>> record['name_label']
Expand All @@ -639,7 +656,7 @@ To retrieve the record of a single object as a python dictionary:
To retrieve all the VM records in a single call:

```python
>>> records = client.call("VM.get_all_records", session)
>>> records = jsonrpccall("VM.get_all_records", (session,))
>>> records.keys()
['OpaqueRef:1', 'OpaqueRef:2', 'OpaqueRef:3', 'OpaqueRef:4' ]
>>> records['OpaqueRef:1']['name_label']
Expand Down
2 changes: 1 addition & 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 = 782
let schema_minor_vsn = 783

(* Historical schema versions just in case this is useful later *)
let rio_schema_major_vsn = 5
Expand Down
34 changes: 31 additions & 3 deletions ocaml/idl/datamodel_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1479,12 +1479,40 @@ let install_ca_certificate =
let uninstall_ca_certificate =
call ~pool_internal:true ~hide_from_docs:true ~name:"uninstall_ca_certificate"
~doc:"Remove a TLS CA certificate from this host."
~params:
~versioned_params:
[
(Ref _host, "host", "The host"); (String, "name", "The certificate name")
{
param_type= Ref _host
; param_name= "host"
; param_doc= "The host"
; param_release= numbered_release "1.290.0"
; param_default= None
}
; {
param_type= String
; param_name= "name"
; param_doc= "The certificate name"
; param_release= numbered_release "1.290.0"
; param_default= None
}
; {
param_type= Bool
; param_name= "force"
; param_doc= "Remove the DB entry even if the file is non-existent"
; param_release= numbered_release "24.35.0"
; param_default= Some (VBool false)
}
]
~allowed_roles:_R_LOCAL_ROOT_ONLY
~lifecycle:[(Published, "1.290.0", "Uninstall TLS CA certificate")]
~lifecycle:
[
(Published, "1.290.0", "Uninstall TLS CA certificate")
; ( Changed
, "24.35.0"
, "Added --force option to allow DB entries to be removed for \
non-existent files"
)
]
()

let certificate_list =
Expand Down
12 changes: 6 additions & 6 deletions ocaml/idl/datamodel_lifecycle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ let prototyped_of_field = function
| "pool", "telemetry_uuid" ->
Some "23.9.0"
| "pool", "ext_auth_cache_expiry" ->
Some "24.30.0-next"
Some "24.31.0"
| "pool", "ext_auth_cache_size" ->
Some "24.30.0-next"
Some "24.31.0"
| "pool", "ext_auth_cache_enabled" ->
Some "24.30.0-next"
Some "24.31.0"
| "pool", "ext_auth_max_threads" ->
Some "23.27.0"
| "pool", "local_auth_max_threads" ->
Expand Down Expand Up @@ -170,11 +170,11 @@ let prototyped_of_message = function
| "pool", "get_guest_secureboot_readiness" ->
Some "24.17.0"
| "pool", "set_ext_auth_cache_expiry" ->
Some "24.30.0-next"
Some "24.31.0"
| "pool", "set_ext_auth_cache_size" ->
Some "24.30.0-next"
Some "24.31.0"
| "pool", "set_ext_auth_cache_enabled" ->
Some "24.30.0-next"
Some "24.31.0"
| "pool", "set_ext_auth_max_threads" ->
Some "23.27.0"
| "pool", "set_local_auth_max_threads" ->
Expand Down
36 changes: 34 additions & 2 deletions ocaml/idl/datamodel_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,41 @@ let certificate_uninstall =
let uninstall_ca_certificate =
call ~name:"uninstall_ca_certificate"
~doc:"Remove a pool-wide TLS CA certificate."
~params:[(String, "name", "The certificate name")]
~params:
[
(String, "name", "The certificate name")
; ( Bool
, "force"
, "If true, remove the DB entry even if the file is non-existent"
)
]
~versioned_params:
[
{
param_type= String
; param_name= "name"
; param_doc= "The certificate name"
; param_release= numbered_release "1.290.0"
; param_default= None
}
; {
param_type= Bool
; param_name= "force"
; param_doc= "Remove the DB entry even if the file is non-existent"
; param_release= numbered_release "24.35.0"
; param_default= Some (VBool false)
}
]
~allowed_roles:(_R_POOL_OP ++ _R_CLIENT_CERT)
~lifecycle:[(Published, "1.290.0", "Uninstall TLS CA certificate")]
~lifecycle:
[
(Published, "1.290.0", "Uninstall TLS CA certificate")
; ( Changed
, "24.35.0"
, "Added --force option to allow DB entries to be removed for \
non-existent files"
)
]
()

let certificate_list =
Expand Down
Loading
Loading