From: Stefan Hanreich <s.hanreich@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Christoph Heiss <c.heiss@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager v2 13/13] ui: window: Migrate: add checkbox for migrating VM conntrack state
Date: Tue, 3 Jun 2025 11:32:50 +0200 [thread overview]
Message-ID: <c1fdc0ef-a957-43c9-9441-47c906a7948e@proxmox.com> (raw)
In-Reply-To: <20250424111941.730528-14-c.heiss@proxmox.com>
On 4/24/25 13:19, Christoph Heiss wrote:
> Adds a new checkbox to the migration dialog, if it is a
> live/online-migration and both the source and target nodes have support
> for our dbus-vmstate helper.
>
> If the checkbox is active, it passes along the `with-conntrack-state`
> parameter to the migrate API call.
>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> Changes v1 -> v2:
> * rebased on latest master
>
> www/manager6/window/Migrate.js | 73 ++++++++++++++++++++++++++++++++--
> 1 file changed, 69 insertions(+), 4 deletions(-)
>
> diff --git a/www/manager6/window/Migrate.js b/www/manager6/window/Migrate.js
> index 87b50bbd5..dea406515 100644
> --- a/www/manager6/window/Migrate.js
> +++ b/www/manager6/window/Migrate.js
> @@ -29,8 +29,9 @@ Ext.define('PVE.window.Migrate', {
> allowedNodes: undefined,
> overwriteLocalResourceCheck: false,
> hasLocalResources: false,
> + withConntrackState: true,
> + bothHaveDbusVmstate: false,
> },
> -
> },
>
> formulas: {
> @@ -60,6 +61,9 @@ Ext.define('PVE.window.Migrate', {
> return false;
> }
> },
> + conntrackStateCheckboxHidden: get =>
> + !get('running') || get('vmtype') !== 'qemu' ||
> + !get('migration.bothHaveDbusVmstate'),
> },
> },
>
> @@ -139,6 +143,10 @@ Ext.define('PVE.window.Migrate', {
> params.force = 1;
> }
>
> + if (vm.get('migration.bothHaveDbusVmstate') && vm.get('migration.withConntrackState')) {
> + params['with-conntrack-state'] = 1;
> + }
> +
> Proxmox.Utils.API2Request({
> params: params,
> url: '/nodes/' + vm.get('nodename') + '/' + vm.get('vmtype') + '/' + vm.get('vmid') + '/migrate',
> @@ -205,12 +213,28 @@ Ext.define('PVE.window.Migrate', {
> method: 'GET',
> });
> migrateStats = result.data;
> - me.fetchingNodeMigrateInfo = false;
> } catch (error) {
> Ext.Msg.alert(Proxmox.Utils.errorText, error.htmlStatus);
> + me.fetchingNodeMigrateInfo = false;
> return;
> }
>
> + const target = me.lookup('pveNodeSelector').value;
> + let targetCapabilities = {};
> +
> + try {
> + const { result } = await Proxmox.Async.api2({
> + url: `/nodes/${target}/capabilities/qemu/migration`,
> + method: 'GET',
> + });
> + targetCapabilities = result.data;
> + } catch (err) {
> + // In the case the target node does not (yet) support the
> + // `capabilites/qemu/migration` endpoint, just ignore it.
Maybe we could check for the respective HTTP status code here explicitly
and at least show/log the error in either case? Maybe not so uncommon
during the upgrade procedures (from 8 -> 9 at least).
> + }
> +
> + me.fetchingNodeMigrateInfo = false;
> +
> if (migrateStats.running) {
> vm.set('running', true);
> }
> @@ -220,7 +244,6 @@ Ext.define('PVE.window.Migrate', {
> migration.possible = true;
> }
> migration.preconditions = [];
> - let target = me.lookup('pveNodeSelector').value;
> let disallowed = migrateStats.not_allowed_nodes?.[target] ?? {};
>
> if (migrateStats.allowed_nodes && !vm.get('running')) {
> @@ -330,6 +353,29 @@ Ext.define('PVE.window.Migrate', {
> });
> }
>
> + migration.bothHaveDbusVmstate = migrateStats['has-dbus-vmstate'] && targetCapabilities['has-dbus-vmstate'];
> + if (vm.get('running')) {
> + if (migration.withConntrackState && !migrateStats['has-dbus-vmstate']) {
> + migration.preconditions.push({
> + text: gettext('Cannot migrate conntrack state, source node is lacking support. Active network connections might get dropped.'),
> + severity: 'warning',
> + });
> + }
> + if (migration.withConntrackState && !targetCapabilities['has-dbus-vmstate']) {
> + migration.preconditions.push({
> + text: gettext('Cannot migrate conntrack state, target node is lacking support. Active network connections might get dropped.'),
> + severity: 'warning',
> + });
> + }
> +
> + if (migration.bothHaveDbusVmstate && !migration.withConntrackState) {
> + migration.preconditions.push({
> + text: gettext('Conntrack state migration disabled. Active network connections might get dropped.'),
> + severity: 'warning',
> + });
> + }
> + }
> +
> vm.set('migration', migration);
> },
> checkLxcPreconditions: function(resetMigrationPossible) {
> @@ -421,7 +467,26 @@ Ext.define('PVE.window.Migrate', {
> extraArg: true,
> },
> },
> - }],
> + },
> + {
> + xtype: 'proxmoxcheckbox',
> + name: 'withConntrackState',
> + fieldLabel: gettext('Conntrack state'),
> + autoEl: {
> + tag: 'div',
> + 'data-qtip': gettext('Enables live migration of conntrack entries for this VM.'),
> + },
> + bind: {
> + hidden: '{conntrackStateCheckboxHidden}',
> + value: '{migration.withConntrackState}',
> + },
> + listeners: {
> + change: {
> + fn: 'checkMigratePreconditions',
> + extraArg: true,
> + },
> + },
> + }],
> },
> ],
> },
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-06-03 9:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 11:19 [pve-devel] [PATCH ve-rs/firewall/qemu-server/manager v2 00/13] fix #5180: migrate conntrack state on live migration Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH proxmox-ve-rs v2 1/13] config: guest: allow access to raw Vmid value Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH proxmox-firewall v2 2/13] firewall: add connmark rule with VMID to all guest chains Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH pve-firewall v2 3/13] " Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH pve-firewall v2 4/13] firewall: helpers: add sub for flushing conntrack entries by mark Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH qemu-server v2 5/13] qmp helpers: allow passing structured args via qemu_objectadd() Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH qemu-server v2 6/13] api2: qemu: add module exposing node migration capabilities Christoph Heiss
2025-04-24 12:02 ` Fiona Ebner
2025-04-25 8:40 ` Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH qemu-server v2 7/13] fix #5180: libexec: add QEMU dbus-vmstate daemon for migrating conntrack Christoph Heiss
2025-06-03 9:34 ` Stefan Hanreich
2025-06-11 10:44 ` Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH qemu-server v2 8/13] fix #5180: migrate: integrate helper for live-migrating conntrack info Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH qemu-server v2 9/13] migrate: flush old VM conntrack entries after successful migration Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH manager v2 10/13] api2: capabilities: explicitly import CPU capabilities module Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH manager v2 11/13] api2: capabilities: proxy index endpoints to respective nodes Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH manager v2 12/13] api2: capabilities: expose new qemu/migration endpoint Christoph Heiss
2025-04-24 11:19 ` [pve-devel] [PATCH manager v2 13/13] ui: window: Migrate: add checkbox for migrating VM conntrack state Christoph Heiss
2025-06-03 9:32 ` Stefan Hanreich [this message]
2025-05-30 11:34 ` [pve-devel] [PATCH ve-rs/firewall/qemu-server/manager v2 00/13] fix #5180: migrate conntrack state on live migration Stefan Hanreich
2025-06-03 9:35 ` Stefan Hanreich
2025-06-04 9:00 ` Christoph Heiss
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=c1fdc0ef-a957-43c9-9441-47c906a7948e@proxmox.com \
--to=s.hanreich@proxmox.com \
--cc=c.heiss@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal