Skip to content

Commit 3d039f3

Browse files
committed
CA-380580: cross-pool migration: no CPU checks for halted VMs
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]>
1 parent dd449e0 commit 3d039f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ocaml/xapi/xapi_vm_migrate.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
11821182
We look at the VDIs of the VM, the VDIs of all of the snapshots, and any
11831183
suspend-image VDIs. *)
11841184
let vm_uuid = Db.VM.get_uuid ~__context ~self:vm in
1185+
let power_state = Db.VM.get_power_state ~__context ~self:vm in
11851186
let vbds = Db.VM.get_VBDs ~__context ~self:vm in
11861187
let vifs = Db.VM.get_VIFs ~__context ~self:vm in
11871188
let snapshots = Db.VM.get_snapshots ~__context ~self:vm in
@@ -1240,7 +1241,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
12401241
let suspends_vdis =
12411242
List.fold_left
12421243
(fun acc vm ->
1243-
if Db.VM.get_power_state ~__context ~self:vm = `Suspended then
1244+
if power_state = `Suspended then
12441245
let vdi = Db.VM.get_suspend_VDI ~__context ~self:vm in
12451246
let sr = Db.VDI.get_SR ~__context ~self:vdi in
12461247
if
@@ -1456,7 +1457,7 @@ let migrate_send' ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~vgpu_map
14561457
in
14571458
inter_pool_metadata_transfer ~__context ~remote ~vm ~vdi_map
14581459
~vif_map ~vgpu_map ~dry_run:false ~live:true ~copy
1459-
~check_cpu:(not force)
1460+
~check_cpu:((not force) && power_state <> `Halted)
14601461
in
14611462
let vm = List.hd vms in
14621463
let () =
@@ -1833,7 +1834,7 @@ let assert_can_migrate ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~options
18331834
not
18341835
(inter_pool_metadata_transfer ~__context ~remote ~vm ~vdi_map
18351836
~vif_map ~vgpu_map ~dry_run:true ~live:true ~copy
1836-
~check_cpu:(not force)
1837+
~check_cpu:((not force) && power_state <> `Halted)
18371838
= []
18381839
)
18391840
then

0 commit comments

Comments
 (0)