mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 19:20:11 +00:00
migrate: add log for guest fstrim
and make a failure noticable. Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
73b8b0bc49
commit
0028391f95
@ -1170,14 +1170,23 @@ sub phase3_cleanup {
|
||||
$self->{errors} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
$self->{storage_migration}
|
||||
&& PVE::QemuServer::parse_guest_agent($conf)->{fstrim_cloned_disks}
|
||||
&& $self->{running}
|
||||
) {
|
||||
if (
|
||||
$self->{storage_migration}
|
||||
&& PVE::QemuServer::parse_guest_agent($conf)->{fstrim_cloned_disks}
|
||||
&& $self->{running}
|
||||
) {
|
||||
if (!$self->{vm_was_paused}) {
|
||||
$self->log('info', "issuing guest fstrim");
|
||||
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'guest', 'cmd', $vmid, 'fstrim'];
|
||||
eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
||||
eval { PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
||||
if (my $err = $@) {
|
||||
$self->log('err', "fstrim failed - $err");
|
||||
$self->{errors} = 1;
|
||||
}
|
||||
} else {
|
||||
$self->log('info', "skipping guest fstrim, because VM is paused");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user