migration: attempt to clean up potential left-over fleecing images

Clean up left-over fleecing images before the guest is migrated to a
different node and they'd really 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-16-f.ebner@proxmox.com
This commit is contained in:
Fiona Ebner 2025-01-27 12:29:22 +01:00 committed by Thomas Lamprecht
parent a39866732f
commit 4e659fcac6

View File

@ -177,6 +177,13 @@ sub prepare {
my $storecfg = $self->{storecfg} = PVE::Storage::config();
# updates the configuration, so ordered before saving the configuration in $self
eval {
PVE::QemuConfig::cleanup_fleecing_images(
$vmid, $storecfg, sub { $self->log($_[0], $_[1]); });
};
$self->log('warn', "attempt to clean up left-over fleecing images failed - $@") if $@;
# test if VM exists
my $conf = $self->{vmconf} = PVE::QemuConfig->load_config($vmid);