From 31b522478dd4157ae4e30c574b01f27d3a88adde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 20 Dec 2016 12:30:57 +0100 Subject: [PATCH] destroy_vm: allow vdisk_free to fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit otherwise we end up with undeletable VM configs in case vdisk_free fails (which could happen because of cluster-wide lock contention, storage problems, ..). Signed-off-by: Fabian Grünbichler --- PVE/QemuServer.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 43dd97a7..aeb710ab 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2082,7 +2082,11 @@ sub destroy_vm { my ($path, $owner) = PVE::Storage::path($storecfg, $volid); return if !$path || !$owner || ($owner != $vmid); - PVE::Storage::vdisk_free($storecfg, $volid); + eval { + PVE::Storage::vdisk_free($storecfg, $volid); + }; + warn "Could not remove disk '$volid', check manually: $@" if $@; + }); if ($keep_empty_config) {