public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu
@ 2025-09-09  9:16 Fiona Ebner
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 1/4] migration: tell users to upgrade if nets-host-mtu is not supported Fiona Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-09  9:16 UTC (permalink / raw)
  To: pve-devel

Changes in v2:
* avoid re-introducing breakage if param is actually required

The introduction of the nets-host-mtu migration parameter causes some
friction and requires users to upgrade nodes. In Proxmox VE 9, this
cannot easily be avoided, because the default behavior of inheriting
the MTU from the bridge means, that most migrations are potentially
problematic if not using the parameter. Still, more context is given
to the error so users know they'll need to upgrade.

If both, source and target are on Proxmox VE 8, most migrations are
not affected, only when the MTU parameter is explicitly set to
"inherit from bridge". To reduce friction there, the nets-host-mtu
parameter is only used if such a VirtIO-net device is present.


master:

Fiona Ebner (2):
  migration: tell users to upgrade if nets-host-mtu is not supported
  migration: remove unused variable

 src/PVE/QemuMigrate.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)


stable-bookworm:

Fiona Ebner (2):
  migration: only use nets-host-mtu for PVE 8 target if actually
    required
  migration: tell users to upgrade if nets-host-mtu is required but not
    supported

 src/PVE/QemuMigrate.pm | 14 +++++++++++---
 src/PVE/QemuServer.pm  |  3 ++-
 2 files changed, 13 insertions(+), 4 deletions(-)


-- 
2.47.2



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


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

* [pve-devel] [PATCH qemu-server master v2 1/4] migration: tell users to upgrade if nets-host-mtu is not supported
  2025-09-09  9:16 [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu Fiona Ebner
@ 2025-09-09  9:16 ` Fiona Ebner
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 2/4] migration: remove unused variable Fiona Ebner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-09  9:16 UTC (permalink / raw)
  To: pve-devel

In Proxmox VE 9, the default behavior for VirtIO network devices is to
inherit the MTU from the bridge. This means that most migrations are
potentially problematic when the nets-host-mtu parameter is not set,
see commit 20c91f7f ("migration: preserve host_mtu for virtio-net
devices"). While setting the parameter could be avoided in some cases,
the information what MTU the target node bridges have is not readily
available. Upgrading is already required to avoid actual problematic
cases, so just tell people to upgrade when the target does not support
preserving the VirtIO-net MTU yet in all cases.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuMigrate.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 4381b542..8fbabdfa 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -1053,6 +1053,7 @@ sub phase2_start_local_cluster {
     };
 
     my $target_replicated_volumes = {};
+    my $target_nets_host_mtu_not_supported;
 
     # Note: We try to keep $spice_ticket secret (do not pass via command line parameter)
     # instead we pipe it through STDIN
@@ -1110,11 +1111,16 @@ sub phase2_start_local_cluster {
         },
         errfunc => sub {
             my $line = shift;
+            $target_nets_host_mtu_not_supported = 1
+                if $line =~ m/^Unknown option: nets-host-mtu/;
             $self->log('info', "[$self->{node}] $line");
         },
         noerr => 1,
     );
 
+    die "node $self->{node} is too old for preserving VirtIO-net MTU, please upgrade\n"
+        if $target_nets_host_mtu_not_supported;
+
     die "remote command failed with exit code $exitcode\n" if $exitcode;
 
     die "unable to detect remote migration address\n"
-- 
2.47.2



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


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

* [pve-devel] [PATCH qemu-server master v2 2/4] migration: remove unused variable
  2025-09-09  9:16 [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu Fiona Ebner
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 1/4] migration: tell users to upgrade if nets-host-mtu is not supported Fiona Ebner
@ 2025-09-09  9:16 ` Fiona Ebner
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 3/4] migration: only use nets-host-mtu for PVE 8 target if actually required Fiona Ebner
  2025-09-09  9:17 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 4/4] migration: tell users to upgrade if nets-host-mtu is required but not supported Fiona Ebner
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-09  9:16 UTC (permalink / raw)
  To: pve-devel

