Skip to content

Commit

Permalink
Merge pull request #5132 from robhoes/master
Browse files Browse the repository at this point in the history
CA-380580: cross-pool migration: no CPU checks for halted VMs
  • Loading branch information
robhoes authored Jul 27, 2023
2 parents d738f6a + 3d039f3 commit 43ba295
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 43ba295

Please sign in to comment.