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

Aaron Lauterer a.lauterer at proxmox.com
Thu May 14 15:09:32 CEST 2020


Works as expected.

Throws a warning when migrating a running VM to a node to which no 
replication job is set up.

Since I wasn't following all of the previous off-list discusion: Do we 
just want a warning that could be overseen quite easily instead of dying?

Nonetheless:

Tested-By: Aaron Lauterer <a.lauterer at proxmox.com>

On 5/14/20 12:47 PM, Fabian Ebner wrote:
> 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;
> 




More information about the pve-devel mailing list