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 <[email protected]> --- 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 [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
