mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 19:20:11 +00:00
Fix #2728: die/warn if target is not a replication target when live-migrating
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com> Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
parent
503e96f8de
commit
aa491a6ecd
@ -3535,6 +3535,19 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
if (PVE::QemuServer::check_running($vmid)) {
|
if (PVE::QemuServer::check_running($vmid)) {
|
||||||
die "can't migrate running VM without --online\n" if !$param->{online};
|
die "can't migrate running VM without --online\n" if !$param->{online};
|
||||||
|
|
||||||
|
my $repl_conf = PVE::ReplicationConfig->new();
|
||||||
|
my $is_replicated = $repl_conf->check_for_existing_jobs($vmid, 1);
|
||||||
|
my $is_replicated_to_target = defined($repl_conf->find_local_replication_job($vmid, $target));
|
||||||
|
if ($is_replicated && !$is_replicated_to_target) {
|
||||||
|
if ($param->{force}) {
|
||||||
|
warn "WARNING: Node '$target' is not a replication target. Existing replication " .
|
||||||
|
"jobs will fail after migration!\n";
|
||||||
|
} else {
|
||||||
|
die "Cannot live-migrate replicated VM to node '$target' - not a replication target." .
|
||||||
|
" Use 'force' to override.\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
warn "VM isn't running. Doing offline migration instead.\n" if $param->{online};
|
warn "VM isn't running. Doing offline migration instead.\n" if $param->{online};
|
||||||
$param->{online} = 0;
|
$param->{online} = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user