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 DC1BD1FF0B3 for ; Thu, 26 Nov 2026 18:59:57 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id F0AF12175D; Thu, 26 Nov 2026 18:59:38 +0100 (CET) From: =?UTF-8?q?Michael=20K=C3=B6ppl?= To: pve-devel@lists.proxmox.com Subject: [PATCH test-tools 2/3] instance: move the grouping of instances by cluster into a helper Date: Thu, 26 Nov 2026 18:59:14 +0100 Message-ID: <20261126175915.2833652-3-m.koeppl@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261126175915.2833652-1-m.koeppl@proxmox.com> References: <20261126175915.2833652-1-m.koeppl@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795715973220 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.173 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: JDZ7JF7WTPOGJXZ3GATWESORSPKPQS7S X-Message-ID-Hash: JDZ7JF7WTPOGJXZ3GATWESORSPKPQS7S X-MailFrom: m.koeppl@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 CC: j.klocker@proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Registering PDM remotes needs the same grouping to start the nodes of a cluster together. Signed-off-by: Michael Köppl --- .../src/instance_manager/mod.rs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/proxmox-test-instance/src/instance_manager/mod.rs b/proxmox-test-instance/src/instance_manager/mod.rs index c3fbd0d7..493c56ac 100644 --- a/proxmox-test-instance/src/instance_manager/mod.rs +++ b/proxmox-test-instance/src/instance_manager/mod.rs @@ -628,6 +628,19 @@ impl<'a> InstanceManager<'a> { where F: Fn(&str) -> Result<(), Error> + Sync, { + let groups = self.instance_groups(instances)?; + + budget::for_each_group( + &groups, + self.config.max_concurrent_setups, + &self.interrupted, + |group| self.visit_group(group, timeout, &task), + ) + } + + /// Partitions `instances` into the groups they have to be powered on in, pulling in the + /// remaining nodes of every recorded cluster that one of them belongs to. + fn instance_groups(&self, instances: &[String]) -> Result, Error> { let requested_nodes: HashSet<&str> = instances .iter() .filter_map(|name| self.state.instances.get(name)) @@ -652,14 +665,7 @@ impl<'a> InstanceManager<'a> { }) .collect::>()?; - let groups = budget::group_instances(&clusters, instances); - - budget::for_each_group( - &groups, - self.config.max_concurrent_setups, - &self.interrupted, - |group| self.visit_group(group, timeout, &task), - ) + Ok(budget::group_instances(&clusters, instances)) } /// Stops the periodic package management services a guest runs on its own. These services -- 2.47.3