File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2040,12 +2040,16 @@ let vm_install_real printer rpc session_id template name description params =
20402040
20412041 let suspend_sr_ref = match sr_ref with
20422042 | Some sr ->
2043- if sr = Ref. null then
2044- (* Template is a snapshot - copy the suspend_SR from the template *)
2045- Client.VM. get_suspend_SR rpc session_id template
2046- else
2043+ let ref_is_valid = Server_helpers. exec_with_new_task
2044+ ~session_id " Checking suspend_SR validity"
2045+ (fun __context -> Db. is_valid_ref __context sr)
2046+ in
2047+ if ref_is_valid then
20472048 (* sr-uuid and/or sr-name-label was specified - use this as the suspend_SR *)
20482049 sr
2050+ else
2051+ (* Template is a snapshot - copy the suspend_SR from the template *)
2052+ Client.VM. get_suspend_SR rpc session_id template
20492053 | None ->
20502054 (* Not a snapshot and no sr-uuid or sr-name-label specified - copy the suspend_SR from the template *)
20512055 Client.VM. get_suspend_SR rpc session_id template in
You can’t perform that action at this time.
0 commit comments