public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH firewall/qemu-server/manager/docs v5 00/11] fix #5180: migrate conntrack state on live migration
@ 2025-07-30  9:45 Christoph Heiss
  2025-07-30  9:45 ` [pve-devel] [PATCH proxmox-firewall v5 01/11] firewall: add connmark rule with VMID to all guest chains Christoph Heiss
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Christoph Heiss @ 2025-07-30  9:45 UTC (permalink / raw)
  To: pve-devel

Fixes #5180 [0].

This implements migration of per-VM conntrack state on live-migration.

The core of the implementation are in patch #7 & #8. See there for more
details.

Patch #1/#2 implement CONNMARK'ing any VM traffic with their unique
VMID. This is needed later on to filter conntrack entries for the
migration. These three patches can be applied independently,
CONNMARK'ing traffic does not have any visible impact.

Currently, remote/inter-cluster migration is not supported and indicated
to the user with a warning. See also patch #7 for a bit more in-depth
explanation.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=5180

Dependencies
============

qemu-server depends on the pve-firewall/proxmox-firewall changes.

pve-manager only soft-depends on the other, as it will detect whether
conntrack migration is supported.

Testing
=======

I've primarily tested intra-cluster live-migrations, with both the
iptables-based and nftables-based firewall), using the reproducer as
described in #5180. I further verified that the D-Bus services get
started as expected and are _always_ stopped, even in the case of some
migration error.

Finally, I also checked using `conntrack -L -m <vmid>` tool that the
conntrack entries are 
a) added/updated on the target node and 
b) removed from the source node afterwards

Also tested was the migration from/to an "old" (unpatched) node, which
results in the issue as per #5180 & appropriate warnings in the UI.

For remote migrations, tested that the warning is logged as expected.

History
=======

v1: https://lore.proxmox.com/pve-devel/20250317141152.1247324-1-c.heiss@proxmox.com/
v2: https://lore.proxmox.com/pve-devel/20250424111941.730528-1-c.heiss@proxmox.com/
v3: https://lore.proxmox.com/pve-devel/20250703115621.883244-1-c.heiss@proxmox.com/
v4: https://lore.proxmox.com/pve-devel/20250717141530.1471199-1-c.heiss@proxmox.com/

Changes v1 -> v2:
  * rebased as necessary
  * "un-rfc'd" firewall conntrack flushing patches
  * use an instanced systemd service instead of fork+exec for the
    pve-dbus-vmstate helper

Changes v2 -> v3:
  * rebased on trixie/latest masters
  * added documentation patch
  * moved node capability module to 
    PVE::API2::NodeCapabilities::Qemu::Migration, based on Fiona's 
    suggestion

Changes v3 -> v4:
  * rebased on latest masters

Changes v4 -> v5:
  * rebased on latest masters
  * dropped already-applied patches

Diffstat
========

proxmox-firewall:

Christoph Heiss (1):
  firewall: add connmark rule with VMID to all guest chains

 proxmox-firewall/src/firewall.rs              | 14 +++-
 .../integration_tests__firewall.snap          | 84 +++++++++++++++++++
 proxmox-nftables/src/expression.rs            |  9 ++
 proxmox-nftables/src/statement.rs             | 10 ++-
 4 files changed, 114 insertions(+), 3 deletions(-)

pve-firewall:

Christoph Heiss (2):
  firewall: add connmark rule with VMID to all guest chains
  firewall: helpers: add sub for flushing conntrack entries by mark

 debian/control              |  3 ++-
 src/PVE/Firewall.pm         | 14 ++++++++++++--
 src/PVE/Firewall/Helpers.pm | 20 ++++++++++++++++++++
 3 files changed, 34 insertions(+), 3 deletions(-)

qemu-server:

Christoph Heiss (5):
  qmp helpers: allow passing structured args via qemu_objectadd()
  api2: qemu: add module exposing node migration capabilities
  fix #5180: dbus-vmstate: add daemon for QEMUs dbus-vmstate interface
  fix #5180: migrate: integrate helper for live-migrating conntrack info
  migrate: flush old VM conntrack entries after successful migration

 Makefile                                      |   4 +-
 debian/control                                |   7 +-
 src/Makefile                                  |   1 +
 src/PVE/API2/Makefile                         |   1 +
 src/PVE/API2/NodeCapabilities/Makefile        |   9 +
 .../API2/NodeCapabilities/Qemu/Migration.pm   |  48 +++++
 src/PVE/API2/Qemu.pm                          |  75 ++++++++
 src/PVE/CLI/qm.pm                             |   5 +
 src/PVE/QemuMigrate.pm                        |  78 ++++++++
 src/PVE/QemuServer.pm                         |   6 +
 src/PVE/QemuServer/DBusVMState.pm             | 125 +++++++++++++
 src/PVE/QemuServer/Makefile                   |   1 +
 src/PVE/QemuServer/QMPHelpers.pm              |   4 +-
 src/dbus-vmstate/Makefile                     |  11 ++
 src/dbus-vmstate/dbus-vmstate                 | 168 ++++++++++++++++++
 src/dbus-vmstate/org.qemu.VMState1.conf       |  11 ++
 src/dbus-vmstate/pve-dbus-vmstate@.service    |  10 ++
 17 files changed, 560 insertions(+), 4 deletions(-)
 create mode 100644 src/PVE/API2/NodeCapabilities/Makefile
 create mode 100644 src/PVE/API2/NodeCapabilities/Qemu/Migration.pm
 create mode 100644 src/PVE/QemuServer/DBusVMState.pm
 create mode 100644 src/dbus-vmstate/Makefile
 create mode 100755 src/dbus-vmstate/dbus-vmstate
 create mode 100644 src/dbus-vmstate/org.qemu.VMState1.conf
 create mode 100644 src/dbus-vmstate/pve-dbus-vmstate@.service

pve-manager:

Christoph Heiss (2):
  api2: capabilities: expose new qemu/migration endpoint
  ui: window: Migrate: add checkbox for migrating VM conntrack state

 PVE/API2/Capabilities.pm       |  8 +++-
 www/manager6/window/Migrate.js | 82 ++++++++++++++++++++++++++++++++--
 2 files changed, 86 insertions(+), 4 deletions(-)

pve-docs:

Christoph Heiss (1):
  qm: document conntrack state migration for live migrations

 qm.adoc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

-- 
2.47.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-30 23:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-30  9:45 [pve-devel] [PATCH firewall/qemu-server/manager/docs v5 00/11] fix #5180: migrate conntrack state on live migration Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH proxmox-firewall v5 01/11] firewall: add connmark rule with VMID to all guest chains Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH firewall v5 02/11] " Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH firewall v5 03/11] firewall: helpers: add sub for flushing conntrack entries by mark Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH qemu-server v5 04/11] qmp helpers: allow passing structured args via qemu_objectadd() Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH qemu-server v5 05/11] api2: qemu: add module exposing node migration capabilities Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH qemu-server v5 06/11] fix #5180: dbus-vmstate: add daemon for QEMUs dbus-vmstate interface Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH qemu-server v5 07/11] fix #5180: migrate: integrate helper for live-migrating conntrack info Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH qemu-server v5 08/11] migrate: flush old VM conntrack entries after successful migration Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH manager v5 09/11] api2: capabilities: expose new qemu/migration endpoint Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH manager v5 10/11] ui: window: Migrate: add checkbox for migrating VM conntrack state Christoph Heiss
2025-07-30  9:45 ` [pve-devel] [PATCH docs v5 11/11] qm: document conntrack state migration for live migrations Christoph Heiss
2025-07-30 23:48   ` [pve-devel] applied: " Thomas Lamprecht
2025-07-30 22:45 ` [pve-devel] applied-series: [PATCH firewall/qemu-server/manager/docs v5 00/11] fix #5180: migrate conntrack state on live migration Thomas Lamprecht

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