From 3e9d173caac70fbd7fbe54e073e6974e2c236173 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 25 Jan 2021 15:49:39 +0100 Subject: [PATCH] vm destroy: destroy also unusedX config entries this was previously covered by the "lets destroy ever disk which matches the VMID" feature we disarmed a bit. As unused disks are referenced in the config, it is not subtle to destroy them (and we always did in the past) so fix that regression again for explicitly referenced but unused disks. Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index eb2270c5..8678beff 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2095,8 +2095,8 @@ sub destroy_vm { }); } - # only remove disks owned by this VM - PVE::QemuConfig->foreach_volume($conf, sub { + # only remove disks owned by this VM (referenced in the config) + PVE::QemuConfig->foreach_volume_full($conf, { include_unused => 1 }, sub { my ($ds, $drive) = @_; return if drive_is_cdrom($drive, 1);