mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-14 02:38:23 +00:00
fix #1338: migrate: stop nbd before resuming
since Qemu 2.9, block device write access is limited to one
writer unless shared_rw is set to true. there is an
exception for live-migrating local disks via NBD as long as
the VM is suspended.
stop the NBD server before resuming the VM accordingly to
unbreak local disk live-migration.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 504105c638
)
This commit is contained in:
parent
9373a5b0d4
commit
9e53898bd2
@ -884,6 +884,16 @@ sub phase3_cleanup {
|
||||
if !rename($conffile, $newconffile);
|
||||
|
||||
if ($self->{livemigration}) {
|
||||
if ($self->{storage_migration}) {
|
||||
# stop nbd server on remote vm - requirement for resume since 2.9
|
||||
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'nbdstop', $vmid];
|
||||
|
||||
eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
||||
if (my $err = $@) {
|
||||
$self->log('err', $err);
|
||||
$self->{errors} = 1;
|
||||
}
|
||||
}
|
||||
# now that config file is move, we can resume vm on target if livemigrate
|
||||
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'resume', $vmid, '--skiplock', '--nocheck'];
|
||||
eval{ PVE::Tools::run_command($cmd, outfunc => sub {},
|
||||
@ -942,14 +952,6 @@ sub phase3_cleanup {
|
||||
}
|
||||
}
|
||||
|
||||
#stop nbd server to remote vm
|
||||
my $cmd = [@{$self->{rem_ssh}}, 'qm', 'nbdstop', $vmid];
|
||||
|
||||
eval{ PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => sub {}) };
|
||||
if (my $err = $@) {
|
||||
$self->log('err', $err);
|
||||
$self->{errors} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# clear migrate lock
|
||||
|
Loading…
Reference in New Issue
Block a user