Skip to content

Commit 179be08

Browse files
author
David Scott
committed
VDI.epoch_begin: delete any leftover clone-on-boot VDI we may have
Signed-off-by: David Scott <[email protected]>
1 parent de23bc3 commit 179be08

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,13 @@ let process root_dir name x =
665665
end else begin
666666
(* We create a non-persistent disk here with Volume.clone, and store
667667
the name of the cloned disk in the metadata of the original. *)
668+
( match List.Assoc.find response.Storage.Volume.Types.keys _clone_on_boot_key with
669+
| None ->
670+
return (Ok ())
671+
| Some temporary ->
672+
(* Destroy the temporary disk we made earlier *)
673+
destroy root_dir name args.Args.VDI.Epoch_begin.dbg sr temporary
674+
) >>= fun () ->
668675
clone root_dir name args.Args.VDI.Epoch_begin.dbg sr args.Args.VDI.Epoch_begin.vdi
669676
>>= fun vdi ->
670677
set root_dir name args.Args.VDI.Epoch_begin.dbg sr args.Args.VDI.Epoch_begin.vdi _clone_on_boot_key vdi.Storage.Volume.Types.key

0 commit comments

Comments
 (0)