let ha_armed = "ha.armed"
let ha_disable_failover_decisions = "ha.disable_failover_decisions"
let ha_restart_best_effort = "best-effort"
+let ha_valid_restart_priorities = [ "1"; "2"; "3"; ha_restart_best_effort ]
let ha_base_t = "ha_base_t"
let ballooning_enabled = "ballooning.enabled"
let redo_log_enabled = "redo_log.enabled"
let ha_compute_hypothetical_max_host_failures_to_tolerate ~__context ~configuration =
(* Check the restart priorities all look valid *)
- let valid_priorities = [ "1"; "2"; "3"; Constants.ha_restart_best_effort ] in
List.iter (fun (_, pri) ->
- if not(List.mem pri valid_priorities)
+ if not(List.mem pri Constants.ha_valid_restart_priorities)
then raise (Api_errors.Server_error(Api_errors.invalid_value, [ "ha_restart_priority"; pri ]))) configuration;
let protected_vms = List.map fst (List.filter (fun (vm, priority) -> Helpers.vm_should_always_run true priority) configuration) in
let set_is_a_template ~__context ~self ~value =
set_is_a_template ~__context ~self ~value
-let valid_restart_priorities = [ Constants.ha_restart_best_effort; "1"; "2"; "3" ]
let validate_restart_priority include_empty_string x =
- if not(List.mem x (valid_restart_priorities @ (if include_empty_string then [ "" ] else [])))
+ if not(List.mem x (Constants.ha_valid_restart_priorities @ (if include_empty_string then [ "" ] else [])))
then raise (Api_errors.Server_error(Api_errors.invalid_value, [ "ha_restart_priority"; x ]))
let set_ha_always_run ~__context ~self ~value =
unit
val set_is_a_template :
__context:Context.t -> self:[ `VM ] Ref.t -> value:bool -> unit
-val valid_restart_priorities : string list
val validate_restart_priority : bool -> string -> unit
val set_ha_always_run :
__context:Context.t -> self:API.ref_VM -> value:bool -> unit