The $version variable has been unused since commit 898e9296 ("migrate:
drop outdated PVE 7.2 check guarding cloudinit config section").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuMigrate.pm | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 8fbabdfa..0c60c38c 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -195,8 +195,6 @@ sub prepare {
     # test if VM exists
     my $conf = $self->{vmconf} = PVE::QemuConfig->load_config($vmid);
 
-    my $version = PVE::QemuServer::Helpers::get_node_pvecfg_version($self->{node});
-
     my $repl_conf = PVE::ReplicationConfig->new();
     $self->{replication_jobcfg} = $repl_conf->find_local_replication_job($vmid, $self->{node});
     $self->{is_replicated} = $repl_conf->check_for_existing_jobs($vmid, 1);
-- 
2.47.2



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


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

* [pve-devel] [PATCH qemu-server stable-bookworm v2 3/4] migration: only use nets-host-mtu for PVE 8 target if actually required
  2025-09-09  9:16 [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu Fiona Ebner
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 1/4] migration: tell users to upgrade if nets-host-mtu is not supported Fiona Ebner
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 2/4] migration: remove unused variable Fiona Ebner
@ 2025-09-09  9:16 ` Fiona Ebner
  2025-09-09  9:17 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 4/4] migration: tell users to upgrade if nets-host-mtu is required but not supported Fiona Ebner
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-09  9:16 UTC (permalink / raw)
  To: pve-devel

Commit 1736fbeb ("migration: preserve host_mtu for virtio-net
devices") addresses probblematic migration scenarios with VirtIO-net
devices which inherit the MTU from the bridge. In Proxmox VE 9, the
default behavior changed to inherit the MTU from the bridge, but for
Proxmox VE 8, only an explicit mtu=1 will do so and thus be
potentially problematic.

By not using the nets-host-mtu parameter for unproblematic migrations,
fricition is reduced, because backwards migrations to not-yet-upgraded
Proxmox VE 8 nodes will still work.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuMigrate.pm | 8 +++++---
 src/PVE/QemuServer.pm  | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 3cd7069a..ea35e54d 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -1148,9 +1148,11 @@ sub phase2 {
         },
     };
 
-    if (my $nets_host_mtu = PVE::QemuServer::get_nets_host_mtu($vmid, $conf)) {
-        $params->{start_params}->{'nets-host-mtu'} = $nets_host_mtu;
-    }
+    my $target_version = PVE::QemuServer::Helpers::get_node_pvecfg_version($self->{node});
+    my $only_inherited_mtus =
+        $target_version && !PVE::QemuServer::Helpers::pvecfg_min_version($target_version, 9, 0, 0);
+    my $nets_host_mtu = PVE::QemuServer::get_nets_host_mtu($vmid, $conf, $only_inherited_mtus);
+    $params->{start_params}->{'nets-host-mtu'} = $nets_host_mtu if $nets_host_mtu;
 
     my ($tunnel_info, $spice_port);
 
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index b2a9f816..8bc55def 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -9535,13 +9535,14 @@ sub delete_ifaces_ipams_ips {
 }
 
 sub get_nets_host_mtu {
-    my ($vmid, $conf) = @_;
+    my ($vmid, $conf, $only_inherited_mtus) = @_;
 
     my $nets_host_mtu = [];
     for my $opt (sort keys $conf->%*) {
         next if $opt !~ m/^net(\d+)$/;
         my $net = parse_net($conf->{$opt});
         next if $net->{model} ne 'virtio';
+        next if $only_inherited_mtus && !($net->{mtu} && $net->{mtu} == 1);
 
         my $host_mtu = eval {
             mon_cmd(
-- 
2.39.5



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


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

* [pve-devel] [PATCH qemu-server stable-bookworm v2 4/4] migration: tell users to upgrade if nets-host-mtu is required but not supported
  2025-09-09  9:16 [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu Fiona Ebner
                   ` (2 preceding siblings ...)
  2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 3/4] migration: only use nets-host-mtu for PVE 8 target if actually required Fiona Ebner
@ 2025-09-09  9:17 ` Fiona Ebner
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2025-09-09  9:17 UTC (permalink / raw)
  To: pve-devel

See also commit "migration: only use nets-host-mtu for PVE 8 target if
actually required". Tell people to upgrade when the target does not
support preserving the VirtIO-net MTU yet and that is required for the
migration at hand.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/QemuMigrate.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index ea35e54d..22688e48 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -1010,6 +1010,7 @@ sub phase2_start_local_cluster {
     };
 
     my $target_replicated_volumes = {};
+    my $target_nets_host_mtu_not_supported;
 
     # Note: We try to keep $spice_ticket secret (do not pass via command line parameter)
     # instead we pipe it through STDIN
@@ -1067,11 +1068,16 @@ sub phase2_start_local_cluster {
         },
         errfunc => sub {
             my $line = shift;
+            $target_nets_host_mtu_not_supported = 1
+                if $line =~ m/^Unknown option: nets-host-mtu/;
             $self->log('info', "[$self->{node}] $line");
         },
         noerr => 1,
     );
 
+    die "node $self->{node} is too old for preserving VirtIO-net MTU, please upgrade\n"
+        if $target_nets_host_mtu_not_supported;
+
     die "remote command failed with exit code $exitcode\n" if $exitcode;
 
     die "unable to detect remote migration address\n"
-- 
2.39.5



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


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

end of thread, other threads:[~2025-09-09  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-09  9:16 [pve-devel] [PATCH-SERIES qemu-server v2 0/4] migration: reduce friction with nets-host-mtu Fiona Ebner
2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 1/4] migration: tell users to upgrade if nets-host-mtu is not supported Fiona Ebner
2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server master v2 2/4] migration: remove unused variable Fiona Ebner
2025-09-09  9:16 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 3/4] migration: only use nets-host-mtu for PVE 8 target if actually required Fiona Ebner
2025-09-09  9:17 ` [pve-devel] [PATCH qemu-server stable-bookworm v2 4/4] migration: tell users to upgrade if nets-host-mtu is required but not supported Fiona Ebner

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