destroy vm: clean up potential left-over fleecing images

Avoids that any left-over fleecing images become orphaned.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250127112923.31703-17-f.ebner@proxmox.com
This commit is contained in:
Fiona Ebner 2025-01-27 12:29:23 +01:00 committed by Thomas Lamprecht
parent 4e659fcac6
commit a5185ba114

View File

@ -2122,6 +2122,9 @@ sub check_type {
sub destroy_vm {
my ($storecfg, $vmid, $skiplock, $replacement_conf, $purge_unreferenced) = @_;
eval { PVE::QemuConfig::cleanup_fleecing_images($vmid, $storecfg) };
log_warn("attempt to clean up left-over fleecing images failed - $@") if $@;
my $conf = PVE::QemuConfig->load_config($vmid);
if (!$skiplock && !PVE::QemuConfig->has_lock($conf, 'suspended')) {