public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: j.klocker@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	[thread overview]
Message-ID: <20261126175915.2833652-3-m.koeppl@proxmox.com> (raw)
In-Reply-To: <20261126175915.2833652-1-m.koeppl@proxmox.com>

Registering PDM remotes needs the same grouping to start the nodes of
a cluster together.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 .../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<Vec<InstanceGroup>, 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::<Result<_, Error>>()?;
 
-        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





  parent reply	other threads:[~2026-11-26 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 17:59 [PATCH test-tools 0/3] register clusters with PDM after forming them Michael Köppl
2026-11-26 17:59 ` [PATCH test-tools 1/3] instance: pve client: add helper for the API certificate fingerprint Michael Köppl
2026-11-26 17:59 ` Michael Köppl [this message]
2026-11-26 17:59 ` [PATCH test-tools 3/3] instance: setup: register clusters with PDM after forming them Michael Köppl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261126175915.2833652-3-m.koeppl@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=j.klocker@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal