diff --git a/ocaml/idl/datamodel.ml b/ocaml/idl/datamodel.ml index 4d4edd972ac..0a0d9677ee6 100644 --- a/ocaml/idl/datamodel.ml +++ b/ocaml/idl/datamodel.ml @@ -2791,12 +2791,21 @@ module Sr_stat = struct , [ ("healthy", "Storage is fully available") ; ("recovering", "Storage is busy recovering, e.g. rebuilding mirrors.") + ; ("unreachable", "Storage is unreachable") + ; ("unavailable", "Storage is unavailable") ] ) let t = let lifecycle = - [(Prototyped, rel_kolkata, ""); (Published, rel_lima, "")] + [ + (Prototyped, rel_kolkata, "") + ; (Published, rel_lima, "") + ; ( Extended + , "24.16.0" + , "Enum extended with 'unreachable' and 'unavailable' values" + ) + ] in create_obj ~in_db:false ~persist:PersistNothing ~gen_constructor_destructor:false ~lifecycle ~in_oss_since:None diff --git a/ocaml/idl/datamodel_common.ml b/ocaml/idl/datamodel_common.ml index fc13fb0a7b1..64e3481dc21 100644 --- a/ocaml/idl/datamodel_common.ml +++ b/ocaml/idl/datamodel_common.ml @@ -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 = 776 +let schema_minor_vsn = 778 (* Historical schema versions just in case this is useful later *) let rio_schema_major_vsn = 5 diff --git a/ocaml/idl/schematest.ml b/ocaml/idl/schematest.ml index def14e58160..d578006c4e0 100644 --- a/ocaml/idl/schematest.ml +++ b/ocaml/idl/schematest.ml @@ -3,7 +3,7 @@ let hash x = Digest.string x |> Digest.to_hex (* BEWARE: if this changes, check that schema has been bumped accordingly in ocaml/idl/datamodel_common.ml, usually schema_minor_vsn *) -let last_known_schema_hash = "2b8b5b107eb465e97d35a68274ac18ef" +let last_known_schema_hash = "b24c445c4f9c3e7f63caf45705865fc8" let current_schema_hash : string = let open Datamodel_types in diff --git a/ocaml/xapi-cli-server/cli_operations.ml b/ocaml/xapi-cli-server/cli_operations.ml index 4208a8a0617..4f2485e1cb3 100644 --- a/ocaml/xapi-cli-server/cli_operations.ml +++ b/ocaml/xapi-cli-server/cli_operations.ml @@ -2566,6 +2566,10 @@ let sr_probe_ext printer rpc session_id params = "healthy" | `recovering -> "recovering" + | `unreachable -> + "unreachable" + | `unavailable -> + "unavailable" in (match x.API.sr_stat_uuid with Some uuid -> [("uuid", uuid)] | None -> []) @ [ diff --git a/ocaml/xapi-idl/storage/storage_interface.ml b/ocaml/xapi-idl/storage/storage_interface.ml index 5ce6006abb0..698997ac0cd 100644 --- a/ocaml/xapi-idl/storage/storage_interface.ml +++ b/ocaml/xapi-idl/storage/storage_interface.ml @@ -232,7 +232,8 @@ let default_vdi_info = | Error (`Msg m) -> failwith (Printf.sprintf "Error creating default_vdi_info: %s" m) -type sr_health = Healthy | Recovering [@@deriving rpcty] +type sr_health = Healthy | Recovering | Unreachable | Unavailable +[@@deriving rpcty] type sr_info = { sr_uuid: string option diff --git a/ocaml/xapi/xapi_sr.ml b/ocaml/xapi/xapi_sr.ml index f692f524050..18cba6800aa 100644 --- a/ocaml/xapi/xapi_sr.ml +++ b/ocaml/xapi/xapi_sr.ml @@ -299,7 +299,15 @@ let probe = let probe_ext = let to_xenapi_sr_health = let open Storage_interface in - function Healthy -> `healthy | Recovering -> `recovering + function + | Healthy -> + `healthy + | Recovering -> + `recovering + | Unreachable -> + `unreachable + | Unavailable -> + `unavailable in let to_xenapi_sr_stat Storage_interface.