From 6b72854b959513670c6b682656e3a14554154bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 15 Sep 2016 13:24:35 +0200 Subject: [PATCH] restore: better error handling for vdisk deletion when restoring into an existing VM, we don't want to die half-way through because we can't delete one of the existing volumes. instead, warn about the deletion failure, but continue anyway. the not deleted disk is then added as unused automatically. --- PVE/QemuServer.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index c3a53c9c..dbd85a0e 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -5343,7 +5343,10 @@ sub restore_vma_archive { # Note: only delete disk we want to restore # other volumes will become unused if ($virtdev_hash->{$ds}) { - PVE::Storage::vdisk_free($cfg, $volid); + eval { PVE::Storage::vdisk_free($cfg, $volid); }; + if (my $err = $@) { + warn $err; + } } });