Skip to content

Commit 4b72ad9

Browse files
authored
xapi_vm_migrate: Avoid duplicate, overly-strict CBT check on VDIs (#6405)
There is already a call to `assert_can_migrate_vdis` present in `assert_can_migrate`, which checks that none of the VDIs that *are going to be moved* have CBT enabled. There is no need to additionally check that none of the VDIs *in general* have CBT enabled. Some clients, like XenOrchestra, will turn off CBT on VDIs and retry migration after getting the `VDI_CBT_ENABLED` error on live migration. Dropping this overly strict check allows not stripping CBT when VDI will not be moved (when it's on a shared SR). In addition, during rolling pool upgrades, disabling CBT is not allowed, hence the live migration operation wouldn't be able to continue. Avoiding the strict check fixes that as well. Closes #6400
2 parents 790aa22 + bedf269 commit 4b72ad9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ocaml/xapi/xapi_vm_migrate.ml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,14 +1778,6 @@ let assert_can_migrate ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~options
17781778
let vbds = Db.VM.get_VBDs ~__context ~self:vm in
17791779
let vms_vdis = List.filter_map (vdi_filter __context true) vbds in
17801780
check_vdi_map ~__context vms_vdis vdi_map ;
1781-
(* Prevent SXM when the VM has a VDI on which changed block tracking is enabled *)
1782-
List.iter
1783-
(fun vconf ->
1784-
let vdi = vconf.vdi in
1785-
if Db.VDI.get_cbt_enabled ~__context ~self:vdi then
1786-
raise Api_errors.(Server_error (vdi_cbt_enabled, [Ref.string_of vdi]))
1787-
)
1788-
vms_vdis ;
17891781
(* operations required for migration *)
17901782
let required_src_sr_operations = Smint.Feature.[Vdi_snapshot; Vdi_mirror] in
17911783
let required_dst_sr_operations =
@@ -1919,6 +1911,9 @@ let assert_can_migrate ~__context ~vm ~dest ~live:_ ~vdi_map ~vif_map ~options
19191911
)
19201912
) ;
19211913
(* check_vdi_map above has already verified that all VDIs are in the vdi_map *)
1914+
(* Previously there was also a check that none of the VDIs have CBT enabled.
1915+
This is unnecessary, we only need to check that none of the VDIs that
1916+
*will be moved* have CBT enabled. *)
19221917
assert_can_migrate_vdis ~__context ~vdi_map
19231918

19241919
let assert_can_migrate_sender ~__context ~vm ~dest ~live:_ ~vdi_map:_ ~vif_map:_

0 commit comments

Comments
 (0)