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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-01-25 15:49:39 +01:00
parent 7585466269
commit 3e9d173caa

View File

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