Skip to content

Commit 2994fcd

Browse files
authored
CA-402263, xapi_sr_operatrions: don't include all API storage operations in all_ops (#6133)
Otherwise the allowed_operations field in SRs can contain newly added operations, which can break cross-pool migrations when using `xe`. This regression was introduced by e40b3fc Partially reverts 723a498 I've manually tested the migration from a host with xapi 24.36.0 to a host with xapi 24.37.0.23.g2e1274d56 ([this patch](2e1274d) on top of master) ``` # xe vm-migrate uuid=7ab2ad94-7d09-1fd5-b49a-19880a0908fc remote-master=10.73.82.91 remote-username=root remote-password=(...) host=xseu-41-03 vif:c07b60e0-1019-99d0-5680-03bdfcc33db5=1aa3b953-21a8-79fd-35b6-337d556336cb Performing a storage live migration. Your VM's VDIs will be migrated with the VM. Will migrate to remote host: xseu-41-03, using remote network: Pool-wide network associated with eth0. Here is the VDI mapping: VDI 9bffe7a3-410e-4e65-82f1-1db6794c18c2 -> SR 17df852a-9463-a591-6196-5f4af08bc888 ```
2 parents 8f49371 + 4083494 commit 2994fcd

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

ocaml/xapi/xapi_sr_operations.ml

+26-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,32 @@ open Client
2626

2727
open Record_util
2828

29-
let all_ops = API.storage_operations__all
29+
(* This is a subset of the API enumeration. Not all values can be included
30+
because older versions which don't have them are unable to migrate VMs to the
31+
the versions that have new fields in allowed operations *)
32+
let all_ops : API.storage_operations_set =
33+
[
34+
`scan
35+
; `destroy
36+
; `forget
37+
; `plug
38+
; `unplug
39+
; `vdi_create
40+
; `vdi_destroy
41+
; `vdi_resize
42+
; `vdi_clone
43+
; `vdi_snapshot
44+
; `vdi_mirror
45+
; `vdi_enable_cbt
46+
; `vdi_disable_cbt
47+
; `vdi_data_destroy
48+
; `vdi_list_changed_blocks
49+
; `vdi_set_on_boot
50+
; `vdi_introduce
51+
; `update
52+
; `pbd_create
53+
; `pbd_destroy
54+
]
3055

3156
(* This list comes from https://github.com/xenserver/xen-api/blob/tampa-bugfix/ocaml/xapi/xapi_sr_operations.ml#L36-L38 *)
3257
let all_rpu_ops : API.storage_operations_set =

0 commit comments

Comments
 (0)