public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH guest-common,ha-manager,manager,docs 0/15] cluster resource scheduling for all guests
@ 2026-11-18 11:05 Thomas Lamprecht
  2026-11-18 11:05 ` [PATCH guest-common 01/15] scheduling: add cluster resource scheduling library Thomas Lamprecht
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Thomas Lamprecht @ 2026-11-18 11:05 UTC (permalink / raw)
  To: pve-devel

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




^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-11-18 12:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 11:05 [PATCH guest-common,ha-manager,manager,docs 0/15] cluster resource scheduling for all guests Thomas Lamprecht
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

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