migration: add missing eval on nbdstop with tunnel v2

It was already done in tunnel v1.

Avoid to avoid migration (and keep both source/targetvm locked) if
nbdstop error occur

2023-09-28 16:20:39 ERROR: error - tunnel command '{"cmd":"nbdstop"}' failed - failed to handle 'nbdstop' command - VM 140 qmp command 'nbd-server-stop' failed - got timeout
2023-09-28 16:20:39 ERROR: migration finished with problems (duration 00:01:42)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Alexandre Derumier 2023-09-29 10:28:59 +02:00 committed by Thomas Lamprecht
parent 6cb2338f53
commit c2f4482053

View File

@ -1477,7 +1477,13 @@ sub phase3_cleanup {
$self->log('info', "stopping NBD storage migration server on target.");
# stop nbd server on remote vm - requirement for resume since 2.9
if ($tunnel && $tunnel->{version} && $tunnel->{version} >= 2) {
PVE::Tunnel::write_tunnel($tunnel, 30, 'nbdstop');
eval {
PVE::Tunnel::write_tunnel($tunnel, 30, 'nbdstop');
};
if (my $err = $@) {
$self->log('err', $err);
$self->{errors} = 1;
}
} else {
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'nbdstop', $vmid];