destroy_vm: allow vdisk_free to fail

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 <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2016-12-20 12:30:57 +01:00 committed by Dietmar Maurer
parent 0db93c2d8a
commit 31b522478d

View File

@ -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) {