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 5104F1FF0C0 for ; Wed, 18 Nov 2026 05:41:31 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 53AFC218C1; Wed, 18 Nov 2026 05:39:30 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Subject: [PATCH manager v3 34/38] api: bulk migrate: refuse targets that would drop the guest identity Date: Wed, 18 Nov 2026 05:37:46 +0100 Message-ID: <20261118043817.1659212-35-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118043817.1659212-1-t.lamprecht@proxmox.com> References: <20261118043817.1659212-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794976703651 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.186 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: PQ6U5KCAFUNZNAARKJV25GN5GZWRIFJN X-Message-ID-Hash: PQ6U5KCAFUNZNAARKJV25GN5GZWRIFJN X-MailFrom: t.lamprecht@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: The migration of each guest refuses a target node that does not run a version keeping the guest identity. A bulk migration to such a node thus logged one warning per guest and only failed after it had tried all of them. Check the target once before starting the task, for the migration of all guests of a node and for the cluster-wide bulk migration. Check there first that the target node exists, as the version check would report a mistyped node as one without version information. Signed-off-by: Thomas Lamprecht --- changes v2 -> v3: * also check the target of the cluster-wide bulk migration once before the task starts, after checking that the node exists; subject changed accordingly changes v1 -> v2: * new in v2 PVE/API2/Cluster/BulkAction/Guest.pm | 5 +++++ PVE/API2/Nodes.pm | 3 +++ 2 files changed, 8 insertions(+) diff --git a/PVE/API2/Cluster/BulkAction/Guest.pm b/PVE/API2/Cluster/BulkAction/Guest.pm index a55ea2ea..8ae5e6a6 100644 --- a/PVE/API2/Cluster/BulkAction/Guest.pm +++ b/PVE/API2/Cluster/BulkAction/Guest.pm @@ -6,6 +6,7 @@ use warnings; use PVE::APIClient::LWP; use PVE::Cluster; use PVE::Exception qw(raise raise_perm_exc raise_param_exc); +use PVE::GuestIdentity; use PVE::INotify; use PVE::JSONSchema qw(get_standard_option); use PVE::RESTEnvironment qw(log_warn); @@ -760,6 +761,10 @@ __PACKAGE__->register_method({ check_guest_permissions($rpcenv, $authuser, $vmlist, ['VM.Migrate']); + PVE::Cluster::check_node_exists($param->{target}); + # refuse once instead of failing the migration of every guest + PVE::GuestIdentity::assert_node_supports_identity($param->{target}); + my $code = sub { my $list = PVE::API2::Nodes::Nodeinfo::get_filtered_vmlist(undef, $vmlist_string, 1, 1); diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 1e2a96f1..a86dcd04 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -23,6 +23,7 @@ use PVE::Cluster qw(cfs_read_file); use PVE::DataCenterConfig; use PVE::Exception qw(raise raise_perm_exc raise_param_exc); use PVE::Firewall; +use PVE::GuestIdentity; use PVE::HA::Config; use PVE::HA::Env::PVE2; use PVE::INotify; @@ -2759,6 +2760,8 @@ __PACKAGE__->register_method({ PVE::Cluster::check_cfs_quorum(); PVE::Cluster::check_node_exists($target); + # refuse once instead of failing the migration of every guest + PVE::GuestIdentity::assert_node_supports_identity($target); my $datacenterconfig = cfs_read_file('datacenter.cfg'); # prefer parameter over datacenter cfg settings -- 2.47.3