Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8694764
CP-27466: Add xe sr-probe-ext CLI
gaborigloi May 8, 2018
c9d4aa9
CP-26912: Introduce rel_lima, bump schema minor
edwintorok May 11, 2018
d9194d4
CP-26912: Remove unnecessary commented-out code
Apr 19, 2018
c65e5d6
CP-26912: Add Cluster_host.PIF field to enable live bond creation
Apr 30, 2018
53f0190
CP-26912: Remove Cluster.network field and all uses within xapi
Apr 30, 2018
2222fd7
CP-26912: Update clustering tests with Cluster_host.PIF and Cluster.n…
Apr 30, 2018
05717a4
CP-26912: Bond.{create, destroy} update cluster_host PIF if necessary
Apr 30, 2018
21b34e0
CP-28213: Make Xapi_pif.assert_no_clustering_enabled_on public
May 16, 2018
bd2ea6c
CP-28213: Unit test PIF.reconfigure_IP, remove quicktest
May 16, 2018
e2994c8
CP-26912: Update clustering tests with Cluster_host.PIF and Cluster.n…
Apr 30, 2018
996f3df
CP-25121, CP-26147: Forbid clustering operations during RPU or
Apr 4, 2018
f2c7d72
CP-25121: Unit test allowed_operations blocks cluster operations duri…
Apr 9, 2018
8b95d65
CP-25121: ocp-indent message_forwarding and test_clustering_allowed_ops
Apr 16, 2018
d0dc7b7
CP-25121: Move RPU cluster operation logic
Apr 25, 2018
7d8a343
CP-25121: Restart xapi-clusterd after RPU is cluster_host enabled in db
May 1, 2018
b1d3262
CP-24692: Prevent race condition between allowing PIF.unplug and
May 17, 2018
48a6a34
CP-26199: Send alerts when Cluster_host.resync_host fails
May 17, 2018
36af30e
CP-27172: GC Cluster_host objects with broken references
edwintorok May 11, 2018
f398c31
CP-27172: integrate Host.destroy and Host.declare_dead with clustering
edwintorok May 15, 2018
af2009c
CA-290471: fix wrong token timeout in XenCenter (#3611)
edwintorok May 31, 2018
a6a3c16
CA-290237: Add Cluster_host.joined field to represent cluster membership
May 25, 2018
6972bc3
CA-290237: Wait for clustering IP before resyncing host
Jun 6, 2018
eef3483
CA-290237: Prevent data races blocking pool-join on bonds and VLANs
Jun 6, 2018
033dbba
CA-290686: fix forwarding of Cluster_host.forget
edwintorok Jun 1, 2018
70e8dd4
CP-28406: use named mutex for clustering
edwintorok May 31, 2018
3827800
CP-28406: log caller of locking function
edwintorok May 31, 2018
95348f6
CP-28406: refactor Cluster/Cluster_host.destroy and forbid RPCs if cl…
edwintorok May 31, 2018
df206fb
CP-28406: introduce new API error for destroying last cluster host
edwintorok Jun 7, 2018
a1416d0
Hardcode token value thresholds in Constants module
Jun 7, 2018
c48e1aa
Test Cluster.create fails for invalid token parameters
Jun 7, 2018
53404c7
Merge pull request #3623 from minishrink/constant_token_threshold
gaborigloi Jun 8, 2018
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
13 changes: 8 additions & 5 deletions ocaml/idl/datamodel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,9 @@ module PIF = struct
~params: [ Ref _pif, "self", "Reference to the object"
; Bool, "value", "New value to set" ]
~allowed_roles:_R_POOL_OP
~errs:[Api_errors.clustering_enabled_on_network]
~errs:Api_errors.([ other_operation_in_progress
; clustering_enabled
])
()

let ip_configuration_mode = Enum ("ip_configuration_mode",
Expand All @@ -983,7 +985,7 @@ module PIF = struct
]
~in_product_since:rel_miami
~allowed_roles:_R_POOL_OP
~errs:[Api_errors.clustering_enabled_on_network]
~errs:Api_errors.([ clustering_enabled ])
()

let ipv6_configuration_mode = Enum ("ipv6_configuration_mode",
Expand All @@ -1003,7 +1005,7 @@ module PIF = struct
]
~lifecycle:[Prototyped, rel_tampa, ""]
~allowed_roles:_R_POOL_OP
~errs:[Api_errors.clustering_enabled_on_network]
~errs:Api_errors.([ clustering_enabled ])
()

let primary_address_type = Enum ("primary_address_type",
Expand Down Expand Up @@ -1051,8 +1053,9 @@ module PIF = struct
~params:[Ref _pif, "self", "The PIF object to destroy"]
~in_product_since:rel_miami
~allowed_roles:_R_POOL_OP
~errs:[ Api_errors.pif_tunnel_still_exists
; Api_errors.clustering_enabled_on_network]
~errs:Api_errors.([ pif_tunnel_still_exists
; clustering_enabled
])
()

let pool_introduce_params first_rel =
Expand Down
108 changes: 81 additions & 27 deletions ocaml/idl/datamodel_cluster.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,24 @@ let cluster_operation =

let lifecycle = [Prototyped, rel_kolkata, ""]

let timeout_params = [
{param_type=Float; param_name="token_timeout"; param_doc="Corosync token timeout in seconds"; param_release=kolkata_release; param_default=Some(VFloat Constants.default_token_timeout_s)};
{param_type=Float; param_name="token_timeout_coefficient"; param_doc="Corosync token timeout coefficient in seconds"; param_release=kolkata_release; param_default=Some(VFloat Constants.default_token_timeout_coefficient_s)};
let lifecycle_timeout = [
Prototyped, rel_kolkata, "the unit is milliseconds";
Changed, rel_lima, "the unit is now seconds"
]

let timeout_params =
[ {param_type=Float;
param_name="token_timeout";
param_doc="Corosync token timeout in seconds";
param_release=kolkata_release;
param_default=Some(VFloat Constants.default_token_timeout_s)};

{param_type=Float;
param_name="token_timeout_coefficient";
param_doc="Corosync token timeout coefficient in seconds";
param_release=kolkata_release;
param_default=Some(VFloat Constants.default_token_timeout_coefficient_s)};

]


Expand All @@ -28,10 +43,25 @@ let create = call
~doc:"Creates a Cluster object and one Cluster_host object as its first member"
~result:(Ref _cluster, "the new Cluster")
~versioned_params:
([{param_type=Ref _network; param_name="network"; param_doc="the single network on which corosync carries out its inter-host communications"; param_release=kolkata_release; param_default=None};
{param_type=String; param_name="cluster_stack"; param_doc="simply the string 'corosync'. No other cluster stacks are currently supported"; param_release=kolkata_release; param_default=None};
{param_type=Bool; param_name="pool_auto_join"; param_doc="true if xapi is automatically joining new pool members to the cluster"; param_release=kolkata_release; param_default=None};
] @timeout_params)
([{param_type=(Ref _pif);
param_name="PIF";
param_doc="The PIF to connect the cluster's first cluster_host to";
param_release=kolkata_release;
param_default=None};

{param_type=String;
param_name="cluster_stack";
param_doc="simply the string 'corosync'. No other cluster stacks are currently supported";
param_release=kolkata_release;
param_default=None};

{param_type=Bool;
param_name="pool_auto_join";
param_doc="true if xapi is automatically joining new pool members to the cluster";
param_release=kolkata_release;
param_default=None};

] @timeout_params)
~lifecycle
~allowed_roles:_R_POOL_ADMIN
()
Expand All @@ -46,14 +76,36 @@ let destroy = call
~allowed_roles:_R_POOL_ADMIN
()

let get_network = call
~name:"get_network"
~doc:("Returns the network used by the cluster for inter-host communication, " ^
"i.e. the network shared by all cluster host PIFs")
~result:(Ref _network, "network of cluster")
~params:
[ Ref _cluster, "self", "the Cluster with the network"
]
~lifecycle
~allowed_roles:_R_POOL_ADMIN
()

let pool_create = call
~name:"pool_create"
~doc:"Attempt to create a Cluster from the entire pool"
~result:(Ref _cluster, "the new Cluster")
~versioned_params:
([{param_type=Ref _network; param_name="network"; param_doc="the single network on which corosync carries out its inter-host communications"; param_release=kolkata_release; param_default=None};
{param_type=String; param_name="cluster_stack"; param_doc="simply the string 'corosync'. No other cluster stacks are currently supported"; param_release=kolkata_release; param_default=None};
] @ timeout_params)
([{param_type=Ref _network;
param_name="network";
param_doc="the single network on which corosync carries out its inter-host communications";
param_release=kolkata_release;
param_default=None};

{param_type=String;
param_name="cluster_stack";
param_doc="simply the string 'corosync'. No other cluster stacks are currently supported";
param_release=kolkata_release;
param_default=None};

] @ timeout_params)
~lifecycle
~allowed_roles:_R_POOL_ADMIN
()
Expand All @@ -79,12 +131,12 @@ let pool_destroy = call
()

let pool_resync = call
~name:"pool_resync"
~doc:"Resynchronise the cluster_host objects across the pool. Creates them where they need creating and then plugs them"
~params:[ Ref _cluster, "self", "The cluster to resync"]
~lifecycle
~allowed_roles:_R_POOL_ADMIN
()
~name:"pool_resync"
~doc:"Resynchronise the cluster_host objects across the pool. Creates them where they need creating and then plugs them"
~params:[ Ref _cluster, "self", "The cluster to resync"]
~lifecycle
~allowed_roles:_R_POOL_ADMIN
()

let t =
create_obj
Expand All @@ -105,9 +157,10 @@ let t =
~ty:(Set (Ref _cluster_host)) "cluster_hosts"
"A list of the cluster_host objects associated with the Cluster"

; field ~qualifier:StaticRO ~lifecycle
~ty:(Ref _network) "network" ~default_value:(Some (VRef null_ref))
"Reference to the single network on which corosync carries out its inter-host communications"
; field ~qualifier:DynamicRO ~lifecycle:[ Prototyped, rel_lima, "" ]
~ty:(Set String) "pending_forget" ~default_value:(Some (VSet []))
"Internal field used by Host.destroy to store the IP of cluster members \
marked as permanently dead but not yet removed"

; field ~qualifier:StaticRO ~lifecycle
~ty:String "cluster_token" ~default_value:(Some (VString ""))
Expand All @@ -119,17 +172,17 @@ let t =

] @ (allowed_and_current_operations cluster_operation) @ [

field ~qualifier:StaticRO ~lifecycle
field ~qualifier:StaticRO ~lifecycle
~ty:Bool "pool_auto_join" ~default_value:(Some (VBool true))
"True if xapi is automatically joining new pool members to the cluster. This will be `true` in the first release"
"True if automatically joining new pool members to the cluster. This will be `true` in the first release"

; field ~qualifier:StaticRO ~lifecycle
~ty:Int "token_timeout" ~default_value:(Some (VInt 20000L))
"The corosync token timeout in ms"
; field ~qualifier:StaticRO ~lifecycle:lifecycle_timeout
~ty:Float "token_timeout" ~default_value:(Some (VFloat Constants.default_token_timeout_s))
"The corosync token timeout in seconds"

; field ~qualifier:StaticRO ~lifecycle
~ty:Int "token_timeout_coefficient" ~default_value:(Some (VInt 1000L))
"The corosync token timeout coefficient in ms"
; field ~qualifier:StaticRO ~lifecycle:lifecycle_timeout
~ty:Float "token_timeout_coefficient" ~default_value:(Some (VFloat Constants.default_token_timeout_coefficient_s))
"The corosync token timeout coefficient in seconds"


; field ~qualifier:StaticRO ~lifecycle
Expand All @@ -143,6 +196,7 @@ let t =
~messages:
[ create
; destroy
; get_network
; pool_create
; pool_force_destroy
; pool_destroy
Expand Down
25 changes: 23 additions & 2 deletions ocaml/idl/datamodel_cluster_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let create = call
~params:
[ Ref _cluster, "cluster", "Cluster to join"
; Ref _host, "host", "new cluster member"
; Ref _pif, "pif", "Network interface to use for communication"
]
~lifecycle
~allowed_roles:_R_POOL_ADMIN
Expand Down Expand Up @@ -65,6 +66,17 @@ let disable = call
~allowed_roles:_R_POOL_ADMIN
()

let forget = call
~name:"forget"
~doc:"Permanently remove a dead host from the cluster. This host must never rejoin the cluster."
~params:
[ Ref _cluster_host, "self", "the cluster_host to declare permanently dead and forget"
]
~lifecycle:[Prototyped, rel_lima, ""]
~allowed_roles:_R_LOCAL_ROOT_ONLY
~hide_from_docs:true
()

let t =
create_obj
~name: _cluster_host
Expand Down Expand Up @@ -92,12 +104,20 @@ let t =
~ty:Bool "enabled" ~default_value:(Some (VBool false))
"Whether the cluster host believes that clustering should be enabled on this host"

; field ~qualifier:StaticRO ~lifecycle
~ty:(Ref _pif) "PIF" ~default_value:(Some (VRef null_ref))
"Reference to the PIF object"

; field ~qualifier:StaticRO ~lifecycle
~ty:Bool "joined" ~default_value:(Some (VBool true))
"Whether the cluster host has joined the cluster"

(* TODO: add `live` member to represent whether corosync believes that this
cluster host actually is enabled *)

] @ (allowed_and_current_operations cluster_host_operation) @ [

field ~qualifier:StaticRO ~lifecycle
field ~qualifier:StaticRO ~lifecycle
~ty:(Map(String, String)) "other_config" ~default_value:(Some (VMap []))
"Additional configuration"
])
Expand All @@ -106,6 +126,7 @@ let t =
; destroy
; enable
; force_destroy
; forget
; disable
]
()
13 changes: 10 additions & 3 deletions ocaml/idl/datamodel_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ open Datamodel_types
open Datamodel_roles

(* IMPORTANT: Please bump schema vsn if you change/add/remove a _field_.
You do not have to bump vsn if you change/add/remove a message *)

You do not have to bump vsn if you change/add/remove a message
When introducing a new release, bump the schema minor version to the next hundred
to leave a gap for potential hotfixes needing to increment the schema version.*)
let schema_major_vsn = 5
let schema_minor_vsn = 142
let schema_minor_vsn = 202

