mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-19 18:06:00 +00:00
improve error message
This commit is contained in:
parent
72afda82a1
commit
d68afb26bf
@ -336,18 +336,19 @@ sub phase2 {
|
|||||||
my $lport = PVE::QemuServer::next_migrate_port();
|
my $lport = PVE::QemuServer::next_migrate_port();
|
||||||
$self->{tunnel} = $self->fork_tunnel($self->{nodeip}, $lport, $rport);
|
$self->{tunnel} = $self->fork_tunnel($self->{nodeip}, $lport, $rport);
|
||||||
|
|
||||||
$self->log('info', "starting online/live migration");
|
$self->log('info', "starting online/live migration on port $lport");
|
||||||
# start migration
|
# start migration
|
||||||
|
|
||||||
my $start = time();
|
my $start = time();
|
||||||
|
|
||||||
PVE::QemuServer::vm_monitor_command($vmid, "migrate -d \"tcp:localhost:$lport\"", 1);
|
my $merr = PVE::QemuServer::vm_monitor_command($vmid, "migrate -d \"tcp:localhost:$lport\"", 1);
|
||||||
|
|
||||||
my $lstat = '';
|
my $lstat = '';
|
||||||
while (1) {
|
while (1) {
|
||||||
sleep (2);
|
sleep (2);
|
||||||
my $stat = PVE::QemuServer::vm_monitor_command($vmid, "info migrate", 1);
|
my $stat = PVE::QemuServer::vm_monitor_command($vmid, "info migrate", 1);
|
||||||
if ($stat =~ m/^Migration status: (active|completed|failed|cancelled)$/im) {
|
if ($stat =~ m/^Migration status: (active|completed|failed|cancelled)$/im) {
|
||||||
|
$merr = undef;
|
||||||
my $ms = $1;
|
my $ms = $1;
|
||||||
|
|
||||||
if ($stat ne $lstat) {
|
if ($stat ne $lstat) {
|
||||||
@ -378,6 +379,7 @@ sub phase2 {
|
|||||||
|
|
||||||
last if $ms ne 'active';
|
last if $ms ne 'active';
|
||||||
} else {
|
} else {
|
||||||
|
die $merr if $merr;
|
||||||
die "unable to parse migration status '$stat' - aborting\n";
|
die "unable to parse migration status '$stat' - aborting\n";
|
||||||
}
|
}
|
||||||
$lstat = $stat;
|
$lstat = $stat;
|
||||||
|
Loading…
Reference in New Issue
Block a user