From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 51B771FF15E for <inbox@lore.proxmox.com>; Tue, 3 Jun 2025 11:33:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0C3D214B86; Tue, 3 Jun 2025 11:33:25 +0200 (CEST) Message-ID: <c1fdc0ef-a957-43c9-9441-47c906a7948e@proxmox.com> Date: Tue, 3 Jun 2025 11:32:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>, Christoph Heiss <c.heiss@proxmox.com> References: <20250424111941.730528-1-c.heiss@proxmox.com> <20250424111941.730528-14-c.heiss@proxmox.com> Content-Language: en-US From: Stefan Hanreich <s.hanreich@proxmox.com> In-Reply-To: <20250424111941.730528-14-c.heiss@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.683 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH manager v2 13/13] ui: window: Migrate: add checkbox for migrating VM conntrack state X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.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