(* Historical schema versions just in case this is useful later *)
let rio_schema_major_vsn = 5
Expand Down Expand Up @@ -189,6 +190,12 @@ let get_product_releases in_product_since =
| x::xs -> go_through_release_order xs
in go_through_release_order release_order

let lima_release =
{ internal = get_product_releases rel_lima
; opensource = get_oss_releases None
; internal_deprecated_since = None
}

let kolkata_release =
{ internal = get_product_releases rel_kolkata
; opensource = get_oss_releases None
Expand Down
12 changes: 9 additions & 3 deletions ocaml/idl/datamodel_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1134,12 +1134,18 @@ let _ =
~doc:"The host does not have a Cluster_host with a compatible cluster stack." ();
error Api_errors.cluster_force_destroy_failed ["cluster"]
~doc:"Force destroy failed on a Cluster_host while force destroying the cluster." ();
error Api_errors.clustering_enabled_on_network ["network"]
~doc:"The network has cluster objects attached." ();
error Api_errors.cluster_stack_in_use ["cluster_stack"]
~doc:"The cluster stack is already in use." ();
error Api_errors.invalid_cluster_stack [ "cluster_stack" ]
~doc:"The cluster stack provided is not supported." ()
~doc:"The cluster stack provided is not supported." ();
error Api_errors.pif_not_attached_to_host [ "pif"; "host" ]
~doc:"Cluster_host creation failed as the PIF provided is not attached to the host." ();
error Api_errors.cluster_host_not_joined [ "cluster_host" ]
~doc:"Cluster_host operation failed as the cluster_host has not joined the cluster." ();
error Api_errors.cluster_host_is_last ["cluster_host"]
~doc:"The last cluster host cannot be destroyed. Destroy the cluster instead" ()



let _ =
message (fst Api_messages.ha_pool_overcommitted) ~doc:"Pool has become overcommitted: it can no longer guarantee to restart protected VMs if the configured number of hosts fail." ();
Expand Down
6 changes: 6 additions & 0 deletions ocaml/idl/datamodel_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ let rel_honolulu = "honolulu"
let rel_inverness = "inverness"
let rel_jura = "jura"
let rel_kolkata = "kolkata"
let rel_lima = "lima"

type api_release = {
code_name: string option;
Expand Down Expand Up @@ -204,6 +205,11 @@ let release_order_full = [{
version_major = 2;
version_minor = 10;
branding = "XenServer 7.5";
}; {
code_name = Some rel_lima;
version_major = 2;
version_minor = 11;
branding = "Unreleased";
};
]
(* When you add a new release, use the version number of the latest release,
Expand Down
1 change: 0 additions & 1 deletion ocaml/quicktest/quicktest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let () =
let suite =
[ "Quicktest_example", Quicktest_example.tests s
; "cbt", Quicktest_cbt.tests s
; "reconfigure-ip-cluster", Quicktest_cluster.tests s
; "event", Quicktest_event.tests s
; "import_raw_vdi", Quicktest_import_raw_vdi.tests s
; "copy", Quicktest_vdi_copy.tests s
Expand Down
Loading