From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 qemu-server] Fix #2728: die/warn if target is not a replication target when live-migrating
Date: Wed, 22 Jul 2020 13:37:31 +0200 [thread overview]
Message-ID: <b03371c0-af9b-0b35-c787-06fd9c798a7d@proxmox.com> (raw)
In-Reply-To: <20200518073757.10943-1-f.ebner@proxmox.com>
Ping for this patch
Am 18.05.20 um 09:37 schrieb Fabian Ebner:
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>
> Changes from v1:
> * die/warn depending on force (thanks to Thomas and Aaron for the suggestion)
> * don't die/warn if VM is not replicated at all
>
> PVE/API2/Qemu.pm | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index fd51bf3..cb99f78 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -3486,6 +3486,19 @@ __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();
> + 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 {
> warn "VM isn't running. Doing offline migration instead.\n" if $param->{online};
> $param->{online} = 0;
>
next parent reply other threads:[~2020-07-22 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200518073757.10943-1-f.ebner@proxmox.com>
2020-07-22 11:37 ` Fabian Ebner [this message]
2020-07-24 5:29 ` [pve-devel] applied: " Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b03371c0-af9b-0b35-c787-06fd9c798a7d@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=t.lamprecht@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.