Skip to content

Commit

Permalink
CA-380580: cross-pool migration: no CPU checks for halted VMs
Browse files Browse the repository at this point in the history
CPU checks are needed only for running VMs that are being migrated, to
check for compatibility with the remote-host's CPUs.

Signed-off-by: Rob Hoes <[email protected]>
  • Loading branch information
robhoes committed Jul 27, 2023
1 parent dd449e0 commit 3d039f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ocaml/xapi/xapi_vm_migrate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
We look at the VDIs of the VM, the VDIs of all of the snapshots, and any
suspend-image VDIs. *)
let vm_uuid = Db.VM.get_uuid ~__context ~self:vm in
let power_state = Db.VM.get_power_state ~__context ~self:vm in
let vbds = Db.VM.get_VBDs ~__context ~self:vm in
let vifs = Db.VM.get_VIFs ~__context ~self:vm in
let snapshots = Db.VM.get_snapshots ~__context ~self:vm in
Expand Down Expand Up @@ -1240,7 +1241,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
let suspends_vdis =
List.fold_left
(fun acc vm ->
if Db.VM.get_power_state ~__context ~self:vm = `Suspended then
if power_state = `Suspended then
let vdi = Db.VM.get_suspend_VDI ~__context ~self:vm in
let sr = Db.VDI.get_SR ~__context ~self:vdi in
if
Expand Down Expand Up @@ -1456,7 +1457,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
in
inter_pool_metadata_transfer ~__context ~remote ~vm ~vdi_map
~vif_map ~vgpu_map ~dry_run:false ~live:true ~copy
~check_cpu:(not force)
~check_cpu:((not force) && power_state <> `Halted)
in
let vm = List.hd vms in
let () =
Expand Down Expand Up @@ -1833,7 +1834,7 @@ let assert_can_migrate ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~options
not
(inter_pool_metadata_transfer ~__context ~remote ~vm ~vdi_map
~vif_map ~vgpu_map ~dry_run:true ~live:true ~copy
~check_cpu:(not force)
~check_cpu:((not force) && power_state <> `Halted)
= []
)
then
Expand Down

0 comments on commit 3d039f3

Please sign in to comment.