diff --git a/ocaml/idl/api_errors.ml b/ocaml/idl/api_errors.ml index 334f6130016..4bc1d1bf9d5 100644 --- a/ocaml/idl/api_errors.ml +++ b/ocaml/idl/api_errors.ml @@ -204,7 +204,7 @@ let vdi_missing = "VDI_MISSING" let vdi_incompatible_type = "VDI_INCOMPATIBLE_TYPE" let vdi_not_managed = "VDI_NOT_MANAGED" let vdi_io_error = "VDI_IO_ERROR" -let vdi_on_boot_mode_incompatable_with_operation = "VDI_ON_BOOT_MODE_INCOMPATABLE_WITH_OPERATION" +let vdi_on_boot_mode_incompatible_with_operation = "VDI_ON_BOOT_MODE_INCOMPATIBLE_WITH_OPERATION" let vdi_not_in_map = "VDI_NOT_IN_MAP" let cannot_create_state_file = "CANNOT_CREATE_STATE_FILE" diff --git a/ocaml/idl/datamodel.ml b/ocaml/idl/datamodel.ml index d905b30f2e7..709be312f65 100644 --- a/ocaml/idl/datamodel.ml +++ b/ocaml/idl/datamodel.ml @@ -889,7 +889,9 @@ let _ = error Api_errors.vdi_not_in_map [ "vdi" ] ~doc:"This VDI was not mapped to a destination SR in VM.migrate_send operation" () ; error Api_errors.vdi_copy_failed [] - ~doc:"The VDI copy action has failed" (); + ~doc:"The VDI copy action has failed" (); + error Api_errors.vdi_on_boot_mode_incompatible_with_operation [] + ~doc:"This operation is not permitted on VMs containing VDIs in the 'on-boot=reset' mode" (); error Api_errors.cannot_create_state_file [] ~doc:"An HA statefile could not be created, perhaps because no SR with the appropriate capability was found." (); diff --git a/ocaml/xapi/xapi_vdi.ml b/ocaml/xapi/xapi_vdi.ml index 376c3ead7b1..07d2743fa75 100644 --- a/ocaml/xapi/xapi_vdi.ml +++ b/ocaml/xapi/xapi_vdi.ml @@ -163,7 +163,7 @@ let check_operation_error ~__context ?(sr_records=[]) ?(pbd_records=[]) ?(vbd_re | `snapshot when record.Db_actions.vDI_sharable -> Some (Api_errors.vdi_is_sharable, [ _ref ]) | `snapshot when reset_on_boot -> - Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation, []) + Some (Api_errors.vdi_on_boot_mode_incompatible_with_operation, []) | `copy -> if List.mem record.Db_actions.vDI_type [ `ha_statefile; `redo_log ] then Some (Api_errors.operation_not_allowed, ["VDI containing HA statefile or redo log cannot be copied (check the VDI's allowed operations)."]) diff --git a/ocaml/xapi/xapi_vm_lifecycle.ml b/ocaml/xapi/xapi_vm_lifecycle.ml index de51b5d777e..a9653b2871f 100644 --- a/ocaml/xapi/xapi_vm_lifecycle.ml +++ b/ocaml/xapi/xapi_vm_lifecycle.ml @@ -300,12 +300,12 @@ let check_operation_error ~__context ~vmr ~vmgmr ~ref ~clone_suspended_vm_enable if op = `checkpoint || op = `snapshot || op = `suspend || op = `snapshot_with_quiesce then (* If any vdi exists with on_boot=reset, then disallow checkpoint, snapshot, suspend *) if List.exists fst vdis_reset_and_caching - then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[]) + then Some (Api_errors.vdi_on_boot_mode_incompatible_with_operation,[]) else None else if op = `pool_migrate then (* If any vdi exists with on_boot=reset and caching is enabled, disallow migrate *) if List.exists (fun (reset,caching) -> reset && caching) vdis_reset_and_caching - then Some (Api_errors.vdi_on_boot_mode_incompatable_with_operation,[]) + then Some (Api_errors.vdi_on_boot_mode_incompatible_with_operation,[]) else None else None) in diff --git a/ocaml/xapi/xapi_vm_migrate.ml b/ocaml/xapi/xapi_vm_migrate.ml index ec0d511fdf5..6c10b8b0df8 100644 --- a/ocaml/xapi/xapi_vm_migrate.ml +++ b/ocaml/xapi/xapi_vm_migrate.ml @@ -289,7 +289,7 @@ let migrate_send' ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options = (* Block SXM when VM has a VDI with on_boot=reset *) List.(iter (fun (vdi,_,_,_,_,_,_,_) -> if (Db.VDI.get_on_boot ~__context ~self:vdi ==`reset) then - raise (Api_errors.Server_error(Api_errors.vdi_on_boot_mode_incompatable_with_operation, [Ref.string_of vdi]))) vdis) ; + raise (Api_errors.Server_error(Api_errors.vdi_on_boot_mode_incompatible_with_operation, [Ref.string_of vdi]))) vdis) ; let snapshots_vdis = List.filter_map (vdi_filter true) snapshots_vbds in let total_size = List.fold_left (fun acc (_,_,_,_,_,sz,_,_) -> Int64.add acc sz) 0L (vdis @ snapshots_vdis) in