[pve-devel] [PATCH V2 qemu-server 1/2] enable balloon free-page-reporting
DERUMIER, Alexandre
Alexandre.DERUMIER at groupe-cyllene.com
Wed Mar 16 20:32:23 CET 2022
Le mercredi 16 mars 2022 à 18:48 +0100, Thomas Lamprecht a écrit :
> On 06.03.22 13:46, Alexandre Derumier wrote:
> > Allow balloon device driver to report hints of guest free pages to
> > the host,
> > for auto memory reclaim
> >
> > https://antiphishing.cetsi.fr/proxy/v3?i=WjB4M1dJWGJJMnNGTHV5MuAPDw
> > EdQko7KGyaWIIeme0&r=Skk2OVhvdXl2cm1uOWJtRKZfDro27Y-
> > CXDQsnaz4_yALcilBfMoOADH4vBnleGIe&f=M2FwZHlGNnU1aUlkc09ZNN_YvBMHDOR
> > QlhAYZyYtaZUztHfYUKPa_DyZ9e1ZULhe&u=https%3A//lwn.net/Articles/7594
> > 13/&k=CXOq
> > https://antiphishing.cetsi.fr/proxy/v3?i=WjB4M1dJWGJJMnNGTHV5MuAPDw
> > EdQko7KGyaWIIeme0&r=Skk2OVhvdXl2cm1uOWJtRKZfDro27Y-
> > CXDQsnaz4_yALcilBfMoOADH4vBnleGIe&f=M2FwZHlGNnU1aUlkc09ZNN_YvBMHDOR
> > QlhAYZyYtaZUztHfYUKPa_DyZ9e1ZULhe&u=https%3A//events19.linuxfoundat
> > ion.org/wp-content/uploads/2017/12/KVMForum2018.pdf&k=CXOq
> > Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> > ---
> > PVE/QemuServer.pm | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> > index 42f0fbd..a9e86b3 100644
> > --- a/PVE/QemuServer.pm
> > +++ b/PVE/QemuServer.pm
> > @@ -3846,7 +3846,9 @@ sub config_to_command {
> > # enable balloon by default, unless explicitly disabled
> > if (!defined($conf->{balloon}) || $conf->{balloon}) {
> > my $pciaddr = print_pci_addr("balloon0", $bridges, $arch,
> > $machine_type);
> > - push @$devices, '-device', "virtio-balloon-
> > pci,id=balloon0$pciaddr";
> > + my $ballooncmd = "virtio-balloon-pci,id=balloon0$pciaddr";
> > + $ballooncmd .= ",free-page-reporting=on" if
> > min_version($machine_version, 6, 2);
>
> do we even need to guard this behind 6.2 machine version, as I tried
> to add it
> on a running host and migrations in both directions went just fine
> with a windows
> 10 VM.
>
> Asking mostly because we already have QEMU 6.2 available publicly on
> pvetest and
> use it also for some infrastructure of ours, so if it really would be
> breaking
> we'd need to use our separate qemu-version independent machine bump
> mechanism
> (+pve1).
>
> But it seems that its not required, or did you find that it can
> indeed break live
> migration? fwiw, for us is really only forward migration, from vm
> without reporting
> enabled to vm with reporting enabled, relevant.
>
> > + push @$devices, '-device', $ballooncmd;
> > }
> >
> > if ($conf->{watchdog}) {
>
>
oh , sorry, I thinked that 6.2 was not yet pubicly available.
From my tests:
a already booted vm without the balloon freepage option enabled --->
migrating to new vm with balloon freepage option enabled : works
Then failback it to previous node : works
But starting a new vm with the option enabled then migrate it to a new
vm withtout the option:
migration die on resume.
2022-03-16 20:28:30 average migration speed: 1.5 GiB/s - downtime 30 ms
2022-03-16 20:28:30 migration status: completed
2022-03-16 20:28:30 ERROR: tunnel replied 'ERR: resume failed - VM 104
not running' to command 'resume 104'
2022-03-16 20:28:39 ERROR: migration finished with problems (duration
00:00:18)
TASK ERROR: migration problems
If think this is because guest kernel balloon driver enabled it at boot
only.
Note that I don't think that current windows drivers already support it
(I have looked at the source code, so even if the option is enabled at
qemu level, it don't do nothing inside windows.
So I think that migration will works in both direction with windows
vms.
More information about the pve-devel
mailing list