[pve-devel] [PATCH qemu-server] Warn if target is not a replication target when live-migrating

Fabian Ebner f.ebner at proxmox.com
Thu May 14 12:47:28 CEST 2020


Partially fixes #2728 (GUI part is still needed).

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/API2/Qemu.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index fd51bf3..8e993a9 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -3486,6 +3486,12 @@ __PACKAGE__->register_method({
 
 	if (PVE::QemuServer::check_running($vmid)) {
 	    die "can't migrate running VM without --online\n" if !$param->{online};
+
+	    my $repl_conf = PVE::ReplicationConfig->new();
+	    if (!defined($repl_conf->find_local_replication_job($vmid, $target))) {
+		warn "WARNING: Node '$target' is not a replication target. Existing " .
+		     "replication jobs will fail after live-migration!\n";
+	    }
 	} else {
 	    warn "VM isn't running. Doing offline migration instead.\n" if $param->{online};
 	    $param->{online} = 0;
-- 
2.20.1





More information about the pve-devel mailing list