From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id A0BC51FF0B6 for ; Thu, 12 Nov 2026 12:50:16 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8F05821690; Thu, 12 Nov 2026 12:50:12 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH guest-common v7 04/32] abstract migrate: intra-cluster: check config can be parsed on target Date: Thu, 12 Nov 2026 12:48:36 +0100 Message-ID: <20261112115001.107306-5-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112115001.107306-1-f.ebner@proxmox.com> References: <20261112115001.107306-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794484205019 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.274 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MIZRYDWLPFSIWGFEJL5EHFXTOCFNIYZW X-Message-ID-Hash: MIZRYDWLPFSIWGFEJL5EHFXTOCFNIYZW X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: For remote migration, there already is a check that the config can be parsed on the target. Do the same for intra-cluster migration, to avoid issues with future new properties unexpectedly being ignored if the target is too old or even more important, existing properties being ignored when a new sub-property is used or even just when there are new {sub-,}property values. For example, such an issue is [0] with the 'ms-cert' property for VM EFI disks or the 'keepattrs' property for CT mountpoints. Unfortunately, before commit "qm: mtunnel: reply when a command is unknown", which is part of the same patch series, when a command is unknown, mtunnel did not reply at all. Therefore, check that the target node is recent enough to support the new mtunnel command. An escape hatch to opt-out of the check is only available if the local node supports the 'skip-config-check' flag, so don't do any checking if the node is too old. [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=7341 Signed-off-by: Fiona Ebner --- Dependency bump for pve-cluster needed! The pve-manager version in the checks needs to be adapted upon apply. It must depend on new container and qemu-server so that container supports fork_tunnel and both qemu-server and pve-container support the 'skip-config-check' option. Changes in v7: * Newly factored out as a common helper. * Bumped pve-manager version in checks. src/PVE/AbstractMigrate.pm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/PVE/AbstractMigrate.pm b/src/PVE/AbstractMigrate.pm index 28a91f1..ed538a3 100644 --- a/src/PVE/AbstractMigrate.pm +++ b/src/PVE/AbstractMigrate.pm @@ -276,6 +276,35 @@ sub prepare_local_cluster_checks { eval { $self->cmd_quiet($cmd); }; die "Can't connect to destination address using public key\n" if $@; + my $nodename = PVE::INotify::nodename(); + + # Only proceed if the 'skip-config-check' flag exists, so a user can opt-out. + return if !PVE::Cluster::node_pvecfg_version_at_least($nodename, 9, 2, 28); + + if (!$self->{opts}->{'skip-config-check'}) { + if (PVE::Cluster::node_pvecfg_version_at_least($self->{node}, 9, 2, 28)) { + # Fork a short-lived tunnel for checking the config. Later, the proper tunnel with + # SSH forwarding info is forked. + my $tunnel = $self->fork_tunnel(); + # Compared to remote migration, which also does volume activation, this only + # strictly parses the config, so no too large timeout is needed. + eval { PVE::Tunnel::write_tunnel($tunnel, 30, "config $self->{vmid} $nodename"); }; + my $err = $@; + + eval { PVE::Tunnel::finish_tunnel($tunnel); }; + $self->log('warn', "failed to finish tunnel in prepare() - $@") if $@; + + if ($err) { + chomp($err); + die "$err - use 'skip-config-check' flag to migrate regardless\n"; + } + } else { + $self->log('info', "skipping config check - target pve-manager version < 9.2.28"); + } + } else { + $self->log('info', "skipping config check - override option is set"); + } + return; } -- 2.47.3