From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id DA59A1FF165 for ; Thu, 17 Jul 2025 19:49:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3F25CA019; Thu, 17 Jul 2025 19:50:52 +0200 (CEST) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 17 Jul 2025 19:50:18 +0200 Message-Id: <20250717175018.606662-1-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.208 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH pve-manager 1/1] pve8to9: add check for interfaces X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" PVE 9 will automatically set the host_mtu parameter for VMs to the bridge MTU if the MTU field of the network device is unset. Check for any interface that would be affected by a change in MTU after the upgrade. Signed-off-by: Stefan Hanreich --- only works with current stable-bookworm branch, since the QemuServer functions moved PVE/CLI/pve8to9.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/PVE/CLI/pve8to9.pm b/PVE/CLI/pve8to9.pm index e70b162aa..f76b188f5 100644 --- a/PVE/CLI/pve8to9.pm +++ b/PVE/CLI/pve8to9.pm @@ -19,6 +19,7 @@ use PVE::Corosync; use PVE::INotify; use PVE::Jobs; use PVE::JSONSchema; +use PVE::Network; use PVE::NodeConfig; use PVE::RPCEnvironment; use PVE::Storage; @@ -1747,6 +1748,28 @@ sub check_glusterfs_storage_usage { return undef; } +sub check_bridge_mtu { + log_info("Checking for VirtIO devices that would change their MTU..."); + + my $vms = PVE::QemuServer::config_list(); + + for my $vmid (sort { $a <=> $b } keys %$vms) { + my $config = PVE::QemuConfig->load_config($vmid); + + for my $opt (sort keys $config->%*) { + next if $opt !~ m/^net\d+$/; + my $net = PVE::QemuServer::parse_net($config->{$opt}); + + next if $net->{model} ne 'virtio' || defined($net->{mtu}); + + my $bridge_mtu = PVE::Network::read_bridge_mtu($net->{bridge}); + + log_notice("network interface $opt of vm $vmid will have its mtu forced to $bridge_mtu") + if $bridge_mtu != 1500; + } + } +} + sub check_misc { print_header("MISCELLANEOUS CHECKS"); my $ssh_config = eval { PVE::Tools::file_get_contents('/root/.ssh/config') }; @@ -1859,6 +1882,7 @@ sub check_misc { check_legacy_notification_sections(); check_legacy_backup_job_options(); check_lvm_autoactivation(); + check_bridge_mtu(); } my sub colored_if { -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel