Skip to content

Commit a53ec8f

Browse files
committed
Merge pull request xapi-project#1296 from siddharthv/CA-108234
CA-108234: Prevent VM migration onto a host with lower platform version
2 parents a7d0f38 + b79b9d0 commit a53ec8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ocaml/xapi/xapi_vm_migrate.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,10 @@ let assert_can_migrate ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options =
664664
| _ ->
665665
raise (Api_errors.Server_error (Api_errors.vm_has_too_many_snapshots, [Ref.string_of vm])));
666666

667+
(* Prevent VMs from being migrated onto a host with a lower host version *)
668+
let source_host = Db.VM.get_resident_on ~__context ~self:vm in
669+
Helpers.assert_host_versions_not_decreasing ~__context ~host_from:source_host ~host_to:dest_host_ref ;
670+
667671
let migration_type =
668672
try
669673
ignore(Db.Host.get_uuid ~__context ~self:dest_host_ref);

0 commit comments

Comments
 (0)