From: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>
To: "f.gruenbichler@proxmox.com" <f.gruenbichler@proxmox.com>
Cc: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 qemu-server 2/2] remote-migration: add target-cpu param
Date: Thu, 28 Sep 2023 14:58:53 +0000 [thread overview]
Message-ID: <6f66e5c6d5ba34ce1b7314435b87db5a581736f3.camel@groupe-cyllene.com> (raw)
In-Reply-To: <1682514292.71raew01tr.astroid@yuna.none>
Le mercredi 26 avril 2023 à 15:14 +0200, Fabian Grünbichler a écrit :
> On April 25, 2023 6:52 pm, Alexandre Derumier wrote:
> > This patch add support for remote migration when target
> > cpu model is different.
> >
> > The target vm is restart after the migration
>
> so this effectively introduces a new "hybrid" migration mode ;) the
> changes are a bit smaller than I expected (in part thanks to patch
> #1),
> which is good.
>
> there are semi-frequent requests for another variant (also applicable
> to
> containers) in the form of a two phase migration
> - storage migrate
> - stop guest
> - incremental storage migrate
> - start guest on target
>
> given that it might make sense to save-guard this implementation
> here,
> and maybe switch to a new "mode" parameter?
>
I have implemented in v3 a working switch to remote nbd.
so, after the disk migration, we do a block-job-complete,
source vm is still running and now is running over nbd through the
target-vm.
Then the source vm is shutdown, flushing last pending writes through
nbd.
then the target vm is restarted
> online => switching CPU not allowed
> offline or however-we-call-this-new-mode (or in the future, two-
> phase-restart) => switching CPU allowed
>
> >
Still unsure about it, I have added an extra flag in v3 "-target-
reboot"
- online : check if source vm is online
- target-cpu: change the targetcpu. (only change value on targetvm)
- target-reboot: skip live migration, do shutdown of source vm and
restart of target vm.
> > Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
> > ---
> > PVE/API2/Qemu.pm | 18 ++++++++++++++++++
> > PVE/CLI/qm.pm | 6 ++++++
> > PVE/QemuMigrate.pm | 25 +++++++++++++++++++++++++
> > 3 files changed, 49 insertions(+)
> >
> > diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> > index 587bb22..6703c87 100644
> > --- a/PVE/API2/Qemu.pm
> > +++ b/PVE/API2/Qemu.pm
> > @@ -4460,6 +4460,12 @@ __PACKAGE__->register_method({
> > optional => 1,
> > default => 0,
> > },
> > + 'target-cpu' => {
> > + optional => 1,
> > + description => "Target Emulated CPU model. For
> > online migration, the storage is live migrate, but the memory
> > migration is skipped and the target vm is restarted.",
> > + type => 'string',
> > + format => 'pve-vm-cpu-conf',
> > + },
> > 'target-storage' => get_standard_option('pve-
> > targetstorage', {
> > completion =>
> > \&PVE::QemuServer::complete_migration_storage,
> > optional => 0,
> > @@ -4557,11 +4563,14 @@ __PACKAGE__->register_method({
> > raise_param_exc({ 'target-bridge' => "failed to parse
> > bridge map: $@" })
> > if $@;
> >
> > + my $target_cpu = extract_param($param, 'target-cpu');
>
> this is okay
>
> > +
> > die "remote migration requires explicit storage mapping!\n"
> > if $storagemap->{identity};
> >
> > $param->{storagemap} = $storagemap;
> > $param->{bridgemap} = $bridgemap;
> > + $param->{targetcpu} = $target_cpu;
>
> but this is a bit confusing with the variable/hash key naming ;)
>
Fixed in the v4
...
> >
> > + $remote_conf->{cpu} = $self->{opts}->{targetcpu};
>
> do we need permission checks here (or better, somewhere early on, for
> doing this here)
>
>
>
fixed in v4: do not override cpuconfig is targetcpu is empty.
About permission, I'm not sure but we don't have specific permission
for cpu. Do we need to check perm on vm.config ?
Because Anyway,we should already a have permission to create a vm on
target cluster.
prev parent reply other threads:[~2023-09-28 14:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 16:52 [pve-devel] [PATCH v2 qemu-server 0/2] remote-migration: migration with different cpu Alexandre Derumier
2023-04-25 16:52 ` [pve-devel] [PATCH v2 qemu-server 1/2] migration: move livemigration code in a dedicated sub Alexandre Derumier
2023-04-25 16:52 ` [pve-devel] [PATCH v2 qemu-server 2/2] remote-migration: add target-cpu param Alexandre Derumier
2023-04-26 13:14 ` Fabian Grünbichler
2023-04-27 5:50 ` DERUMIER, Alexandre
2023-04-27 7:32 ` Fabian Grünbichler
2023-04-28 6:43 ` DERUMIER, Alexandre
2023-04-28 9:12 ` Fabian Grünbichler
2023-04-29 7:57 ` Thomas Lamprecht
2023-05-02 8:30 ` Fabian Grünbichler
2023-09-28 14:58 ` DERUMIER, Alexandre [this message]
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=6f66e5c6d5ba34ce1b7314435b87db5a581736f3.camel@groupe-cyllene.com \
--to=alexandre.derumier@groupe-cyllene.com \
--cc=f.gruenbichler@proxmox.com \
--cc=pve-devel@lists.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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal