Skip to content

Commit 7f42d0d

Browse files
committed
CA-21237: When VM.snapshot_with_quiesce fails, report back the VSS error to the user.
Signed-off-by: Thomas Gazagnaire <[email protected]>
1 parent 0bc4c74 commit 7f42d0d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ocaml/xapi/xapi_vm_snapshot.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,17 @@ let wait_for_snapshot ~__context ~vm ~xs ~domid ~new_name =
108108
(* If an error was occured we get the error type and return *)
109109
let error_str = xs.Xs.read (snapshot_path ~xs ~domid "error") in
110110
error "wait_for_snapshot: %s" error_str;
111-
raise (Api_errors.Server_error (Api_errors.vm_snapshot_with_quiesce_failed, [ Ref.string_of vm ]))
111+
if List.mem error_str [
112+
Api_errors.xen_vss_req_error_init_failed;
113+
Api_errors.xen_vss_req_error_prov_not_loaded;
114+
Api_errors.xen_vss_req_error_no_volumes_supported;
115+
Api_errors.xen_vss_req_error_start_snapshot_set_failed;
116+
Api_errors.xen_vss_req_error_adding_volume_to_snapset_failed;
117+
Api_errors.xen_vss_req_error_preparing_writers;
118+
Api_errors.xen_vss_req_error_creating_snapshot;
119+
Api_errors.xen_vss_req_error_creating_snapshot_xml_string ]
120+
then raise (Api_errors.Server_error (error_str, [ Ref.string_of vm ]))
121+
else raise (Api_errors.Server_error (Api_errors.vm_snapshot_with_quiesce_failed, [ Ref.string_of vm; error_str ]))
112122

113123
| e ->
114124
failwith (Printf.sprintf "wait_for_snapshot: unexpected result (%s)" e)

0 commit comments

Comments
 (0)