all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH guest-common,ha-manager,manager,docs 0/15] cluster resource scheduling for all guests
Date: Wed, 18 Nov 2026 12:05:07 +0100	[thread overview]
Message-ID: <20261118110705.595989-1-t.lamprecht@proxmox.com> (raw)

So far only the HA stack can use the balancing of the cluster resource
scheduler (CRS), this series makes it more easily available for all guests on
demand:

 - The migrate dialog sorts the target nodes by how well a migration
   there would balance the cluster load, and preselects the best one.
 - A new "Rebalance Guests" bulk action opens the bulk migrate dialog
   with a rebalance proposal, whose targets can be adjusted per guest
   before migrating.

The cluster stat gathering and the scheduler wrapper move into a new
library in pve-guest-common, with the HA manager switched to using that too.

The new API endpoints only rank nodes and estimate the resulting imbalance.
Whether a migration is possible at all is still decided by the existing
migrate preconditions. HA-managed guests are only proposed for nodes their
HA rules allow. Guests in a positive resource affinity are not proposed, as
HA always moves such a group as a whole.

The first two ha-manager patches are independent fixes found along the
way. A related fix for static mode mispredicting the migration of
containers without a CPU limit touches proxmox-resource-scheduling and
pve-rs, and will follow as a separate series.

Besides the new unit and API tests, I tested this on an actual three-node
cluster with HA, including running proposed migrations through bulk migrate,
but some more testing would be certainly good to have.

Repo (build-)dependencies:
 pve-manager -> pve-ha-manager -> pve-guest-common

pve-guest-common:

Thomas Lamprecht (1):
      scheduling: add cluster resource scheduling library

 debian/control                                |    2 +
 src/Makefile                                  |    4 +
 src/PVE/ResourceScheduling/Planner.pm         |  716 +++++++
 src/PVE/ResourceScheduling/Scheduler.pm       |  164 ++
 src/PVE/ResourceScheduling/Stats.pm           |  194 ++
 src/tests/Makefile                            |   21 +-
 .../resource-scheduling-planner-tests.pl      | 1775 +++++++++++++++++
 .../resource-scheduling-scheduler-tests.pl    |  230 +++
 src/tests/resource-scheduling-stats-tests.pl  |  260 +++
 9 files changed, 3364 insertions(+), 2 deletions(-)

pve-ha-manager:

Thomas Lamprecht (5):
      helpers: block both locations of a migrating negative affinity partner
      usage: static: count services per node again for scoring fallback
      config: allow getting motion info of many resources at once
      env: pve2: delegate cluster stat gathering to scheduling library
      usage: share one scheduler base between static and dynamic

 debian/control                        |   2 +
 debian/pve-ha-manager.install         |   1 +
 src/PVE/HA/Config.pm                  |  83 +++++++---
 src/PVE/HA/Env/PVE2.pm                | 155 ++++-------------
 src/PVE/HA/Helpers.pm                 |   4 +-
 src/PVE/HA/Usage/Dynamic.pm           | 145 +---------------
 src/PVE/HA/Usage/Makefile             |   2 +-
 src/PVE/HA/Usage/Scheduler.pm         | 175 ++++++++++++++++++++
 src/PVE/HA/Usage/Static.pm            | 157 +-----------------
 src/test/Makefile                     |   2 +
 src/test/test_resource_motion_info.pl | 228 ++++++++++++++++++++++++++
 src/test/test_usage_fallback.pl       |  77 +++++++++
 12 files changed, 585 insertions(+), 446 deletions(-)

pve-manager:

Thomas Lamprecht (8):
      ui: bulk action: translate error title and CT restart warning
      ui: bulk migrate: show CT restart warning for cluster-wide migration
      ui: migrate: recheck preconditions if the target changed meanwhile
      api: cluster: add resource scheduling endpoints
      ui: migrate: sort target nodes by scheduler recommendation
      api: bulk migrate: allow a per-guest target node mapping
      ui: bulk migrate: support per-guest target nodes
      ui: dc: add a Rebalance Guests bulk action

 PVE/API2/Cluster.pm                       |   7 +
 PVE/API2/Cluster/BulkAction/Guest.pm      | 100 ++++-
 PVE/API2/Cluster/Makefile                 |   3 +-
 PVE/API2/Cluster/ResourceScheduling.pm    | 413 ++++++++++++++++++++
 test/BulkMigrate_test.pl                  | 204 ++++++++++
 test/Makefile                             |  10 +-
 test/ResourceScheduling_test.pl           | 454 ++++++++++++++++++++++
 www/manager6/Makefile                     |   1 +
 www/manager6/dc/CmdMenu.js                |  21 +
 www/manager6/dc/Config.js                 |  16 +
 www/manager6/form/VMSelectorWithTarget.js | 202 ++++++++++
 www/manager6/window/BulkAction.js         | 173 ++++++++-
 www/manager6/window/Migrate.js            | 164 ++++++++
 13 files changed, 1752 insertions(+), 16 deletions(-)

pve-docs:

Thomas Lamprecht (1):
      pvecm: document balancing the cluster load with migrations

 ha-manager.adoc |  4 ++++
 pvecm.adoc      | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)

--
2.47.3




             reply	other threads:[~2026-11-18 11:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 11:05 Thomas Lamprecht [this message]
2026-11-18 11:05 ` [PATCH guest-common 01/15] scheduling: add cluster resource scheduling library Thomas Lamprecht
2026-11-18 11:05 ` [PATCH ha-manager 02/15] helpers: block both locations of a migrating negative affinity partner Thomas Lamprecht
2026-11-18 11:05 ` [PATCH ha-manager 03/15] usage: static: count services per node again for scoring fallback Thomas Lamprecht
2026-11-18 11:05 ` [PATCH ha-manager 04/15] config: allow getting motion info of many resources at once Thomas Lamprecht
2026-11-18 11:05 ` [PATCH ha-manager 05/15] env: pve2: delegate cluster stat gathering to scheduling library Thomas Lamprecht
2026-11-18 11:05 ` [PATCH ha-manager 06/15] usage: share one scheduler base between static and dynamic Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 07/15] ui: bulk action: translate error title and CT restart warning Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 08/15] ui: bulk migrate: show CT restart warning for cluster-wide migration Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 09/15] ui: migrate: recheck preconditions if the target changed meanwhile Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 10/15] api: cluster: add resource scheduling endpoints Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 11/15] ui: migrate: sort target nodes by scheduler recommendation Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 12/15] api: bulk migrate: allow a per-guest target node mapping Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 13/15] ui: bulk migrate: support per-guest target nodes Thomas Lamprecht
2026-11-18 11:05 ` [PATCH manager 14/15] ui: dc: add a Rebalance Guests bulk action Thomas Lamprecht
2026-11-18 11:05 ` [PATCH docs 15/15] pvecm: document balancing the cluster load with migrations Thomas Lamprecht

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=20261118110705.595989-1-t.lamprecht@proxmox.com \
    --to=t.lamprecht@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal