Compare commits

...

279 Commits
v1.0.4 ... main

Author SHA1 Message Date
gyptazy
c39301ca96 docs(README): Define the new location of ProxLB at credativ 2026-01-15 13:14:42 +01:00
gyptazy
b7a6fcec0c doc(README): Define new location of the ProxLB project at credativ
Updated README to reflect the new location of the ProxLB project and removed outdated sections.
2026-01-15 13:13:06 +01:00
gyptazy
9966fbb13f Merge pull request #421 from gyptazy/fix/420-fix-psi-based-balancing-mode
fix(calculations): Fix PSI based balancing which resulted in a Python KeyError
2026-01-13 10:32:04 +01:00
gyptazy
e6ae357838 fix(calculations): Fix PSI based balancing which resulted in a Python KeyError
Fixes: #420
2026-01-13 08:24:50 +01:00
gyptazy
65b1bd5fee Merge pull request #418 from gyptazy/release/1.1.11
release: Create release 1.1.11
2026-01-12 07:15:48 +01:00
gyptazy
72283d8c19 release: Create release 1.1.11
Fixes: #405
2026-01-09 14:22:27 +01:00
gyptazy
4f85feacde Merge pull request #415 from gyptazy/feature/414-enfoce-pinning
feature: Add new option to enforce node/guest pinning even when cluster is balanced from a resource perspective.
2026-01-09 10:09:09 +01:00
Florian Paul Azim Hoberg
34e340c25c feature: Add new option to enforce node/guest pinning even when cluster is balanced from a resource perspective.
Fixes: #414
2026-01-08 16:50:06 +01:00
gyptazy
da193f9d27 Merge pull request #412 from gyptazy/feature/406-strict-nonstrict-node-pinning
Add support for configuring node-pinning strictness (default: true) within pools
2026-01-04 12:28:40 +01:00
gyptazy
f11ca263b8 Add support for configuring node-pinning strictness (default: true) within pools
Fixes: #406
2025-12-30 08:52:55 +01:00
gyptazy
0af770c9df Merge pull request #410 from gyptazy/change/378-adjust-balancing-decisions
Change balancing and sorting behaviour of guests
2025-12-29 13:12:21 +01:00
gyptazy
a9d11daf40 Change balancing and sorting behaviour of guests
- Sort to be balanced guests first by size of affinity group (ASC)
  - Sort to be balanced guests afterwards by used memory size (ASC/DESC)
  - Validate if lowest used node is still the lowest one

Fixes: #378
Fixes: #390
2025-12-29 12:44:58 +01:00
gyptazy
ab7ee0d687 Merge pull request #409 from gyptazy/fix/tags-ignore
Fix that ignored VMs/CTs got moved to another node when being ignored.
2025-12-25 18:29:32 +01:00
gyptazy
e841481fdd Fix that ignored VMs/CTs got moved to another node when being ignored.
Fixes: #408
2025-12-24 16:43:12 +01:00
gyptazy
5b7cc6727f Merge pull request #407 from hugobugomugo/patch-1
add docker compose to install instructions
2025-12-24 09:18:11 +01:00
gyptazy
15a05d320e Merge pull request #404 from gyptazy/feature/373-add-resource-reservation-for-nodes
Feature/resource reservation (#380)
2025-12-24 09:10:12 +01:00
gyptazy
e0331e83e1 Adjust the integration of node resource reservation
- Renamed to set_node_resource_reservation
  - Immediately apply the values as maxmem for a node
    - Avoid recalculating percentage values
  - Simplified code
  - Adjusted debug logging
2025-12-24 09:06:39 +01:00
hugo
ffd74d47e9 add docker compose to install instructions 2025-12-23 23:37:41 +01:00
gyptazy
89ad425243 Add config exmaples to README for resource reservations on node level
Fixes: #373
2025-12-23 15:30:15 +01:00
Chipmonk2
2ce3d73262 Feature/resource reservation (#380)
Add resource reservation of memory for nodes
2025-12-23 15:08:29 +01:00
gyptazy
b8093454d7 Merge pull request #403 from gyptazy/feature/402-add-ha-job-status-validation-for-migrations
feature: Add HA job validation for migration jobs
2025-12-23 15:02:10 +01:00
Florian Paul Azim Hoberg
d7631ef8f5 feature: Add HA job validation for migration jobs
Fixes: #402
2025-12-16 20:38:35 +01:00
gyptazy
d546036a9a Merge pull request #401 from gyptazy/feature/391_improve_native_ha_rules_pve8
fix: HA affinity/anti-affinity rules can only be evaluated on PVE9+ nodes
2025-12-14 09:37:47 +01:00
gyptazy
09b5b83c24 fix: HA affinity/anti-affinity rules can only be evaluated on PVE9+ nodes
Fixes: #391
2025-12-14 09:34:21 +01:00
gyptazy
8d61ccfbb1 Merge pull request #399 from gyptazy/fix/395-fix-non-existent-pool-stacktrace
fix: Fix crashing on non-existent pools
2025-12-13 20:06:16 +01:00
gyptazy
b39c13e2a5 fix: Fix crashing on non-existent pools
Fixes: #395
2025-12-13 20:05:11 +01:00
gyptazy
8e759b778c Merge pull request #396 from gyptazy/fix/395_fix_pool_based_node_pinning
fix: Fixed pool and ha-rules based node pinning of guests.
2025-12-12 08:04:23 +01:00
Florian Paul Azim Hoberg
22406e3628 fix: Fixed pool and ha-rules based node pinning of guests.
* Fixed pool based node pinning (@gyptazy). [#395]
  * Add support for Proxmox's native HA (node-affinity) rules for pinning guests to nodes (@gyptazy). [#391]

Fixes: #395
Fixes: #391
2025-12-11 14:43:44 +01:00
gyptazy
e7f5d5142e Merge pull request #392 from gyptazy/pipeline/dynamic-versioning-packages
pipline: Generate snapshot package
2025-12-10 12:51:37 +01:00
Florian Paul Azim Hoberg
48d621a06d pipline: Generate snapshot package 2025-12-10 12:42:28 +01:00
Florian Paul Azim Hoberg
c133ef1aee feature: Add support for Proxmox's native HA (affinity/anti-affinity) rules.
* Add support of native rules for affinity/anti-affinity types in Proxmox VE
  * Streamline affinity/anti-affinity rules by Tags, Pools and native Proxmox rules

Fixes: #391
2025-12-10 09:11:28 +01:00
gyptazy
9ea04f904d Merge pull request #388 from gyptazy/feature/387-select-balancing-workloads-by-size
feature: Add possibility to sort and select balancing workloads by smaller/larger guest objects
2025-12-08 15:52:25 +01:00
Florian Paul Azim Hoberg
5101202f72 feature: Add possibility to sort and select balancing workloads by smaller/larger guest objects
- Allows operators to select if first larger or smaller workloads should be migrated

Fixes: #387
2025-12-08 15:44:38 +01:00
gyptazy
929390b288 Merge pull request #386 from gyptazy/docs/385-proxmox-offline-mirror-repo-support
docs: Add documentation about offline repor mirror and proxmox-offline-mirror suppot
2025-12-06 16:12:37 +01:00
gyptazy
d4560c3af4 docs: Add documentation about offline repor mirror and proxmox-offline-mirror support
* Offline mirror support (air-gapped envs)
        * Add new full Debian repository

Fixes: #385
2025-12-06 12:26:15 +01:00
gyptazy
55c885194e Merge pull request #382 from gyptazy/fix/275-add-overprovisioning-safety-guard
fix(calculations): Add safety guard to avoid overprovisioning of nodes by memory
2025-12-06 11:19:38 +01:00
gyptazy
3d9f0eb85e fix(calculations): Add safety guard to avoid overprovisioning of nodes by memory.
Fixes: #275
2025-12-02 09:59:51 +01:00
gyptazy
490fb55ee1 Merge pull request #376 from Thalagyrt/patch-affinity-rebalance
Fix enforce_affinity boolean inversion
2025-11-27 08:41:05 +01:00
James Riley
a70330d4c3 Fix enforce_affinity boolean inversion
During runs in which affinity checks determine balancing actions,
there was a small error in a boolean calculation that caused
ProxLB to always rebalance, as it exited the verification loop with
a failure the first time it saw a VM that actually passed affinity
checks.
2025-11-26 07:06:28 -07:00
gyptazy
71d373eedb Merge pull request #375 from gyptazy/release/update-versions-release-1.1.10
release: Create release 1.1.10 and update versions
2025-11-25 08:40:08 +01:00
Florian Paul Azim Hoberg
040eeb9f13 release: Create release 1.1.10 and update versions 2025-11-25 08:34:24 +01:00
gyptazy
4ef1e92aad Merge pull request #374 from gyptazy/prepare/release1.1.10
release: Create release 1.1.10
2025-11-25 08:01:26 +01:00
Florian Paul Azim Hoberg
7e5fe13dfe release: Create release 1.1.10
Fixes: #371
2025-11-24 16:54:23 +01:00
gyptazy
66c2ab6570 Merge pull request #370 from gyptazy/fix/missing-py-req
fix: Add missing 'packaging' dependency
2025-11-18 13:19:24 +01:00
gyptazy
ba63514896 Merge pull request #369 from gyptazy/fix/368-crash-including-storage-in-pools
fix(pools): Fixes a crash during PVE resource pool enumeration by ski…
2025-11-18 13:15:53 +01:00
Florian Paul Azim Hoberg
571025a8a6 fix: Add missing 'packaging' dependency
Sponsored-by: Stefan Oettl <stefan.oettl@isarnet.de> (@stefanoettl)
2025-11-18 13:14:02 +01:00
Florian Paul Azim Hoberg
dd13181cf9 fix(pools): Fixes a crash during PVE resource pool enumeration by skipping
members not having a 'name' property (i.e. 'storage' members)

Fixes: #368
Sponsored-by: Stefan Oettl <stefan.oettl@isarnet.de> (@stefanoettl)
2025-11-18 13:08:23 +01:00
gyptazy
37d19a6a2d Merge pull request #365 from gyptazy/fix/335-validate-instead-enforcing-affinity-rules
feature: Prevent unnecessary rebalancing by validating existing affinity enforcement before taking actions
2025-11-17 16:33:55 +01:00
gyptazy
fe333749ce feature: Prevent unnecessary rebalancing by validating existing affinity enforcement before taking actions.
Fixes: #335
2025-11-12 10:03:28 +01:00
gyptazy
8f9bcfcdcf Merge pull request #364 from gyptazy/fix/359-avoid-pve8-users-using-conntrack-state-migrations
fix: Add safety-guard for PVE 8 users when activating `conntrack-aware` migrations mistakenly.
2025-11-11 19:43:39 +01:00
gyptazy
ff5fd2f7f1 fix: Add safety-guard for PVE 8 users when activating conntrack-aware migrations mistakenly.
Fixes: #359
2025-11-11 19:40:13 +01:00
gyptazy
1f6576ecd6 Merge pull request #363 from gyptazy/fix/361-false-positive-proxmox-api-validation
fix: Fix the Proxmox API connection validation which returned a false-positive logging message of timeouts.
2025-11-11 15:25:34 +01:00
gyptazy
46bbe01141 fix: Fix the Proxmox API connection validation which returned a false-positive logging message of timeouts.
Fixes: #361
2025-11-11 10:41:30 +01:00
gyptazy
07ed12fcb7 Merge pull request #358 from gyptazy/cicd/354-add-old-stable-tests
cicd: Add integration test for Debian Bookworm
2025-11-05 11:33:07 +01:00
gyptazy
546fbc7d73 cicd: Add integration test for Debian Bookworm
* Ensure we also run integration tests for Debian Bookworm (PVE 8)

Fixes: #354
2025-11-05 11:21:58 +01:00
gyptazy
15436c431f Merge pull request #355 from gyptazy/release/1.1.9.1
release: Create hotfix release 1.1.9.1
2025-10-30 17:53:14 +01:00
gyptazy
33f6ff8db0 release: Create hotfix release 1.1.9.1
Fixes: #352
2025-10-30 17:46:54 +01:00
gyptazy
84628f232e Merge pull request #353 from gyptazy/fix/352-syntax-fix
fix: Adjust quoting of f-strings
2025-10-30 17:39:42 +01:00
gyptazy
6a91afd405 fix: Adjust quoting of f-strings
Fixes: #352
2025-10-30 17:18:17 +01:00
gyptazy
909643a09f Merge pull request #351 from gyptazy/release/1.1.9final
release: Create final 1.1.9 Release
2025-10-30 07:55:45 +01:00
Florian Paul Azim Hoberg
7de1ba366b release: Create final 1.1.9 Release
Fixes: #350
Sponsored-by: credativ GmbH <https://credativ.de>
2025-10-30 07:50:25 +01:00
gyptazy
0cb19fab34 Merge pull request #344 from gyptazy/release/1.1.9b
Release/1.1.9b
2025-10-27 16:47:48 +01:00
gyptazy
972b10b7e5 Merge pull request #349 from gyptazy/fix/343-config-validation
fix: Make pool based configuration more robust
2025-10-27 14:53:35 +01:00
Florian Paul Azim Hoberg
7fa110e465 fix: Make pool based configuration more robust
Fixes: #343
2025-10-27 14:49:40 +01:00
gyptazy
948df0316b Merge pull request #347 from gyptazy/feature/343-affinity-rules-by-pools
feature(Pools): Add affinity/anti-affinity support by pools
2025-10-27 09:50:50 +01:00
gyptazy
016378e37c feature(Pools): Add affinity/anti-affinity support by pools
Fixes: #343
2025-10-27 09:37:12 +01:00
gyptazy
8a193b9891 Merge pull request #346 from gyptazy/feature/memory-balancing-threshold
feature(balancing): Add an optional threshold in percent for balancing
2025-10-23 12:13:49 +02:00
gyptazy
30e3b66be9 feature(balancing): Add an optional threshold in percent for balancing
Fixes: #342
2025-10-23 12:10:01 +02:00
gyptazy
b9be405194 Merge pull request #345 from gyptazy/fix/version
release: Set release version 1.1.9
2025-10-23 11:47:12 +02:00
gyptazy
ac108f2abe release: Set release version 1.1.9 2025-10-23 11:45:59 +02:00
gyptazy
02b43d3ef7 Merge pull request #339 from gyptazy/feature/337-add-pressure-based-balancing
feature(balancing): Add pressure (memory, cpu, disk) based balancing
2025-10-23 11:41:04 +02:00
Florian Paul Azim Hoberg
581d6d480b feature(balancing): Add pressure (memory, cpu, disk) based balancing
Fixes: #337
2025-10-23 11:32:25 +02:00
gyptazy
5b395b7f15 Merge pull request #334 from gyptazy/docs/changelog-docker-nonroot
docs: Add missing changelog fragment for container changes
2025-10-09 09:26:30 +02:00
gyptazy
7d94c52883 docs: Add missing changelog fragment for container changes
Fixes: #317
2025-10-09 09:25:07 +02:00
gyptazy
7d19788be1 Merge pull request #333 from gyptazy/release/prepare-1.1.8
release: Prepare release 1.1.8
2025-10-09 09:13:17 +02:00
gyptazy
0bbc5992ca release: Prepare release 1.1.8
Fixes: #332
2025-10-09 09:05:17 +02:00
gyptazy
a4a5d9e68a Merge pull request #331 from gyptazy/fix/329-add-proxlb-prefix-log
fix(logging): Add a static ProxLB prefix to the log output when used by journal handler
2025-10-08 18:43:11 +02:00
gyptazy
af98ee8d5b fix(logging): Add a static ProxLB prefix to the log output when used by journal handler
Fixes: #329
2025-10-08 18:39:02 +02:00
gyptazy
afc93f7b21 docs: Fix typo in readme 2025-09-26 12:14:48 +02:00
gyptazy
bc6d8c8509 Merge pull request #325 from gyptazy/doc/324-adjust-readme-docs-chapter
docs: Adjust the order and presence of the documentation in the readme.
2025-09-26 12:13:17 +02:00
gyptazy
6d50f32486 docs: Adjust the order and presence of the documentation in the readme.
Fixes: #324
2025-09-26 12:12:28 +02:00
gyptazy
5fe49a9dc1 Merge pull request #323 from gyptazy/docs/fix-img-links
docs: Fix broken images
2025-09-25 16:44:55 +02:00
gyptazy
fca1d1211c docs: Fix broken images 2025-09-25 16:43:52 +02:00
no ack hosting ab
36388d9429 Secure Dockerfile and application (#317)
fix: Run ProxLB in container as plb user instead of root
* Run ProxLB as plb user
* Run within a venv
2025-09-25 14:41:47 +02:00
gyptazy
3f424e9e6d Merge pull request #320 from gyptazy/docs/enterprise-support
docs: Add enterprise support list
2025-09-25 10:37:42 +02:00
Florian Paul Azim Hoberg
44a733aed3 docs: Add enterprise support list 2025-09-25 10:35:21 +02:00
gyptazy
2f44ff48a0 Merge pull request #319 from gyptazy/fix/318-conntrack-state-migrations-pve8
fix(balancing): Fix API errors when using conntrack aware migration with older PVE versions
2025-09-25 08:40:57 +02:00
Florian Paul Azim Hoberg
7b6db9cfdd fix(balancing): Fix API errors when using conntrack aware migration with older PVE versions.
Fixes: #318
2025-09-25 06:59:54 +02:00
gyptazy
8c473b416c docs: Adjust description 2025-09-23 20:34:04 +02:00
gyptazy
51c8afe5c5 docs: Update description 2025-09-23 20:30:20 +02:00
gyptazy
a8a154abde Merge pull request #316 from gyptazy/fix/missing-1.1.7-version
release: Replace missing 1.1.7 version
2025-09-19 10:12:53 +02:00
Florian Paul Azim Hoberg
554a3eaf72 release: Replace missing 1.1.7 version 2025-09-19 10:11:54 +02:00
gyptazy
0b35987403 Merge pull request #315 from gyptazy/release/create-release-1.7
release: Add release 1.1.7 information
2025-09-19 10:08:42 +02:00
Florian Paul Azim Hoberg
d93048db69 release: Add release 1.1.7 information
Fixes: #314
2025-09-19 07:54:01 +02:00
gyptazy
2aba7dbe23 Merge pull request #313 from gyptazy/adjust-style
fix: Add missing new lines
2025-09-19 07:41:30 +02:00
Florian Paul Azim Hoberg
ba388dfd7c fix: Add missing new lines 2025-09-19 07:39:42 +02:00
gyptazy
5aa8257d40 Merge pull request #311 from gyptazy/fix/310-guest-object-names-not-being-evaluated-in-log
fix: Fix guest object names are not being evaluated in debug log.
2025-09-15 09:53:26 +02:00
Florian Paul Azim Hoberg
99fefe20bf fix: Fix guest object names are not being evaluated in debug log.
Fixes: #310
2025-09-15 09:48:59 +02:00
gyptazy
b9fb3a60e1 Merge pull request #309 from gyptazy/fix/308-fix-validating-migration-job-ids
fix: Fix crash when validating absent migration job ids
2025-09-15 09:29:00 +02:00
Florian Paul Azim Hoberg
88b3288eb7 fix: Fix crash when validating absent migration job ids
Fixes: #308
2025-09-15 09:26:01 +02:00
gyptazy
fa0113f112 Merge pull request #307 from gyptazy/feature/304-catch-keyboard-interrupt
Add graceful shutdown for SIGINT (e.g., CTRL + C abort).
2025-09-15 07:30:30 +02:00
Florian Paul Azim Hoberg
0039ae9093 Add graceful shutdown for SIGINT (e.g., CTRL + C abort).
Fixes: #304
2025-09-15 07:26:03 +02:00
gyptazy
e3bbf31fdd Merge pull request #306 from gyptazy/feature/305-add-conntrack-options-for-migrations
feature: Add conntrack state aware migrations of VMs.
2025-09-15 07:10:30 +02:00
Florian Paul Azim Hoberg
bf393c6bbf feature: Add conntrack state aware migrations of VMs.
Fixes: #305
2025-09-15 06:59:41 +02:00
gyptazy
7e5b72cfc7 docs: Adjust container version to 1.1.6.1 2025-09-04 17:39:43 +02:00
gyptazy
0ba76f80f3 Merge pull request #302 from gyptazy/fix/296-vm
fix: Validate for node presence when pinning VMs to avoid crashing
2025-09-04 17:33:47 +02:00
gyptazy
b48ff9d677 fix: Validate for node presence when pinning VMs to avoid crashing
Fixes: #296
2025-09-04 17:31:24 +02:00
gyptazy
b5c11af474 Merge pull request #301 from gyptazy/gyptazy-patch-1
Set image version to 1.1.6
2025-09-04 08:34:49 +02:00
gyptazy
af2992747d Set image version to 1.1.6 2025-09-04 08:34:23 +02:00
gyptazy
fb8dc40c16 Merge pull request #300 from gyptazy/release/1.1.6
release: Create release 1.1.6
2025-09-04 07:55:38 +02:00
Florian Paul Azim Hoberg
34f1de8367 release: Create release 1.1.6
Fixes: #297
2025-09-04 07:53:29 +02:00
gyptazy
0e992e99de Merge pull request #298 from gyptazy/fix/296-validate-node-presence-when-pinning
fix: Validate for node presence when pinning guests to avoid crashing
2025-08-29 11:33:29 +02:00
gyptazy
f5d073dc02 fix: Validate for node presence when pinning guests to avoid crashing
Fixes: #296
Fixes: #271
2025-08-29 11:26:15 +02:00
gyptazy
70ba1f2dfc Merge pull request #295 from MiBUl-eu/main
fix: overprovisioning first node if anti_affinity group has only one member
2025-08-28 17:16:28 +02:00
MiBUl-eu
c9855f1991 Added changeloge and fixed typo 2025-08-26 10:34:48 +00:00
MiBUl-eu
9bd29158b9 fix: overprovisioning first node if anti_affinity group has only one member 2025-08-25 10:11:45 +02:00
gyptazy
1ff0c5d96e Merge pull request #293 from gyptazy/feature/290-validate-token-input-from-config-file
feature: Add validation for provided API user token id to avoid confusions
2025-08-25 08:11:56 +02:00
Florian Paul Azim Hoberg
3eb4038723 feature: Add validation for provided API user token id to avoid confusions
Fixes: #290
2025-08-25 08:07:44 +02:00
gyptazy
47e7dd3c56 Merge pull request #292 from gyptazy/fix/291-catch-stack-trace-when-user-account-is-not-given-or-wrong
fix(proxmox-api): Fix stacktrace output when validating permissions on non existing users in Proxmox
2025-08-25 07:58:32 +02:00
Florian Paul Azim Hoberg
bb8cf9033d fix(proxmox-api): Fix stacktrace output when validating permissions on non existing users in Proxmox
Fixes: #291
2025-08-25 07:55:02 +02:00
gyptazy
756b4efcbd Merge pull request #288 from gyptazy/feature/281-helm-chart-versioning
feature: Add Helm chart support for ProxLB
2025-08-19 06:28:31 +02:00
gyptazy
8630333e4b feature: Add Helm chart support for ProxLB
Fixes: #281
2025-08-19 06:27:38 +02:00
gyptazy
7bd9a9b038 Merge pull request #282 from MaoMaoCake/main
Feat: Add support for helm
2025-08-18 19:31:14 +02:00
maomaocake
16651351de Implemented changes from comments 2025-08-18 12:46:29 +07:00
maomaocake
63805f1f50 Added support for resource limits and requests 2025-08-17 16:11:18 +07:00
maomaocake
c0ff1b5273 Added support for new user defined labels 2025-08-17 15:59:17 +07:00
maomaocake
07f8596fc5 Helm Chart 2025-08-17 15:41:55 +07:00
Florian
affbe433f9 Merge pull request #280 from gyptazy/docs/fix-ipv6-example-syntax
docs: Fix IPv6 address syntax in given examples
2025-08-06 16:42:13 +02:00
Florian Paul Azim Hoberg
7bda22e754 docs: Fix IPv6 address syntax in given examples 2025-08-06 16:38:23 +02:00
Florian
253dcf8eb9 Merge pull request #274 from gyptazy/docs/273-proxmox-9-compatibility
docs: Add compatibility matrix of tested Proxmox versions
2025-07-20 12:37:20 +02:00
gyptazy
6212d23268 docs: Add compatibility matrix of tested Proxmox versions
Fixes: #273
2025-07-20 12:36:25 +02:00
Florian
cf8c06393f Merge pull request #270 from gyptazy/docs/258-extend-doc-of-cluster-node-names-usage
docs: Adjust docs regarding maintenance node hostnames
2025-07-17 11:53:33 +02:00
Florian Paul Azim Hoberg
5c23fd3433 docs: Adjust docs regarding maintenance node hostnames
Fixes: #258
2025-07-17 11:52:08 +02:00
Florian
0fb732fc8c Merge pull request #269 from gyptazy/fix/268-evaluate-balancing-types
fix: Fix balancing evaluation of guest types (e.g., VM or CT).
2025-07-17 11:44:29 +02:00
Florian Paul Azim Hoberg
f36d96c72a fix: Fix balancing evaluation of guest types (e.g., VM or CT).
Fixes: #268
2025-07-17 11:41:00 +02:00
Florian
9cc03717ef Merge pull request #267 from gyptazy/release/1.1.5
release: Create release 1.1.5
2025-07-14 11:13:12 +02:00
Florian Paul Azim Hoberg
4848887ccc release: Create release 1.1.5
Fixes: #266
2025-07-14 11:08:38 +02:00
Gombócz Márton
04476feeaf Docs/custom api port (#264)
* docs(README.md): added description and examples of port declaration in hosts
* docs(docs/03_configuration): updated hosts description about using ports
2025-07-10 10:33:44 +02:00
Florian
b3765bf0ae Merge pull request #261 from gyptazy/feature/260-custom-api-ports
feature: Allow custom (instead of static tcp/8006) API ports for API hosts
2025-07-10 09:19:34 +02:00
Florian Paul Azim Hoberg
806b728a14 feature: Allow custom (instead of static tcp/8006) API ports for API hosts.
Fixes: #260
2025-07-08 17:39:29 +02:00
Florian
2c34ec91b1 Merge pull request #257 from gyptazy/release/prepare-1.1.5
release: Create release 1.1.5 beta 1
2025-06-29 11:08:15 +02:00
gyptazy
08b746a53b release: Create release 1.1.5 beta 1 2025-06-27 16:50:17 +02:00
Florian
615e2f5608 Merge pull request #256 from gyptazy/release/1.1.4
release: Create release 1.1.4
2025-06-27 16:40:53 +02:00
gyptazy
fa1e1ad8a3 release: Create release 1.1.4
Fixes: #254
2025-06-27 16:23:31 +02:00
pmarasse
c78def3919 Fix loglevels (#255)
* Modified some loglevels to make output lighter at INFO level

Co-authored-by: Philippe MARASSE <philippe@marasse.fr>
2025-06-27 15:10:57 +02:00
Florian
54c53b9860 Merge pull request #253 from gyptazy/feature/245-add-guest-pinning-to-group-of-nodes
feature: Allow pinning of guests to a group of nodes
2025-06-26 13:59:44 +02:00
Florian Paul Azim Hoberg
1fe8f703cc feature: Allow pinning of guests to a group of nodes
* You can now simply define multiple tags with plb_pin_node names
    where nodes are being evaluated and the one with the lowest
    resource usage will be taken.

Fixes: #245
2025-06-26 13:54:05 +02:00
Florian
7ba806abf7 Merge pull request #252 from gyptazy/fix/248-dry-run-with-deactivated-balancing
Fix an issue where balancing was performed in combination of deactivated balancing and dry-run mode
2025-06-24 10:09:10 +02:00
Florian Paul Azim Hoberg
6b2e120739 Fix: Fixed an issue where balancing was performed in combination of deactivated balancing and dry-run mode
Fixes: #248
2025-06-24 10:06:28 +02:00
Florian
e4103df326 Merge pull request #251 from gyptazy/prepare/1.1.4
release: Prepare release 1.1.4 beta
2025-06-24 10:00:27 +02:00
Florian Paul Azim Hoberg
f2acd4efa6 release: Prepare release 1.1.4 beta 2025-06-24 09:56:06 +02:00
Florian
f4ed8d9928 Merge pull request #247 from gyptazy/fix/readme-1.1.3
fix: Adjust readme for Container image version of release 1.1.3.
2025-06-19 09:32:13 +02:00
gyptazy
ba74254b93 fix: Adjust readme for Container image version of release 1.1.3. 2025-06-19 09:31:31 +02:00
Florian
792a0f3820 Merge pull request #246 from gyptazy/release/1.1.3
release: Prepare release 1.1.3
2025-06-19 09:30:31 +02:00
gyptazy
b766041c4c release: Prepare release 1.1.3
Fixes: #242
2025-06-19 09:25:56 +02:00
Florian
a31e41f839 Merge pull request #243 from gyptazy/feature/241-make-amount-of-parallel-migrations-configureable
feature: Make the amount of parallel migrations configurable
2025-06-10 18:46:39 +02:00
gyptazy
7cb5a31b89 feature: Make the amount of parallel migrations configurable
Fixes: #241
2025-06-05 16:12:47 +02:00
Florian
617d0a3ae3 Merge pull request #240 from gyptazy/feature/239-add-optional-wait-time-until-service-starts
feature: Add optional wait time before service action.
2025-06-04 16:49:24 +02:00
gyptazy
db3a3b77fc feature: Add optional wait time before service action.
Fixes: #239
2025-06-01 16:06:42 +02:00
Florian
5a9643275a Merge pull request #237 from gyptazy/feature/94-balance-cpu-by-average-consumption
feature:  Use the average CPU consumption of a guest within the last 60 minutes instead of the current CPU usage
2025-05-29 12:01:13 +02:00
Florian
60d1e333aa Merge pull request #238 from gyptazy/feature/189-add-reload-function
feature: Add relaod (SIGHUP) function to ProxLB to reload the configuration.
2025-05-29 12:00:42 +02:00
gyptazy
96dc435cf6 feature: Add relaod (SIGHUP) function to ProxLB to reload the configuration.
Fixes: #189
2025-05-24 09:56:20 +02:00
gyptazy
263b08b53a feature: Add reload method to ProxLB systemd file
Fixes: #189
2025-05-24 09:19:42 +02:00
gyptazy
89102d517e feature: Use the average CPU consumption of a guest within the last 60 minutes instead of the current CPU usage
- Using the current CPU consumption of a guest object is too volatile and does not represent
    the real usage. Therefore, we use the average consumption of the cpu values within the
    last 60 minutes.

Thanks-to: @philslab-ninja
Fixes: #94
2025-05-24 09:17:14 +02:00
Florian
845af4abc8 Merge pull request #236 from gyptazy/prepare/dev1.1.3beta
development: Adjust beta release 1.1.3
2025-05-22 13:42:05 +02:00
gyptazy
3e02403598 development: Adjust beta release 1.1.3 2025-05-22 06:58:53 +02:00
Florian
0b0d569877 Merge pull request #235 from gyptazy/feature/232-align-proxmox-ha-maintenance-mode
feature: Align maintenance mode with Proxmox HA maintenance mode
2025-05-22 06:55:32 +02:00
Florian Paul Azim Hoberg
1cbda2e2f9 feature: Align maintenance mode with Proxmox HA maintenance mode
Fixes: #232
2025-05-21 18:19:50 +02:00
gyptazy
b6febf1933 feature: Add action to create multiarch container 2025-05-20 19:57:04 +02:00
Florian
53a6d2a459 Merge pull request #233 from gyptazy/feature/231-arm64-container
feature: Add workflows to build container images for AMD64 + ARM64 architecture
2025-05-20 12:11:03 +02:00
Florian Paul Azim Hoberg
6c82ce010b feature: Add workflows to build container images for AMD64 + ARM64 architecture
Fixes: #231
2025-05-20 12:06:22 +02:00
Florian
4b8b73e468 Merge pull request #228 from gyptazy/release/1.1.2-readme
docs: Update readme with new image version
2025-05-13 08:26:48 +02:00
Florian Paul Azim Hoberg
a75729dd6a docs: Update readme with new image version 2025-05-13 08:26:03 +02:00
Florian
b8792a87af Merge pull request #227 from gyptazy/release/1.1.2
release: Create release 1.1.2
2025-05-13 08:18:23 +02:00
Florian Paul Azim Hoberg
c1261a2d3c release: Create release 1.1.2
Fixes: #226
2025-05-13 08:13:43 +02:00
Florian
0035f57738 Merge pull request #223 from gyptazy/fix/222-extend-debug-messages
fix: Force type cast guest cpu count to int where in some corner cases a str got returned.
2025-05-08 16:23:10 +02:00
gyptazy
b372d361e7 fix: Force type cast guest cpu count to int where in some corner cases a str got returned.
Fixes: #222
2025-05-03 08:53:56 +02:00
Florian
1e096e1aae Merge pull request #221 from gyptazy/fix/137-systemd-unit-file
fix: Adjust the systemd unit file to run after the network target on non PVE nodes
2025-04-26 08:43:33 +02:00
gyptazy
420d669236 fix: Adjust the systemd unit file to run after the network target on non PVE nodes
Fixes: #137
2025-04-26 08:42:24 +02:00
Florian
24aa6aabc6 Merge pull request #220 from gyptazy/feature/157-add-retry-proxmox-api
feature: Add a retry mechanism when connecting to the Proxmox API
2025-04-24 13:49:55 +02:00
Florian Paul Azim Hoberg
5a9a4af532 feature: Add a retry mechanism when connecting to the Proxmox API
Fixes: #157
2025-04-24 13:29:41 +02:00
Florian
50f93e5f59 Merge pull request #219 from gyptazy/feature/218-add-1-to-1-relations-guest-hypervisor
feature: Add possibility to pin guests to a specific hypervisor node.
2025-04-24 13:01:44 +02:00
Florian Paul Azim Hoberg
33784f60b4 feature: Add possibility to pin guests to a specific hypervisor node.
Fixes: #218
2025-04-24 08:54:58 +02:00
Florian
9a261aa781 Merge pull request #213 from gyptazy/prepare/release-v1.1.2
release: Prepare release v1.1.2
2025-04-19 20:14:12 +02:00
gyptazy
366d5bc264 release: Prepare release v1.1.2 2025-04-19 20:10:49 +02:00
Florian
96ffa086b1 Merge pull request #212 from gyptazy/release/1.1.1
release: Create release 1.1.1
2025-04-19 19:45:33 +02:00
gyptazy
db005c138e release: Create release 1.1.1
Fixes: #211
2025-04-19 19:43:07 +02:00
Florian
1168f545e5 Merge pull request #210 from gyptazy/docs/209-adjust-options-in-readme
docs: * Fix the rendering of the possible values of the ProxLB option…
2025-04-19 06:50:48 +02:00
gyptazy
cc663c0518 docs: * Fix the rendering of the possible values of the ProxLB options in the README file
* Mention the privilege separation part on the token generation chapter

Fixes: #209
2025-04-19 06:49:04 +02:00
Florian
40de31bc3b Merge pull request #208 from gyptazy/techdebt/fix-code-style
tecdebt: Adjust code style.
2025-04-18 17:07:01 +02:00
gyptazy
5884d76ff4 tecdebt: Adjust code style. 2025-04-18 16:52:59 +02:00
Florian
7cc59eb6fc Merge pull request #202 from glitchvern/fix/200-requery-zero-guest-cpu-used2
fix: Requery a guest if that running guest reports 0 cpu usage
2025-04-18 16:38:17 +02:00
gyptazy
24b3b35640 fix: Fix the guest type relationship in the logs when a migration job failed (by @gyptazy) [#204]
feature: Providing the API upstream error message when migration fails in debug mode (by @gyptazy) [#205]

Fixes: #204
Fixes: #205
2025-04-18 16:35:02 +02:00
Florian
f2b8829299 Merge pull request #204 from sid3windr/patch-1
Fix default configuration file path in README.md
2025-04-18 12:41:22 +02:00
Tom Laermans
4b64a041cc Fix default configuration file path in README.md
With 1.1.0, the default configuration file changed from proxlb.conf to proxlb.yaml but the README was not fully updated.
2025-04-18 11:04:51 +02:00
glitchvern
bd1157127a fix: limit to 10 requerys per a guest 2025-04-17 16:13:28 +00:00
glitchvern
be6e4bbfa0 fix: Requery a guest if that running guest reports 0 cpu usage 2025-04-16 18:42:27 +00:00
Florian
25b631099c Merge pull request #199 from gyptazy/docs/193-add-chapter-ignore-vm
docs: Add documentation about ignore guests such like VMs or CTs.
2025-04-15 19:23:27 +02:00
gyptazy
1d698c5688 docs: Add documentation about ignore guests such like VMs or CTs.
Fixes: #193
2025-04-15 19:22:10 +02:00
Florian
40f848ad7f Merge pull request #198 from glitchvern/fix/197-remove-hard-coded-memory-usage-from-lowest-usage-node
fix: Use method/mode in configuration to calculate lowest_usage_node
2025-04-15 19:08:52 +02:00
Florian
fd2725c878 Merge pull request #196 from glitchvern/fix/195-cpu-used-times-cpu-cores
fix: set cpu_used to be cpu usage times number of cpu cores
2025-04-15 18:36:25 +02:00
glitchvern
34b1d72e40 fix: Use method and mode specified in configuration to calculate lowest_usage_node 2025-04-15 16:27:08 +00:00
glitchvern
ca7db26976 fix: set cpu_used to be cpu usage times number of cpu cores 2025-04-14 21:23:05 +00:00
Florian
94552f9c9e Merge pull request #194 from crandler/main
Main
2025-04-14 12:44:50 +02:00
Sven Eulberg
32c67b9c96 fix: typos 2025-04-14 12:36:28 +02:00
Florian
89f337d8c3 Merge pull request #192 from gyptazy/tecdebt/185-improve-logging-code
tecdebt: Improve logging handler creation
2025-04-14 06:55:51 +02:00
Florian Paul Azim Hoberg (@gyptazy)
8a724400b8 tecdebt: Improve logging handler creation
Fixes: #185
2025-04-14 06:52:04 +02:00
Florian
f96f1d0f64 Merge pull request #186 from glitchvern/fix/185-logging-handler-for-no-systemd-integration
fix: logging handler for no systemd integration
2025-04-14 06:46:58 +02:00
Florian
15398712ee Merge pull request #190 from mika/mika/docs
docs: Fix minor typos
2025-04-13 11:19:18 +02:00
Florian
ddb9963062 Merge pull request #191 from gyptazy/feature/184-validate-user-permissions
Feature: Add validation for the minimum required permissions of a user in Proxmox.
2025-04-13 11:16:09 +02:00
Florian Paul Azim Hoberg (@gyptazy)
f18a9f3d4c Feature: Add validation for the minimum required permissions of a user in Proxmox.
Fixes: #184
2025-04-13 11:12:30 +02:00
Michael Prokop
1402ba9732 Minor typo fixes
s/connectoing/connecting/
s/furhter/further/
s/interating/iterating/
s/ist/is/
s/maintence/maintenance/
s/performt/performed/
s/ressources/resources/
s/sucessfully/successfully/
s/the the/the/
s/timout/timeout/
s/wether/whether/
2025-04-13 10:48:23 +02:00
Florian
af51f53221 Merge pull request #188 from glitchvern/fix/187-allow-use-of-minutes-instead-of-hours
fix: allow use of minutes instead of hours
2025-04-13 08:49:17 +02:00
glitchvern
bce2d640ef fix: allow use of minutes instead of hours 2025-04-11 23:09:00 +00:00
glitchvern
1bb1847e45 fix: logging handler for no systemd integration 2025-04-11 21:55:09 +00:00
Florian
e9543db138 Merge pull request #182 from gyptazy/change/180-switch-default-balancing-to-used-instead-assigned
change: Change the default banalcing mode to used instead of assigned.
2025-04-10 09:34:19 +02:00
gyptazy
a8e8229787 change: Change the default banalcing mode to used instead of assigned.
Fixes: #180
2025-04-10 09:33:17 +02:00
Florian
d1c91c6f2a Merge pull request #179 from gyptazy/docs/164-adjust-api-token-usage
docs: Adjust docs regarding API Token and privilege separation.
2025-04-07 16:14:40 +02:00
gyptazy
843691f8b4 docs: Adjust docs regarding API Token and priviledge separation.
Fixes: #164
2025-04-07 15:51:44 +02:00
Florian
c9f14946d1 Merge pull request #178 from gyptazy/fix/174-honor-balancing-activation-value
fix: Honor the value when balancing should not be performed and stop balancing.
2025-04-07 15:41:02 +02:00
gyptazy
77cd7b5388 fix: Honor the value when balancing should not be performed and stop balancing.
Fixes: #174
2025-04-07 15:38:32 +02:00
Florian
55502f9bed Merge pull request #177 from gyptazy/change/176-change-turn-daemon-mode-on-default
change: Change the default behaviour of the daemon mode to active.
2025-04-07 15:28:12 +02:00
gyptazy
f08b823cc4 change: Change the default behaviour of the daemon mode to active.
Fixes: #176
2025-04-07 15:25:10 +02:00
Florian
f831d4044f Merge pull request #175 from gyptazy/feature/168-add-more-flexible-schedule-timers
feature: Add a more flexible way to define schedules directly in minutes or hours
2025-04-07 15:20:22 +02:00
gyptazy
e8d8d160a7 feature: Add a more flexible way to define schedules directly in minutes or hours. [#168]
Sponsored-by: @gyptazy
Fixes: #168
2025-04-07 15:16:55 +02:00
Florian
dbbd4c0ec8 Merge pull request #172 from gyptazy/changelog/171-set-correct-python-path-docker-image
changelog: Add changelog for: Fix Python 3 path for Docker entrypoint
2025-04-02 07:24:01 +02:00
Florian
fc9a0e2858 Merge pull request #171 from crandler/main
fix: path correction for docker entrypoint
2025-04-02 07:23:48 +02:00
gyptazy
17eb43db94 changelog: Add changelog for: Fix Python 3 path for Docker entrypoint
Sponsored-by: @crandler
Fixes: #170
Fixes: #171
2025-04-02 07:20:15 +02:00
Sven Eulberg
06610e9b9d Path correction 2025-04-01 18:38:58 +02:00
Florian
889b88fd6c Merge pull request #167 from gyptazy/prep/1.1.1
release: Prepare development branch for release 1.1.1
2025-04-01 08:03:36 +02:00
gyptazy
c5ca3e13e0 release: Prepare development branch for release 1.1.1 2025-04-01 08:02:40 +02:00
Florian
c1c524f092 Merge pull request #166 from gyptazy/fix/163-ignore-vm-tag
fix: Fix tag evluation for VMs for being ignored for further balancing
2025-04-01 07:01:14 +02:00
gyptazy
7ea7defa1f fix: Fix tag evluation for VMs for being ignored for further balancing
Fixes: #163
Fixes: #165
2025-04-01 06:51:42 +02:00
Florian
6147c0085b Merge pull request #161 from gyptazy/fix/spell-docs
fix: Adjust spelling in the docs
2025-03-31 07:39:40 +02:00
gyptazy
0b70a9c767 fix: Adjust spelling in the docs 2025-03-31 07:38:04 +02:00
Florian
d6d22c4096 Merge pull request #160 from gyptazy/fix/142-mutal-exclusive-on-pass
fix: Fix mutal exclusive authentication based on secrets.
2025-03-31 06:50:26 +02:00
gyptazy
6da54c1255 fix: Fix mutal exclusive authentication based on secrets.
Fixes: #142
2025-03-31 06:46:31 +02:00
Florian
b55b4ea7a0 Merge pull request #153 from gyptazy/docs/installation
release: Prepare release 1.1.0
2025-03-31 05:15:05 +02:00
Florian
51625fe09e Merge pull request #159 from gyptazy/feature/json-output
fix: Add JSON output again
2025-03-25 09:34:10 +01:00
Florian Paul Azim Hoberg (@gyptazy)
f3b9d33c87 fix: Add JSON output again
Fixes: #158
2025-03-25 09:28:33 +01:00
Florian
8e4326f77a Merge pull request #156 from gyptazy/fix/137-fix-systemd-unit
fix: Fix the systemd unit file to start after the pveproxy daemon
2025-03-24 18:25:10 +01:00
gyptazy
3d642a7404 fix: Fix the systemd unit file to start after the pveproxy daemon
Fixes: #137
2025-03-24 18:15:11 +01:00
gyptazy
552364471d release: Create release 1.1.0
- Create release 1.1.0 content
 - Add documentation for release 1.1.0
 - Adjust changelog

Fixes: #114
Fixes: #154
Sponsored-by: credativ GmbH (https://credativ.de)
2025-03-20 20:19:34 +01:00
Florian
cf15866270 Merge pull request #151 from gyptazy/packaging/container-image
feature: Add Dockerfile to create container image
2025-03-19 14:53:04 +01:00
Florian Paul Azim Hoberg (@gyptazy)
7d4def14b1 feature: Add Dockerfile to create container image
* Also switch from Debian image to Alpine image
2025-03-19 14:48:44 +01:00
Florian
20ad9389d4 Merge pull request #150 from gyptazy/docs/adjust_docs
docs: Add docs for configuration and faq.
2025-03-18 15:09:04 +01:00
Florian Paul Azim Hoberg (@gyptazy)
d73073a187 docs: Add docs for configuration and faq. 2025-03-18 15:05:29 +01:00
Florian
b307d556e5 Merge pull request #149 from gyptazy/packaging/debian
packaging: Add Debian packaging
2025-03-18 09:30:15 +01:00
gyptazy
17c4dc445e packaging: Add Debian packaging
Fixes: #148
2025-03-18 08:40:28 +01:00
Florian
03ea29ae81 Merge pull request #147 from gyptazy/adjustment/146-rename-param-force-to-enforce-affinity
adjustment: Rename param `force` to `enforce_affinity`
2025-03-17 09:14:38 +01:00
gyptazy
e22a27652c adjustment: Rename param force to enforce_affinity
* This change should make the parameter's intention more clear
2025-03-17 09:10:34 +01:00
Florian
c3ae3e1f8c Merge pull request #145 from gyptazy/fix/142-api-user-token-mutually-exclusive
fix: Add validation for mutal exclusive user authentication
2025-03-17 07:43:00 +01:00
gyptazy
094a9b2ebb fix: Add validation for mutal exclusive user authentication
* Validate that only username/password OR API token is being used

Fixes: #142
2025-03-17 07:40:01 +01:00
Florian
d8b1c74155 Merge pull request #144 from gyptazy/fix/143-catch-non-resolvable-dns-addresses
fix: Catch non-resolvable DNS names and log them but proceed by the g…
2025-03-17 06:59:47 +01:00
gyptazy
c8fad9605c fix: Catch non-resolvable DNS names and log them but proceed by the given host list
Fixes: #143
2025-03-17 06:57:01 +01:00
Florian
e8d0c13f16 Merge pull request #140 from gyptazy/fix/adjust-branch-license-info
enhancement: Adjust license information, adjust class/func descriptions
2025-03-03 10:51:00 +01:00
gyptazy
f781e74d3a enhancement: Adjust license information, adjust class/func descriptions 2025-03-03 10:48:12 +01:00
Florian
3cbdb12741 Merge pull request #139 from gyptazy/feature/125-add-proxmox-api-token-support
feature: Add Proxmox API token authentication
2025-03-02 17:38:46 +01:00
gyptazy
a714ea8d64 feature: Add Proxmox API token authentication
Fixes: #125
2025-03-02 17:35:02 +01:00
Florian
d81d4380de Merge pull request #138 from gyptazy/release/1.1.0-alpha
refactor: Code refactor of ProxLB preparing release 1.1.0
2025-03-02 17:10:40 +01:00
gyptazy
31498da25a refactor: Code refactor of ProxLB preparing release 1.1.0
Fixes: #114
Fixes: #132
Fixes: #130
Fixes: #129
Fixes: #128
Fixes: #127
Fixes: #123
Fixes: #102
2025-03-02 17:03:49 +01:00
Florian
7f59f69eab Merge pull request #137 from thomasfinstad/fix/135-systemd-service-install-target
fix: systemd service install target
2025-02-19 08:50:29 +01:00
Thomas Finstad
200b7cd170 fix: systemd service install target 2025-02-19 08:47:03 +01:00
Florian
94df2fd1a6 Merge pull request #134 from Mrton0121/main
feat: optimize Dockerfile, create docker-compose with build
2025-01-24 10:38:15 +01:00
Mrton0121
8d8fd518fe feat: optimize Dockerfile, create docker-compose with build 2025-01-24 09:38:32 +01:00
Florian
37bb226cf0 Merge pull request #131 from gyptazy/release/1.0.6
release: Create release 1.0.6
2024-12-24 11:00:53 +01:00
gyptazy
48b8a07135 release: Create release 1.0.6 2024-12-24 10:59:40 +01:00
Florian
222beb360c Merge pull request #120 from gyptazy/fix/119-maintenance-mode-cli-and-config
Fix maintenance mode when using cli arg and config mode by using the merged list.
2024-11-09 09:36:57 +01:00
gyptazy
f9b30d0af4 Fix maintenance mode when using cli arg and config mode by using the merged list.
Sponsored-by: @CartCaved
Fixes: #119
2024-11-09 09:35:21 +01:00
Florian
28f87e2907 Merge pull request #117 from gyptazy/fix/115-ignore-schedule-bool-parsing
fix: Fix that a scheduler time definition of 1 (int) gets wrongly interpreted as a bool.
2024-11-06 08:47:10 +01:00
gyptazy
7587e1beaf fix: Fix that a scheduler time definition of 1 (int) gets wrongly interpreted as a bool.
Fixes: #115
2024-11-06 08:43:00 +01:00
Florian
5542b9bc6c Merge pull request #116 from gyptazy/release/prepare-release-1.0.5
release: Create release 1.0.5
2024-10-30 17:13:06 +01:00
gyptazy
16c5ee4d74 release: Create release 1.0.5 2024-10-30 17:04:14 +01:00
Alex Shut
21a73b71df Allow migration from local disks (#113)
Add parameter `with-local-disks=1` to allow migration from local disks.
2024-10-19 08:17:10 +02:00
Elliot Nevills
d3c055cbad fix: bug to allow log_verbosity be set to DEBUG, WARN, and WARNING (#98)
* fixed bug to allow log_verbosity be set to DEBUG, WARN, and WARNING

* removed WARN logging verbosity option

* adjusted for logging verbosity options

* add to changelog

* added fix log verbosity issue to changelog
2024-10-18 21:21:35 +02:00
Florian
24b7d2c860 Merge pull request #111 from gyptazy/fix/106-fix-maintenance-node-eval
fix: Fix offline node evaluation & maintenance compare of different type objects
2024-10-18 21:20:54 +02:00
gyptazy
6e87e2d478 fix: Fix offline node evaluation & maintenance compare of different type objects
- Fix node (and its objects) evaluation when not reachable (e.g., maintenance).
  - Fix evaluation of maintenance mode where comparing list & string resulted in a crash (by @glitchvern).
  - Set ProxLB version to 1.0.5b

Fixes: #160
Fixes: #107
Contributed-by: @glitchvern
2024-10-17 13:32:47 +02:00
Florian
2593b87d3f Merge pull request #105 from gyptazy/fix/104-adjust-docs-parallel-migration
fix(docs): Change docs to make bool usage in configs more clear.
2024-10-16 08:48:56 +02:00
gyptazy
6310262e97 fix(docs): Change docs to make bool usage in configs more clear.
Fixes: #104
2024-10-16 08:19:16 +02:00
155 changed files with 5509 additions and 2585 deletions

View File

@@ -0,0 +1,2 @@
changed:
- Change docs to make bool usage in configs more clear (by @gyptazy). [#104]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix evaluation of maintenance mode where comparing list & string resulted in a crash (by @glitchvern). [#106]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix node (and its objects) evaluation when not reachable, e.g., maintenance (by @gyptazy). [#107]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix migration from local disks (by @greenlogles). [#113]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix allowed values (add DEBUG, WARNING) for log verbosity (by @gyptazy). [#98]

View File

@@ -0,0 +1 @@
date: 2024-10-30

View File

@@ -0,0 +1,2 @@
fixed:
- Fix that a scheduler time definition of 1 (int) gets wrongly interpreted as a bool (by @gyptazy). [#115]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix maintenance mode when using cli arg and config mode by using the merged list (by @CartCaved). [#119]

View File

@@ -0,0 +1 @@
date: 2024-12-24

View File

@@ -0,0 +1,11 @@
fixed:
- Refactored code base for ProxLB [#114]
- Switched to `pycodestyle` for linting [#114]
- Package building will be done within GitHub actions pipeline [#114]
- ProxLB now only returns a warning when no guests for further balancing are not present (instead of quitting) [132#]
- All nodes (according to the free resources) will be used now [#130]
- Fixed logging outputs where highest/lowest were mixed-up [#129]
- Stop balancing when movement would get worste (new force param to enfoce for affinity rules) [#128]
- Added requested documentation regarding Proxmox HA groups [#127]
- Rewrite of the whole affinity/anti-affinity rules evaluation and placement [#123]
- Fixed the `ignore` parameter for nodes where the node and guests on the node will be untouched [#102]

View File

@@ -0,0 +1,2 @@
feature:
- Add Proxmox API authentication support. [#125]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix the systemd unit file to start ProxLB after pveproxy (by @robertdahlem). [#137]

View File

@@ -0,0 +1 @@
date: 2025-04-01

View File

@@ -0,0 +1,2 @@
fixed:
- Fix tag evluation for VMs for being ignored for further balancing [#163]

View File

@@ -0,0 +1,2 @@
fixed:
- Improve logging verbosity of messages that had a wrong servity [#165]

View File

@@ -0,0 +1,2 @@
feature:
- Add a more flexible way to define schedules in minutes or hours (by @gyptazy) [#168]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix Python path for Docker entrypoint (by @crandler) [#170]

View File

@@ -0,0 +1,2 @@
fixed:
- Honor the value when balancing should not be performed and stop balancing [#174]

View File

@@ -0,0 +1,2 @@
changed:
- Change the default behaviour of the daemon mode to active [#176]

View File

@@ -0,0 +1,2 @@
changed:
- Change the default banalcing mode to used instead of assigned [#180]

View File

@@ -0,0 +1,2 @@
feature:
- Add validation for the minimum required permissions of a user in Proxmox [#184]

View File

@@ -0,0 +1,2 @@
fix:
- add handler to log messages with severity less than info to the screen when there is no systemd integration, for instance, inside a docker container (by @glitchvern) [#185]

View File

@@ -0,0 +1,2 @@
fixed:
- allow the use of minutes instead of hours and only accept hours or minutes in the format (by @glitchvern) [#187]

View File

@@ -0,0 +1,2 @@
fixed:
- Set cpu_used to the cpu usage, which is a percent, times the total number of cores to get a number where guest cpu_used can be added to nodes cpu_used and be meaningful (by @glitchvern) [#195]

View File

@@ -0,0 +1,2 @@
fixed:
- Remove hard coded memory usage from lowest usage node and use method and mode specified in configuration instead (by @glitchvern) [#197]

View File

@@ -0,0 +1,2 @@
fixed:
- Requery a guest if that running guest reports 0 cpu usage (by @glitchvern) [#200]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix the guest type relationship in the logs when a migration job failed (by @gyptazy) [#204]

View File

@@ -0,0 +1,2 @@
added:
- Providing the API upstream error message when migration fails in debug mode (by @gyptazy) [#205]

View File

@@ -0,0 +1 @@
date: 2025-04-20

View File

@@ -0,0 +1,2 @@
added:
- Prevent redundant rebalancing by validating existing affinity enforcement before taking actions (@gyptazy). [#335]

View File

@@ -0,0 +1,2 @@
added:
- Add safety-guard for PVE 8 users when activating conntrack-aware migrations mistakenly (@gyptazy). [#359]

View File

@@ -0,0 +1,3 @@
fixed:
- Fixed the Proxmox API connection validation which returned a false-positive logging message of timeouts (@gyptazy). [#361]
- Refactored Proxmox API connection functions

View File

@@ -0,0 +1,2 @@
fixed:
- Fixed a crash during PVE resource pool enumeration by skipping members not having a 'name' property (@stefanoettl). [#368]

View File

@@ -0,0 +1 @@
date: 2025-11-25

View File

@@ -0,0 +1,2 @@
fixed:
- Fixed missing overprovisioning safety guard to avoid node overprovisioning (@gyptazy). [#275]

View File

@@ -0,0 +1,2 @@
fixed:
- Fixed affinity matrix pre-validation by inverting validations (@Thalagyrt). [#335]

View File

@@ -0,0 +1,2 @@
added:
- Add resource reservation support for PVE nodes (@Chipmonk2). [#373]

View File

@@ -0,0 +1,3 @@
changed:
- Changed balancing and sorting behaviour (@gyptazy). [#378]
- Balancing objects will be ordered by: count of objects in affinity-rules, followed by memory size

View File

@@ -0,0 +1,2 @@
added:
- Add possibility to sort and select balancing workloads by smaller/larger guest objects (@gyptazy). [#387]

View File

@@ -0,0 +1,3 @@
added:
- Add support for Proxmox's native HA (affinity/anti-affinity) rules (@gyptazy). [#391]
- Add support for Proxmox's native HA (node-affinity) rules for pinning guests to nodes (@gyptazy). [#391]

View File

@@ -0,0 +1,2 @@
fixed:
- Fixed pool based node pinning (@gyptazy). [#395]

View File

@@ -0,0 +1,2 @@
added:
- Add HA job validation for migration jobs (@gytazy). [#402]

View File

@@ -0,0 +1,2 @@
added:
- Add support for configuring node-pinning strictness (default: true) within pools (@gyptazy). [#406]

View File

@@ -0,0 +1,2 @@
fixed:
- Fixed that ignored VMs/CTs got moved to another node when being ignored (@gyptazy). [#408]

View File

@@ -0,0 +1,2 @@
added:
- Add new option to enforce node/guest pinning even when cluster is balanced from a resource perspective (@gyptazy). [#414]

View File

@@ -0,0 +1 @@
date: 2026-01-12

View File

@@ -0,0 +1,2 @@
fixed:
- Fix PSI based balancing which resulted in a Python KeyError (@gyptazy). [#420]

View File

@@ -0,0 +1 @@
date: TBD

View File

@@ -0,0 +1,2 @@
fixed:
- Fix systemd unit file to run after network on non PVE nodes (by @robertdahlem) [#137]

View File

@@ -0,0 +1,2 @@
added:
- Add a configurable retry mechanism when connecting to the Proxmox API (by @gyptazy) [#157]

View File

@@ -0,0 +1,2 @@
added:
- Add 1-to-1 relationships between guest and hypervisor node to ping a guest on a node (by @gyptazy) [#218]

View File

@@ -0,0 +1,2 @@
fixed:
- Force type cast cpu count of guests to int for some corner cases where a str got returned (by @gyptazy). [#222]

View File

@@ -0,0 +1 @@
date: 2025-05-13

View File

@@ -0,0 +1,2 @@
added:
- Add relaod (SIGHUP) function to ProxLB to reload the configuration (by @gyptazy). [#189]

View File

@@ -0,0 +1,2 @@
fixed:
- Align maintenance mode with Proxmox HA maintenance mode (by @gyptazy). [#232]

View File

@@ -0,0 +1,2 @@
added:
- Add optional wait time parameter to delay execution until the service takes action (by @gyptazy). #239

View File

@@ -0,0 +1,2 @@
added:
- Make the amount of parallel migrations configurable (by @gyptazy). [#241]

View File

@@ -0,0 +1,2 @@
changed:
- Use the average CPU consumption of a guest within the last 60 minutes instead of the current CPU usage (by @philslab-ninja & @gyptazy). [#94]

View File

@@ -0,0 +1 @@
date: 2025-06-19

View File

@@ -0,0 +1,2 @@
added:
- Allow pinning of guests to a group of nodes (@gyptazy). [#245]

View File

@@ -0,0 +1,2 @@
fixed:
- Fixed an issue where balancing was performed in combination of deactivated balancing and dry-run mode (@gyptazy). [#248]

View File

@@ -0,0 +1,2 @@
fixed:
- Modified log levels to make output lighter at INFO level (@pmarasse) [#255]

View File

@@ -0,0 +1 @@
date: 2025-06-27

View File

@@ -0,0 +1,2 @@
added:
- Allow custom API ports instead of fixed tcp/8006 (@gyptazy). [#260]

View File

@@ -0,0 +1 @@
date: 2025-07-14

View File

@@ -0,0 +1,2 @@
fixed:
- Fix balancing evaluation of guest types (e.g., VM or CT) (@gyptazy). [#268]

View File

@@ -0,0 +1,2 @@
added:
- Add validation for provided API user token id to avoid confusions (@gyptazy). [#291]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix stacktrace output when validating permissions on non existing users in Proxmox (@gyptazy). [#291]

View File

@@ -0,0 +1,3 @@
fixed:
- Fix Overprovisioning first node if anti_affinity_group has only one member (@MiBUl-eu). [#295]

View File

@@ -0,0 +1,3 @@
fixed:
- Validate for node presence when pinning guests to avoid crashing (@gyptazy). [#296]

View File

@@ -0,0 +1 @@
date: 2025-09-04

View File

@@ -0,0 +1,2 @@
added:
- Add graceful shutdown for SIGINT (e.g., CTRL + C abort). (@gyptazy). [#304]

View File

@@ -0,0 +1,2 @@
added:
- Add conntrack state aware migrations of VMs (@gyptazy). [#305]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix crash when validating absent migration job ids. (@gyptazy). [#308]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix guest object names are not being evaluated in debug log. (@gyptazy). [#310]

View File

@@ -0,0 +1 @@
date: 2025-09-19

View File

@@ -0,0 +1,3 @@
changed:
- Container image does not run as root anymore (@mikaelkrantz945). [#317]
- Container image uses venv for running ProxLB (@mikaelkrantz945). [#317]

View File

@@ -0,0 +1,2 @@
fixed:
- Fix API errors when using conntrack aware migration with older PVE versions (@gyptazy). [#318]

View File

@@ -0,0 +1,2 @@
fixed:
- Add a static ProxLB prefix to the log output when used by journal handler (@gyptazy). [#329]

View File

@@ -0,0 +1 @@
date: 2025-10-09

View File

@@ -0,0 +1,5 @@
added:
- Add pressure (PSI) based balancing for memory, cpu, disk (req. PVE9 or greater) (@gyptazy). [#337]
- Pressure (PSI) based balancing for nodes
- Pressure (PSI) based balancing for guests
- Add PVE version evaluation

View File

@@ -0,0 +1,2 @@
added:
- Add an optional memory balancing threshold (@gyptazy). [#342]

View File

@@ -0,0 +1,2 @@
added:
- Add affinity/anti-affinity support by pools (@gyptazy). [#343]

View File

@@ -0,0 +1 @@
date: 2025-10-30

View File

@@ -1,3 +0,0 @@
[flake8]
per-file-ignores =
proxlb: E501,E221,E266,E231,E127,E222,E128

View File

@@ -1,26 +0,0 @@
name: Run basic pipeline on push
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Set up Python for ProxLB
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for ProxLB
run: |
python -m pip install --upgrade pip
pip install pytest proxmoxer flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Python linting
run: |
python3 -m flake8 proxlb
- name: Create distro packages
run: |
cd packaging
./01_package.sh

21
.github/workflows/10-code-liniting.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Code linting
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Setup dependencies for code linting
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install additional dependencies for code linting
run: |
sudo apt-get update
sudo apt-get -y install python3-pycodestyle pycodestyle
- name: Run code linting on ProxLB Python code
run: |
pycodestyle proxlb/*

View File

@@ -0,0 +1,100 @@
name: "Build package: .deb"
on: [push]
jobs:
lint-code-proxlb:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Setup dependencies for code linting
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install additional dependencies for code linting
run: |
sudo apt-get update
sudo apt-get -y install python3-pycodestyle pycodestyle
- name: Run code linting on ProxLB Python code
run: |
pycodestyle proxlb/* && \
echo "OK: Code linting successfully performed on ProxLB code."
build-package-debian:
needs: lint-code-proxlb
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Set up Docker with Debian image
run: |
docker pull debian:latest
- name: Build DEB package in Docker container
run: |
docker run --rm -v $(pwd):/workspace -w /workspace debian:latest bash -c "
# Install dependencies
apt-get update && \
apt-get install -y python3 python3-setuptools debhelper dh-python python3-pip python3-stdeb python3-proxmoxer python3-requests python3-urllib3 devscripts python3-all && \
# Get base version from source code
BASE_VERSION=\$(grep __version__ proxlb/utils/version.py | awk '{print \$3}' | tr -d '\"')
echo \"Base version: \$BASE_VERSION\"
# Build full version with timestamp
FULL_VERSION=\"\${BASE_VERSION}+$(date +%Y%m%d%H%M)\"
echo \"Full version: \$FULL_VERSION\"
# Update debian/changelog with new version
dch --force-bad-version -v \"\$FULL_VERSION\" \
\"Automated GitHub Actions build on $(date -u +'%Y-%m-%d %H:%M UTC').\" && \
# Build package using stdeb / setuptools
# python3 setup.py --command-packages=stdeb.command bdist_deb && \
# Build native package
dpkg-buildpackage -us -uc && \
mkdir package && \
mv ../*.deb package/ && \
echo 'OK: Debian package successfully created.'
"
- name: Upload Debian package python3-proxlb as artifact
uses: actions/upload-artifact@v4
with:
name: debian-package
path: package/*.deb
integration-test-debian:
needs: build-package-debian
runs-on: ubuntu-latest
strategy:
matrix:
debian_version: [bookworm, trixie]
name: Integration Test on Debian ${{ matrix.debian_version }}
steps:
- name: Download Debian package artifact
uses: actions/download-artifact@v4
with:
name: debian-package
path: package/
- name: Set up Docker with Debian image
run: docker pull debian:${{ matrix.debian_version }}
- name: Install and test Debian package in Docker container
run: |
docker run --rm \
-v "$(pwd)/package:/package" \
-w /package \
debian:${{ matrix.debian_version }} \
bash -c "
set -e
apt-get update
apt-get install -y python3 systemd
apt-get install -y ./proxlb*.deb
python3 -c 'import proxlb; print(\"OK: Debian package successfully installed on ${{ matrix.debian_version }}.\")'
"

View File

@@ -0,0 +1,96 @@
name: "Build package: .rpm"
on: [push]
jobs:
lint-code-proxlb:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Setup dependencies for code linting
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install additional dependencies for code linting
run: |
sudo apt-get update
sudo apt-get -y install python3-pycodestyle pycodestyle
- name: Run code linting on ProxLB Python code
run: |
pycodestyle proxlb/* && \
echo "OK: Code linting successfully performed on ProxLB code."
build-package-rpm:
needs: lint-code-proxlb
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
ref: 'development'
- name: Set up Docker with Debian image
run: |
docker pull debian:latest
- name: Build DEB package in Docker container
run: |
docker run --rm -v $(pwd):/workspace -w /workspace debian:latest bash -c "
# Install dependencies
apt-get update && \
apt-get install -y python3 python3-setuptools rpm debhelper dh-python python3-pip python3-stdeb python3-proxmoxer python3-requests python3-urllib3 && \
# Build package
python3 setup.py --command-packages=stdeb.command bdist_rpm && \
echo 'OK: RPM package successfully created.'
"
- name: Upload RPM package python3-proxlb as artifact
uses: actions/upload-artifact@v4
with:
name: rpm-package
path: dist/*.rpm
# integration-test-rpm-rockylinux-9:
# needs: build-package-rpm
# runs-on: ubuntu-latest
# steps:
# - name: Download RPM package artifact
# uses: actions/download-artifact@v4
# with:
# name: rpm-package
# path: dist/
# - name: Set up Docker with RockyLinux 9 image
# run: docker pull rockylinux:9
# - name: Install and test RPM package in Rocky Linux Docker container
# run: |
# docker run --rm -v $(pwd)/dist:/dist -w /dist rockylinux:9 bash -c "
# # DNF does not handle wildcards well
# rpm_file=\$(ls proxlb*.noarch.rpm) && \
# dnf install -y \$rpm_file && \
# python3 -c 'import proxlb; print(\"OK: RPM package successfully installed.\")'
# "
# integration-test-rpm-rockylinux-8:
# needs: build-package-rpm
# runs-on: ubuntu-latest
# steps:
# - name: Download RPM package artifact
# uses: actions/download-artifact@v4
# with:
# name: rpm-package
# path: dist/
# - name: Set up Docker with RockyLinux 8 image
# run: docker pull rockylinux:8
# - name: Install and test RPM package in Rocky Linux Docker container
# run: |
# docker run --rm -v $(pwd)/dist:/dist -w /dist rockylinux:8 bash -c "
# # DNF does not handle wildcards well
# rpm_file=\$(ls proxlb*.noarch.rpm) && \
# dnf install -y \$rpm_file && \
# python3 -c 'import proxlb; print(\"OK: RPM package successfully installed.\")'
# "

View File

@@ -0,0 +1,26 @@
name: "Build Container Image: AMD64"
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build amd64 image and save as tar
run: |
docker buildx build \
--platform linux/amd64 \
--load \
-t proxlb-image:amd64 \
.
docker save proxlb-image:amd64 -o proxlb_image_amd64.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: proxlb-image-amd64
path: proxlb_image_amd64.tar

View File

@@ -0,0 +1,26 @@
name: "Build Container Image: ARM64"
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build arm64 image and save as tar
run: |
docker buildx build \
--platform linux/arm64 \
--load \
-t proxlb-image:arm64 \
.
docker save proxlb-image:arm64 -o proxlb_image_arm64.tar
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: proxlb-image-arm64
path: proxlb_image_arm64.tar

View File

@@ -0,0 +1,23 @@
name: "Build Container Image: Multiarch"
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build multi-arch image and save as tar
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--output type=tar,dest=proxlb_image_multiarch.tar \
.
- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: proxlb-image-multiarch
path: proxlb_image_multiarch.tar

9
.gitignore vendored
View File

@@ -1,2 +1,7 @@
packaging/changelog-fragments-creator/
dev/
__pycache__
*.pyc
.DS_Store
build/
dist/
*.egg-info/
proxlb_dev.yaml

View File

@@ -5,13 +5,219 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.11] - 2026-01-12
### Added
- Add support for Proxmoxs native HA (affinity/anti-affinity) rules [beta] (@gyptazy). [#391]
- Add support for Proxmox native HA (node-affinity) rules for pinning guests to nodes [beta] (@gyptazy). [#391]
- Add resource reservation support for PVE nodes (@Chipmonk2). [#373]
- Add possibility to sort and select balancing workloads by smaller/larger guest objects (@gyptazy). [#387]
- Add HA job validation for migration jobs to fetch child jobs (@gytazy). [#402]
- Add support for configuring node-pinning strictness (default: true) within pools to allow strict/prefer modes (@gyptazy). [#406]
- Add new option to enforce node/guest pinning even when cluster is balanced from a resource perspective (@gyptazy). [#414]
### Fixed
- Fix missing overprovisioning safety guard to avoid node overprovisioning (@gyptazy). [#275]
- Fix affinity matrix pre-validation by inverting validations (@Thalagyrt). [#335]
- Fix pool based node pinning which expects a list (@gyptazy). [#395]
- Fix that ignored VMs/CTs got moved to another node when being ignored (@gyptazy). [#408]
### Changed
- Change balancing and sorting behaviour (@gyptazy). [#378]
- Balancing objects will be ordered by count of objects in affinity-rules, followed by memory size (@gyptazy). [#378]
## [1.1.10] - 2025-11-25
### Added
- Prevent redundant rebalancing by validating existing affinity enforcement before taking actions (@gyptazy). [#335]
- Add safety-guard for PVE 8 users when activating conntrack-aware migrations mistakenly (@gyptazy). [#359]
### Fixed
- Fix the Proxmox API connection validation which returned a false-positive logging message of timeouts (@gyptazy). [#361]
- Refactored Proxmox API connection functions (@gyptazy). [#361]
- Fix a crash during PVE resource pool enumeration by skipping members not having a 'name' property (@stefanoettl). [#368]
## [1.1.9.1] - 2025-10-30
### Fixed
- Fix quoting in f-strings which may cause issues on PVE 8 / Debian Bookworm systems (@gyptazy). [#352]
## [1.1.9] - 2025-10-30
### Added
- Add an optional memory balancing threshold (@gyptazy). [#342]
- Add affinity/anti-affinity support by pools (@gyptazy). [#343]
- Add pressure (PSI) based balancing for memory, cpu, disk (req. PVE9 or greater) (@gyptazy). [#337]
- Pressure (PSI) based balancing for nodes
- Pressure (PSI) based balancing for guests
- Add PVE version evaluation
## [1.1.8] - 2025-10-09
### Fixed
- Fix API errors when using conntrack aware migration with older PVE versions (@gyptazy). [#318]
- Add a static ProxLB prefix to the log output when used by journal handler (@gyptazy). [#329]
### Changed
- Container image does not run as root anymore (@mikaelkrantz945). [#317]
- Container image uses venv for running ProxLB (@mikaelkrantz945). [#317]
## [1.1.7] - 2025-09-19
### Added
- Add conntrack state aware migrations of VMs (@gyptazy). [#305]
- Add graceful shutdown for SIGINT (e.g., CTRL + C abort). (@gyptazy). [#304]
### Fixed
- Fix crash when validating absent migration job ids. (@gyptazy). [#308]
- Fix guest object names are not being evaluated in debug log. (@gyptazy). [#310]
## [1.1.6.1] - 2025-09-04
### Fixed
- Validate for node presence when pinning VMs to avoid crashing (@gyptazy). [#296]
## [1.1.6] - 2025-09-04
### Added
- Add validation for provided API user token id to avoid confusions (@gyptazy). [#291]
### Fixed
- Fix stacktrace output when validating permissions on non existing users in Proxmox (@gyptazy). [#291]
- Fix Overprovisioning first node if anti_affinity_group has only one member (@MiBUl-eu). [#295]
- Validate for node presence when pinning guests to avoid crashing (@gyptazy). [#296]
- Fix balancing evaluation of guest types (e.g., VM or CT) (@gyptazy). [#268]
## [1.1.5] - 2025-07-14
### Added
- Allow custom API ports instead of fixed tcp/8006 (@gyptazy). [#260]
## [1.1.4] - 2025-06-27
### Added
- Allow pinning of guests to a group of nodes (@gyptazy). [#245]
### Fixed
- Modified log levels to make output lighter at INFO level (@pmarasse) [#255]
- Fixed an issue where balancing was performed in combination of deactivated balancing and dry-run mode (@gyptazy). [#248]
## [1.1.3] - 2025-06-19
### Added
- Add relaod (SIGHUP) function to ProxLB to reload the configuration (by @gyptazy). [#189]
- Add optional wait time parameter to delay execution until the service takes action (by @gyptazy). [#239]
- Make the amount of parallel migrations configurable (by @gyptazy). [#241]
### Changed
- Use the average CPU consumption of a guest within the last 60 minutes instead of the current CPU usage (by @philslab-ninja & @gyptazy). [#94]
### Fixed
- Align maintenance mode with Proxmox HA maintenance mode (by @gyptazy). [#232]
## [1.1.2] - 2025-05-13
### Added
- Add a configurable retry mechanism when connecting to the Proxmox API (by @gyptazy) [#157]
- Add 1-to-1 relationships between guest and hypervisor node to ping a guest on a node (by @gyptazy) [#218]
### Fixed
- Force type cast cpu count of guests to int for some corner cases where a str got returned (by @gyptazy). [#222]
- Fix systemd unit file to run after network on non PVE nodes (by @robertdahlem) [#137]
## [1.1.1] - 2025-04-20
### Added
- Providing the API upstream error message when migration fails in debug mode (by @gyptazy) [#205]
### Changed
- Change the default behaviour of the daemon mode to active [#176]
- Change the default banalcing mode to used instead of assigned [#180]
### Fixed
- Set cpu_used to the cpu usage, which is a percent, times the total number of cores to get a number where guest cpu_used can be added to nodes cpu_used and be meaningful (by @glitchvern) [#195]
- Fix tag evluation for VMs for being ignored for further balancing [#163]
- Honor the value when balancing should not be performed and stop balancing [#174]
- allow the use of minutes instead of hours and only accept hours or minutes in the format (by @glitchvern) [#187]
- Remove hard coded memory usage from lowest usage node and use method and mode specified in configuration instead (by @glitchvern) [#197]
- Fix the guest type relationship in the logs when a migration job failed (by @gyptazy) [#204]
- Requery a guest if that running guest reports 0 cpu usage (by @glitchvern) [#200]
- Fix Python path for Docker entrypoint (by @crandler) [#170]
- Improve logging verbosity of messages that had a wrong servity [#165]
## [1.1.0] - 2025-04-01
### Fixed
- Refactored code base for ProxLB [#114]
- Switched to `pycodestyle` for linting [#114]
- Package building will be done within GitHub actions pipeline [#114]
- ProxLB now only returns a warning when no guests for further balancing are not present (instead of quitting) [132#]
- All nodes (according to the free resources) will be used now [#130]
- Fixed logging outputs where highest/lowest were mixed-up [#129]
- Stop balancing when movement would get worste (new force param to enfoce for affinity rules) [#128]
- Added requested documentation regarding Proxmox HA groups [#127]
- Rewrite of the whole affinity/anti-affinity rules evaluation and placement [#123]
- Fixed the `ignore` parameter for nodes where the node and guests on the node will be untouched [#102]
## [1.0.6] - 2024-12-24
### Fixed
- Fix maintenance mode when using cli arg and config mode by using the merged list (by @CartCaved). [#119]
- Fix that a scheduler time definition of 1 (int) gets wrongly interpreted as a bool (by @gyptazy). [#115]
## [1.0.5] - 2024-10-30
### Changed
- Change docs to make bool usage in configs more clear (by @gyptazy). [#104]
### Fixed
- Fix node (and its objects) evaluation when not reachable, e.g., maintenance (by @gyptazy). [#107]
- Fix migration from local disks (by @greenlogles). [#113]
- Fix evaluation of maintenance mode where comparing list & string resulted in a crash (by @glitchvern). [#106]
- Fix allowed values (add DEBUG, WARNING) for log verbosity (by @gyptazy). [#98]
## [1.0.4] - 2024-10-11
### Added
- Add feature to make API timeout configureable. [#91]
- Add maintenance mode to evacuate a node and move workloads for other nodes in the cluster. [#58]
- Add feature to make API timeout configureable. [#91]
- Add version output cli arg. [#89]
### Changed
@@ -29,27 +235,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Add storage balancing function. [#51]
- Add cli arg `-b` to return the next best node for next VM/CT placement. [#8]
- Add a convert function to cast all bool alike options from configparser to bools. [#53]
- Add a config parser options for future features. [#53]
- Add a config versio schema that must be supported by ProxLB. [#53]
- Add doc how to add dedicated user for authentication. (by @Dulux-Oz)
- Add feature to allow the API hosts being provided as a comma separated list. [#60]
- Add cli arg `-b` to return the next best node for next VM/CT placement. [#8]
- Add doc how to add dedicated user for authentication. (by @Dulux-Oz)
- Add storage balancing function. [#51]
### Changed
- Improve the underlying code base for future implementations. [#53]
- Provide a more reasonable output when HA services are not active in a Proxmox cluster. [#68]
- Improve the underlying code base for future implementations. [#53]
### Fixed
- Fixed `master_only` function by inverting the condition.
- Improved the overall validation and error handling. [#64]
- Fix bug in the `proxlb.conf` in the vm_balancing section.
- Fix anti-affinity rules not evaluating a new and different node. [#67]
- Fixed `master_only` function by inverting the condition.
- Fix documentation for the master_only parameter placed in the wrong config section. [#74]
- Fix bug in the `proxlb.conf` in the vm_balancing section.
- Fix handling of unset `ignore_nodes` and `ignore_vms` resulted in an attribute error. [#71]
- Improved the overall validation and error handling. [#64]
## [1.0.2] - 2024-08-13
@@ -72,16 +278,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Add option_mode to rebalance by node's free resources in percent (instead of bytes). [#29]
- Add LXC/Container integration. [#27]
- Add exclude grouping feature to rebalance VMs from being located together to new nodes. [#4]
- Add dry-run support to see what kind of rebalancing would be done. [#6]
- Add Docker/Podman support. [#10 by @daanbosch]
- Add feature to prevent VMs from being relocated by defining a wildcard pattern. [#7]
- Add feature to prevent VMs from being relocated by defining the 'plb_ignore_vm' tag. [#7]
- Add include grouping feature to rebalance VMs bundled to new nodes. [#3]
- Add feature to prevent VMs from being relocated by defining a wildcard pattern. [#7]
- Add Docker/Podman support. [#10 by @daanbosch]
- Add option to rebalance by assigned VM resources to avoid overprovisioning. [#16]
- Add feature to make log verbosity configurable [#17].
- Add dry-run support to see what kind of rebalancing would be done. [#6]
- Add LXC/Container integration. [#27]
- Add exclude grouping feature to rebalance VMs from being located together to new nodes. [#4]
- Add include grouping feature to rebalance VMs bundled to new nodes. [#3]
- Add option_mode to rebalance by node's free resources in percent (instead of bytes). [#29]
### Changed

View File

@@ -29,7 +29,7 @@ Before submitting a pull request, ensure that your changes sucessfully perform t
1. **Install pytest if you haven't already:**
```sh
pip install fake8
pip install flake8
```
2. **Run the lintin:**
@@ -116,6 +116,6 @@ By participating in this project, you agree to abide by our [Code of Conduct](CO
## Getting Help
If you need help or have any questions, feel free to reach out by creating an issue or by joining our [discussion forum](https://github.com/gyptazy/proxlb/discussions). You can also refer to our [documentation](https://github.com/gyptazy/ProxLB/tree/main/docs) for more information about the project or join our [chat room](https://matrix.to/#/#proxlb:gyptazy.ch) in Matrix.
If you need help or have any questions, feel free to reach out by creating an issue or by joining our [discussion forum](https://github.com/gyptazy/proxlb/discussions). You can also refer to our [documentation](https://github.com/gyptazy/ProxLB/tree/main/docs) for more information about the project or join our [chat room](https://matrix.to/#/#proxlb:gyptazy.com) in Matrix.
Thank you for contributing to ProxLB! Together, we can enhance the efficiency and performance of Proxmox clusters.

View File

@@ -1,35 +1,41 @@
# Use the official Debian 12 base image
FROM debian:12
# Use the latest Alpine image
FROM alpine:latest
# Labels
LABEL maintainer="gyptazy@gyptazy.ch"
LABEL org.label-schema.schema-version="0.9"
LABEL org.label-schema.description="ProxLB - Rebalance VM workloads across nodes in a Proxmox cluster."
LABEL org.label-schema.url="https://github.com/gyptazy/ProxLB"
LABEL maintainer="gyptazy@gyptazy.com"
LABEL org.label-schema.name="ProxLB"
LABEL org.label-schema.description="ProxLB - An advanced load balancer for Proxmox clusters."
LABEL org.label-schema.vendor="gyptazy"
LABEL org.label-schema.url="https://proxlb.de"
LABEL org.label-schema.vcs-url="https://github.com/gyptazy/ProxLB"
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# --- Step 1 (root): system deps, user, dirs ---
RUN apk add --no-cache python3 py3-pip \
&& addgroup -S plb \
&& adduser -S -G plb -h /home/plb plb \
&& mkdir -p /app/conf /opt/venv \
&& chown -R plb:plb /app /home/plb /opt/venv
# Install python3 and python3-venv
RUN apt-get update && \
apt-get install -y python3 python3-pip python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create a directory for the app
WORKDIR /app
# Copy the python program from the current directory to /app
COPY proxlb /app/proxlb
# Copy only requirements first for better layer caching
COPY --chown=plb:plb requirements.txt /app/requirements.txt
# Create a virtual environment
RUN python3 -m venv venv
# --- Step 2 (appuser): venv + deps + code ---
USER plb
# Copy requirements to the container
COPY requirements.txt /app/requirements.txt
# Create venv owned by appuser and put it on PATH
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
# Install dependencies in the virtual environment
RUN . venv/bin/activate && pip install -r /app/requirements.txt
# Install Python dependencies into the venv (no PEP 668 issues)
RUN pip install --no-cache-dir -r /app/requirements.txt
# Set the entry point to use the virtual environment's python
ENTRYPOINT ["/app/venv/bin/python3", "/app/proxlb"]
# Copy application code (owned by appuser)
COPY --chown=plb:plb proxlb /app/proxlb
# Optional: placeholder config so a bind-mount can override cleanly
RUN touch /app/conf/proxlb.yaml
# Run as non-root using venv Python
ENTRYPOINT ["/opt/venv/bin/python", "/app/proxlb/main.py"]

View File

@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

400
README.md
View File

@@ -1,397 +1,7 @@
# ProxLB - (Re)Balance VM Workloads in Proxmox Clusters
<img align="left" src="https://cdn.gyptazy.com/images/Prox-LB-logo.jpg"/>
<br>
# ProxLB Moved
<p float="center"><img src="https://img.shields.io/github/license/gyptazy/ProxLB"/><img src="https://img.shields.io/github/contributors/gyptazy/ProxLB"/><img src="https://img.shields.io/github/last-commit/gyptazy/ProxLB/main"/><img src="https://img.shields.io/github/issues-raw/gyptazy/ProxLB"/><img src="https://img.shields.io/github/issues-pr/gyptazy/ProxLB"/></p>
You can find the new location of the `ProxLB` project at:
[github.com/credativ/ProxLB](https://github.com/credativ/ProxLB)
## Table of Contents
- [ProxLB - (Re)Balance VM Workloads in Proxmox Clusters](#proxlb---rebalance-vm-workloads-in-proxmox-clusters)
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Video of Migration](#video-of-migration)
- [Features](#features)
- [How does it work?](#how-does-it-work)
- [Usage](#usage)
- [Dependencies](#dependencies)
- [Options](#options)
- [Notes](#notes)
- [Parameters](#parameters)
- [Balancing](#balancing)
- [General](#general)
- [By Used Memory of VMs/CTs](#by-used-memory-of-vmscts)
- [By Assigned Memory of VMs/CTs](#by-assigned-memory-of-vmscts)
- [Storage Balancing](#storage-balancing)
- [Affinity Rules / Grouping Relationships](#affinity-rules--grouping-relationships)
- [Affinity (Stay Together)](#affinity-stay-together)
- [Anti-Affinity (Keep Apart)](#anti-affinity-keep-apart)
- [Ignore VMs (Tag Style)](#ignore-vms-tag-style)
- [Systemd](#systemd)
- [Manual](#manual)
- [Proxmox GUI Integration](#proxmox-gui-integration)
- [Quick Start](#quick-start)
- [Container Quick Start (Docker/Podman)](#container-quick-start-dockerpodman)
- [Logging](#logging)
- [Motivation](#motivation)
- [References](#references)
- [Downloads](#downloads)
- [Packages](#packages)
- [Repository](#repository)
- [Stable Releases](#stable-releases)
- [Beta/Testing Releases](#betatesting-releases)
- [Container Images (Docker/Podman)](#container-images-dockerpodman)
- [Misc](#misc)
- [Bugs](#bugs)
- [Contributing](#contributing)
- [Documentation](#documentation)
- [Support](#support)
- [Author(s)](#authors)
## Introduction
`ProxLB` (PLB) is an advanced tool designed to enhance the efficiency and performance of Proxmox clusters by optimizing the distribution of virtual machines (VMs) or Containers (CTs) across the cluster nodes by using the Proxmox API. ProxLB meticulously gathers and analyzes a comprehensive set of resource metrics from both the cluster nodes and the running VMs. These metrics include CPU usage, memory consumption, and disk utilization, specifically focusing on local disk resources.
PLB collects resource usage data from each node in the Proxmox cluster, including CPU, (local) disk and memory utilization. Additionally, it gathers resource usage statistics from all running VMs, ensuring a granular understanding of the cluster's workload distribution.
Intelligent rebalancing is a key feature of ProxLB where it re-balances VMs based on their memory, disk or CPU usage, ensuring that no node is overburdened while others remain underutilized. The rebalancing capabilities of PLB significantly enhance cluster performance and reliability. By ensuring that resources are evenly distributed, PLB helps prevent any single node from becoming a performance bottleneck, improving the reliability and stability of the cluster. Efficient rebalancing leads to better utilization of available resources, potentially reducing the need for additional hardware investments and lowering operational costs.
Automated rebalancing reduces the need for manual actions, allowing operators to focus on other critical tasks, thereby increasing operational efficiency.
### Video of Migration
<img src="https://cdn.gyptazy.com/images/proxlb-rebalancing-demo.gif"/>
## Features
* Rebalance VMs/CTs in the cluster by:
* Memory
* Disk (only local storage)
* CPU
* Rebalance Storage in the cluster
* Rebalance VMs/CTs disks to other storage pools
* Rebalance by used storage
* Get best Node for new VM/CT placement in cluster
* Performing
* Periodically
* One-shot solution
* Types
* Rebalance only VMs
* Rebalance only CTs
* Rebalance all (VMs and CTs)
* Rebalance VM/CT disks (Storage)
* Filter
* Exclude nodes
* Exclude virtual machines
* Grouping
* Include groups (VMs that are rebalanced to nodes together)
* Exclude groups (VMs that must run on different nodes)
* Ignore groups (VMs that should be untouched)
* Dry-run support
* Human readable output in CLI
* JSON output for further parsing
* Migrate VM workloads away (e.g. maintenance preparation)
* Fully based on Proxmox API
* Usage
* One-Shot (one-shot)
* Periodically (daemon)
* Proxmox Web GUI Integration (optional)
## How does it work?
ProxLB is a load-balancing system designed to optimize the distribution of virtual machines (VMs) and containers (CTs) across a cluster. It works by first gathering resource usage metrics from all nodes in the cluster through the Proxmox API. This includes detailed resource metrics for each VM and CT on every node. ProxLB then evaluates the difference between the maximum and minimum resource usage of the nodes, referred to as "Balanciness." If this difference exceeds a predefined threshold (which is configurable), the system initiates the rebalancing process.
Before starting any migrations, ProxLB validates that rebalancing actions are necessary and beneficial. Depending on the selected balancing mode — such as CPU, memory, or disk — it creates a balancing matrix. This matrix sorts the VMs by their maximum used or assigned resources, identifying the VM with the highest usage. ProxLB then places this VM on the node with the most free resources in the selected balancing type. This process runs recursively until the operator-defined Balanciness is achieved. Balancing can be defined for the used or max. assigned resources of VMs/CTs.
## Usage
Running PLB is easy and it runs almost everywhere since it just depends on `Python3` and the `proxmoxer` library. Therefore, it can directly run on a Proxmox node, dedicated systems like Debian, RedHat, or even FreeBSD, as long as the API is reachable by the client running PLB.
### Dependencies
* Python3
* proxmoxer (Python module)
### Options
The following options can be set in the `proxlb.conf` file:
| Section | Option | Example | Description |
|------|:------:|:------:|:------:|
| `proxmox` | api_host | hypervisor01.gyptazy.com | Host or IP address (or comma separated list) of the remote Proxmox API. |
| | api_user | root@pam | Username for the API. |
| | api_pass | FooBar | Password for the API. |
| | verify_ssl | 1 | Validate SSL certificates (1) or ignore (0). (default: 1) |
| | timeout | 10 | Timeout for the Proxmox API in sec. (default: 10) |
| `vm_balancing` | enable | 1 | Enables VM/CT balancing. |
| | method | memory | Defines the balancing method (default: memory) where you can use `memory`, `disk` or `cpu`. |
| | mode | used | Rebalance by `used` resources (efficiency) or `assigned` (avoid overprovisioning) resources. (default: used)|
| | mode_option | byte | Rebalance by node's resources in `bytes` or `percent`. (default: bytes) |
| | type | vm | Rebalance only `vm` (virtual machines), `ct` (containers) or `all` (virtual machines & containers). (default: vm)|
| | balanciness | 10 | Value of the percentage of lowest and highest resource consumption on nodes may differ before rebalancing. (default: 10) |
| | parallel_migrations | 1 | Defines if migrations should be done parallely or sequentially. (default: 1) |
| | maintenance_nodes | dummynode03,dummynode04 | Defines a comma separated list of nodes to set them into maintenance mode and move VMs/CTs to other nodes. |
| | ignore_nodes | dummynode01,dummynode02,test* | Defines a comma separated list of nodes to exclude. |
| | ignore_vms | testvm01,testvm02 | Defines a comma separated list of VMs to exclude. (`*` as suffix wildcard or tags are also supported) |
| `storage_balancing` | enable | 0 | Enables storage balancing. |
| | balanciness | 10 | Value of the percentage of lowest and highest storage consumption may differ before rebalancing. (default: 10) |
| | parallel_migrations | 1 | Defines if migrations should be done parallely or sequentially. (default: 1) |
| `update_service` | enable | 0 | Enables the automated update service (rolling updates). |
| `api` | enable | 0 | Enables the ProxLB API. |
| `service`| daemon | 1 | Run as a daemon (1) or one-shot (0). (default: 1) |
| | schedule | 24 | Hours to rebalance in hours. (default: 24) |
| | master_only | 0 | Defines is this should only be performed (1) on the cluster master node or not (0). (default: 0) |
| | log_verbosity | INFO | Defines the log level (default: CRITICAL) where you can use `INFO`, `WARN` or `CRITICAL` |
| | config_version | 3 | Defines the current config version schema for ProxLB |
An example of the configuration file looks like:
```
[proxmox]
api_host: hypervisor01.gyptazy.com
api_user: root@pam
api_pass: FooBar
verify_ssl: 1
timeout: 10
[vm_balancing]
enable: 1
method: memory
mode: used
type: vm
# Balanciness defines how much difference may be
# between the lowest & highest resource consumption
# of nodes before rebalancing will be done.
# Examples:
# Rebalancing: node01: 41% memory consumption :: node02: 52% consumption
# No rebalancing: node01: 43% memory consumption :: node02: 50% consumption
balanciness: 10
# Enable parallel migrations. If set to 0 it will wait for completed migrations
# before starting next migration.
parallel_migrations: 1
maintenance_nodes: dummynode03,dummynode04
ignore_nodes: dummynode01,dummynode02
ignore_vms: testvm01,testvm02
[storage_balancing]
enable: 0
[update_service]
enable: 0
[api]
enable: 0
[service]
# The master_only option might be useful if running ProxLB on all nodes in a cluster
# but only a single one should do the balancing. The master node is obtained from the Proxmox
# HA status.
master_only: 0
daemon: 1
config_version: 3
```
#### Notes
* If running ProxLB on more than one Proxmox node you can set `api_host` to a comma-separated list of each node's IP address or hostname. (Example: `api_host: node01.gyptazy.com,node02.gyptazy.com,node03.gyptazy.com`)
* The `verify_ssl` parameter can switch between the mode to verify trusted remote certificates. Keep in mind, that even local ones are **not** trusted by default and need to be imported to the truststore.
* Even when using only the `vm_balancing` mode, ensure to have the other sections listed in your config:
```
[storage_balancing]
enable: 0
[update_service]
enable: 0
[api]
enable: 0
```
### Parameters
The following options and parameters are currently supported:
| Option | Long Option | Description | Default |
|------|:------:|------:|------:|
| -c | --config | Path to a config file. | /etc/proxlb/proxlb.conf (default) |
| -d | --dry-run | Performs a dry-run without doing any actions. | Unset |
| -j | --json | Returns a JSON of the VM movement. | Unset |
| -b | --best-node | Returns the best next node for a VM/CT placement (useful for further usage with Terraform/Ansible). | Unset |
| -m | --maintenance | Sets node(s) to maintenance mode & moves workloads away. | Unset |
| -v | --version | Returns the ProxLB version on stdout. | Unset |
### Balancing
#### General
In general, virtual machines (VMs), containers (CTs) can be rebalanced and moved around nodes or shared storage (storage balancing) in the cluster. Often, this also works without downtime without any further downtimes. However, this does **not** work with containers. LXC based containers will be shutdown, copied and started on the new node. Also to note, live migrations can work fluently without any issues but there are still several things to be considered. This is out of scope for ProxLB and applies in general to Proxmox and your cluster setup. You can find more details about this here: https://pve.proxmox.com/wiki/Migrate_to_Proxmox_VE.
#### By Used Memory of VMs/CTs
By continuously monitoring the current resource usage of VMs, ProxLB intelligently reallocates workloads to prevent any single node from becoming overloaded. This approach ensures that resources are balanced efficiently, providing consistent and optimal performance across the entire cluster at all times. To activate this balancing mode, simply activate the following option in your ProxLB configuration:
```
mode: used
```
Afterwards, restart the service (if running in daemon mode) to activate this rebalancing mode.
#### By Assigned Memory of VMs/CTs
By ensuring that resources are always available for each VM, ProxLB prevents over-provisioning and maintains a balanced load across all nodes. This guarantees that users have consistent access to the resources they need. However, if the total assigned resources exceed the combined capacity of the cluster, ProxLB will issue a warning, indicating potential over-provisioning despite its best efforts to balance the load. To activate this balancing mode, simply activate the following option in your ProxLB configuration:
```
mode: assigned
```
Afterwards, restart the service (if running in daemon mode) to activate this rebalancing mode.
#### Storage Balancing
Starting with ProxLB 1.0.3, ProxLB also supports the balancing of underlying shared storage. In this case, all attached disks (`rootfs` in a context of a CT) of a VM or CT are being fetched and evaluated. If a VM has multiple disks attached, the disks can also be distributed over different storages. As a result, only shared storage is supported. Non shared storage would require to move the whole VM including all attached disks to the parent's node local storage.
Limitations:
* Only shared storage
* Only supported for the following VM disk types:
* ide (only disks, not CD)
* nvme
* scsi
* virtio
* sata
* rootfs (Container)
*Note: Storage balancing is currently in beta and should be used carefully.*
### Affinity Rules / Grouping Relationships
#### Affinity (Stay Together)
<img align="left" src="https://cdn.gyptazy.com/images/plb-rebalancing-include-balance-group.jpg"/> Access the Proxmox Web UI by opening your web browser and navigating to your Proxmox VE web interface, then log in with your credentials. Navigate to the VM you want to tag by selecting it from the left-hand navigation panel. Click on the "Options" tab to view the VM's options, then select "Edit" or "Add" (depending on whether you are editing an existing tag or adding a new one). In the tag field, enter plb_include_ followed by your unique identifier, for example, plb_include_group1. Save the changes to apply the tag to the VM. Repeat these steps for each VM that should be included in the group.
#### Anti-Affinity (Keep Apart)
<img align="left" src="https://cdn.gyptazy.com/images/plb-rebalancing-exclude-balance-group.jpg"/> Access the Proxmox Web UI by opening your web browser and navigating to your Proxmox VE web interface, then log in with your credentials. Navigate to the VM you want to tag by selecting it from the left-hand navigation panel. Click on the "Options" tab to view the VM's options, then select "Edit" or "Add" (depending on whether you are editing an existing tag or adding a new one). In the tag field, enter plb_exclude_ followed by your unique identifier, for example, plb_exclude_critical. Save the changes to apply the tag to the VM. Repeat these steps for each VM that should be excluded from being on the same node.
#### Ignore VMs (Tag Style)
<img align="left" src="https://cdn.gyptazy.com/images/plb-rebalancing-ignore-vm.jpg"/> In Proxmox, you can ensure that certain VMs are ignored during the rebalancing process by setting a specific tag within the Proxmox Web UI, rather than solely relying on configurations in the ProxLB config file. This can be achieved by adding the tag 'plb_ignore_vm' to the VM. Once this tag is applied, the VM will be excluded from any further rebalancing operations, simplifying the management process.
### Systemd
When installing a Linux distribution (such as .deb or .rpm) file, this will be shipped with a systemd unit file. The default configuration file will be sourced from `/etc/proxlb/proxlb.conf`.
| Unit Name | Options |
|------|:------:|
| proxlb | start, stop, status, restart |
### Manual
A manual installation is possible and also supports BSD based systems. Proxmox Rebalancing Service relies on mainly two important files:
* proxlb (Python Executable)
* proxlb.conf (Config file)
The executable must be able to read the config file, if no dedicated config file is given by the `-c` argument, PLB tries to read it from `/etc/proxlb/proxlb.conf`.
### Proxmox GUI Integration
<img align="left" src="https://cdn.gyptazy.com/images/proxlb-GUI-integration.jpg"/> PLB can also be directly be used from the Proxmox Web UI by installing the optional package `pve-proxmoxlb-service-ui` package which has a dependency on the `proxlb` package. For the Web UI integration, it requires to be installed (in addition) on the nodes on the cluster. Afterwards, a new menu item is present in the HA chapter called `Rebalancing`. This chapter provides two possibilities:
* Rebalancing VM workloads
* Migrate VM workloads away from a defined node (e.g. maintenance preparation)
### Quick Start
The easiest way to get started is by using the ready-to-use packages that I provide on my CDN and to run it on a Linux Debian based system. This can also be one of the Proxmox nodes itself.
```
wget https://cdn.gyptazy.com/files/os/debian/proxlb/proxlb_1.0.4_amd64.deb
dpkg -i proxlb_1.0.4_amd64.deb
# Adjust your config
vi /etc/proxlb/proxlb.conf
systemctl restart proxlb
systemctl status proxlb
```
### Container Quick Start (Docker/Podman)
Creating a container image of ProxLB is straightforward using the provided Dockerfile. The Dockerfile simplifies the process by automating the setup and configuration required to get ProxLB running in a container. Simply follow the steps in the Dockerfile to build the image, ensuring all dependencies and configurations are correctly applied. For those looking for an even quicker setup, a ready-to-use ProxLB container image is also available, eliminating the need for manual building and allowing for immediate deployment.
```bash
git clone https://github.com/gyptazy/ProxLB.git
cd ProxLB
docker build -t proxlb .
```
Afterwards simply adjust the config file to your needs:
```
vi /etc/proxlb/proxlb.conf
```
Finally, start the created container.
```bash
docker run -it --rm -v $(pwd)/proxlb.conf:/etc/proxlb/proxlb.conf proxlb
```
### Logging
ProxLB uses the `SystemdHandler` for logging. You can find all your logs in your systemd unit log or in the `journalctl`. In default, ProxLB only logs critical events. However, for further understanding of the balancing it might be useful to change this to `INFO` or `DEBUG` which can simply be done in the [proxlb.conf](https://github.com/gyptazy/ProxLB/blob/main/proxlb.conf#L14) file by changing the `log_verbosity` parameter.
Available logging values:
| Verbosity | Description |
|------|:------:|
| DEBUG | This option logs everything and is needed for debugging the code. |
| INFO | This option provides insides behind the scenes. What/why has been something done and with which values. |
| WARNING | This option provides only warning messages, which might be a problem in general but not for the application itself. |
| CRITICAL | This option logs all critical events that will avoid running ProxLB. |
## Motivation
As a developer managing a cluster of virtual machines for my projects, I often encountered the challenge of resource imbalance. Nodes within the cluster would become unevenly loaded, with some nodes being overburdened while others remained underutilized. This imbalance led to inefficiencies, performance bottlenecks, and increased operational costs. Frustrated by the lack of an adequate solution to address this issue, I decided to develop the ProxLB (PLB) to ensure better resource distribution across my clusters.
My primary motivation for creating PLB stemmed from my work on my BoxyBSD project, where I consistently faced the difficulty of maintaining balanced nodes while running various VM workloads but also on my personal clusters. The absence of an efficient rebalancing mechanism made it challenging to achieve optimal performance and stability. Recognizing the necessity for a tool that could gather and analyze resource metrics from both the cluster nodes and the running VMs, I embarked on developing ProxLB.
PLB meticulously collects detailed resource usage data from each node in a Proxmox cluster, including CPU load, memory usage, and local disk space utilization. It also gathers comprehensive statistics from all running VMs, providing a granular understanding of the workload distribution. With this data, PLB intelligently redistributes VMs based on memory usage, local disk usage, and CPU usage. This ensures that no single node is overburdened, storage resources are evenly distributed, and the computational load is balanced, enhancing overall cluster performance.
As an advocate of the open-source philosophy, I believe in the power of community and collaboration. By sharing solutions like PLB, I aim to contribute to the collective knowledge and tools available to developers facing similar challenges. Open source fosters innovation, transparency, and mutual support, enabling developers to build on each other's work and create better solutions together.
Developing PLB was driven by a desire to solve a real problem I faced in my projects. However, the spirit behind this effort was to provide a valuable resource to the community. By open-sourcing PLB, I hope to help other developers manage their clusters more efficiently, optimize their resource usage, and reduce operational costs. Sharing this solution aligns with the core principles of open source, where the goal is not only to solve individual problems but also to contribute to the broader ecosystem.
## References
Here you can find some overviews of references for and about the ProxLB (PLB):
| Description | Link |
|------|:------:|
| General introduction into ProxLB | https://gyptazy.com/blog/proxlb-rebalancing-vm-workloads-across-nodes-in-proxmox-clusters/ |
| Howto install and use ProxLB on Debian to rebalance vm workloads in a Proxmox cluster | https://gyptazy.com/howtos/howto-install-and-use-proxlb-to-rebalance-vm-workloads-across-nodes-in-proxmox-clusters/ |
## Downloads
ProxLB can be obtained in man different ways, depending on which use case you prefer. You can use simply copy the code from GitHub, use created packages for Debian or RedHat based systems, use a Repository to keep ProxLB always up to date or simply use a Container image for Docker/Podman.
### Packages
Ready to use packages can be found at:
* https://cdn.gyptazy.com/files/os/debian/proxlb/
* https://cdn.gyptazy.com/files/os/ubuntu/proxlb/
* https://cdn.gyptazy.com/files/os/redhat/proxlb/
### Repository
Debian based systems can also use the repository by adding the following line to their apt sources:
#### Stable Releases
```
deb https://repo.gyptazy.com/stable /
```
#### Beta/Testing Releases
```
deb https://repo.gyptazy.com/testing /
```
The Repository's GPG key can be found at: `https://repo.gyptazy.com/repository.gpg`
You can also simply import it by running:
```
# KeyID: 17169F23F9F71A14AD49EDADDB51D3EB01824F4C
# UID: gyptazy Solutions Repository <contact@gyptazy.com>
# SHA256: 52c267e6f4ec799d40cdbdb29fa518533ac7942dab557fa4c217a76f90d6b0f3 repository.gpg
wget -O /etc/apt/trusted.gpg.d/proxlb.asc https://repo.gyptazy.com/repository.gpg
```
*Note: The defined repositories `repo.gyptazy.com` and `repo.proxlb.de` are the same!*
### Container Images (Docker/Podman)
Container Images for Podman, Docker etc., can be found at:
| Version | Image |
|------|:------:|
| latest | cr.gyptazy.com/proxlb/proxlb:latest |
| v1.0.4 | cr.gyptazy.com/proxlb/proxlb:v1.0.4 |
| v1.0.3 | cr.gyptazy.com/proxlb/proxlb:v1.0.3 |
| v1.0.2 | cr.gyptazy.com/proxlb/proxlb:v1.0.2 |
| v1.0.0 | cr.gyptazy.com/proxlb/proxlb:v1.0.0 |
| v0.9.9 | cr.gyptazy.com/proxlb/proxlb:v0.9.9 |
## Misc
### Bugs
Bugs can be reported via the GitHub issue tracker [here](https://github.com/gyptazy/ProxLB/issues). You may also report bugs via email or deliver PRs to fix them on your own. Therefore, you might also see the contributing chapter.
### Contributing
Feel free to add further documentation, to adjust already existing one or to contribute with code. Please take care about the style guide and naming conventions. You can find more in our [CONTRIBUTING.md](https://github.com/gyptazy/ProxLB/blob/main/CONTRIBUTING.md) file.
### Documentation
You can also find additional and more detailed documentation within the [docs/](https://github.com/gyptazy/ProxLB/tree/main/docs) directory.
### Support
If you need assistance or have any questions, we offer support through our dedicated [chat room](https://matrix.to/#/#proxlb:gyptazy.com) in Matrix and on Reddit. Join our community for real-time help, advice, and discussions. Connect with us in our dedicated chat room for immediate support and live interaction with other users and developers. You can also visit our [GitHub Community](https://github.com/gyptazy/ProxLB/discussions/) to post your queries, share your experiences, and get support from fellow community members and moderators. You may also just open directly an issue [here](https://github.com/gyptazy/ProxLB/issues) on GitHub. We are here to help and ensure you have the best experience possible.
| Support Channel | Link |
|------|:------:|
| Matrix | [#proxlb:gyptazy.com](https://matrix.to/#/#proxlb:gyptazy.com) |
| GitHub Community | [GitHub Community](https://github.com/gyptazy/ProxLB/discussions/)
| GitHub | [ProxLB GitHub](https://github.com/gyptazy/ProxLB/issues) |
### Author(s)
* Florian Paul Azim Hoberg @gyptazy (https://gyptazy.com)
## Reasons
You can find more details about this in [my blog post](https://gyptazy.com/blog/proxlb-project-handover-to-credativ/).

View File

@@ -0,0 +1,89 @@
proxmox_api:
hosts: ['virt01.example.com', '10.10.10.10', 'fe01:bad:code::cafe']
user: root@pam
pass: crazyPassw0rd!
# API Token method
# token_id: proxlb
# token_secret: 430e308f-1337-1337-beef-1337beefcafe
ssl_verification: True
timeout: 10
# API Connection retries
# retries: 1
# wait_time: 1
proxmox_cluster:
maintenance_nodes: ['virt66.example.com']
ignore_nodes: []
overprovisioning: True
balancing:
enable: True
enforce_affinity: False
enforce_pinning: False
parallel: False
# If running parallel job, you can define
# the amount of prallel jobs (default: 5)
parallel_jobs: 1
live: True
with_local_disks: True
with_conntrack_state: True
balance_types: ['vm', 'ct'] # 'vm' | 'ct'
max_job_validation: 1800 # Maximum time (in seconds) a job validation may take
memory_threshold: 75 # Optional: Maximum threshold (in percent) to trigger balancing actions
balanciness: 5 # Maximum delta of resource usage between highest and lowest usage node
method: memory # 'memory' | 'cpu' | 'disk'
mode: used # 'assigned' | 'used' | 'psi'
balance_larger_guests_first: False # Option to prioritize balancing of larger or smaller guests first
node_resource_reserve: # Optional: Define resource reservations for nodes (in GB)
defaults: # Default reservation values applying to all nodes (unless explicitly overridden)
memory: 4 # Default: 4 GB memory reserved per node
node01: # Specific node reservation override for node 'node01'
memory: 6 # Specific: 6 GB memory reserved for node 'node01'
# # PSI thresholds only apply when using mode 'psi'
# psi:
# nodes:
# memory:
# pressure_full: 0.20
# pressure_some: 0.20
# pressure_spikes: 1.00
# cpu:
# pressure_full: 0.20
# pressure_some: 0.20
# pressure_spikes: 1.00
# disk:
# pressure_full: 0.20
# pressure_some: 0.20
# pressure_spikes: 1.00
# guests:
# memory:
# pressure_full: 0.20
# pressure_some: 0.20
# pressure_spikes: 1.00
# cpu:
# pressure_full: 0.20
# pressure_some: 0.20
# pressure_spikes: 1.00
# disk:
# pressure_full: 0.20
# pressure_some: 0.20
# pressure_spikes: 1.00
pools: # Optional: Define affinity/anti-affinity rules per pool
dev: # Pool name: dev
type: affinity # Type: affinity (keeping VMs together)
de-nbg01-db: # Pool name: de-nbg01-db
type: anti-affinity # Type: anti-affinity (spreading VMs apart)
pin: # Define a pinning og guests to specific node(s)
- virt66
- virt77
strict: False # Disable strict mode of node pinning for this pool
service:
daemon: True
schedule:
interval: 12
format: hours
delay:
enable: False
time: 1
format: hours
log_level: INFO

127
debian/changelog vendored Normal file
View File

@@ -0,0 +1,127 @@
proxlb (1.1.11) stable; urgency=medium
* Add support for native Proxmox HA/Affinity rules. (Closes: #391)
* Add safety guard to avoid node overprovisioning. (Closes: #275)
* Fix affinity rules pre-validation (avoid rebalancing if already ensured). (Closes: #335)
* Add resource reservation support for PVE nodes. (Closes: #373)
* Change/Adjust balancing and sorting behaviour. (Closes: #378)
* Add control over balancing workloads by prefering smaller/larger guest objects. (Closes: #387)
* Fix pinning of guest and node relations when using pool based pinning. (Closes: #395)
* Add validation of HA jobs by fetching the related child jobs. (Closes: #402)
* Add support for configuring node-pinning strictness (mode: strict/prefer). (Closes: #406)
* Fix that tag based ignored guests got still moved. (Closes: #408)
* Add parameter to enforce guest node relationships when pinned even when the cluster is balanced. (Closes: #414)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Mon, 12 Jan 2026 11:11:04 +0001
proxlb (1.1.10) stable; urgency=medium
* Prevent redundant rebalancing by validating existing affinity enforcement before taking actions. (Closes: #335)
* Add safety-guard for PVE 8 users when activating conntrack-aware migrations mistakenly. (Closes: #359)
* Fix the Proxmox API connection validation which returned a false-positive logging message of timeouts. (Closes: #361)
* Refactored the whole Proxmox API connection function. (Closes: #361)
* Fix a crash during PVE resource pool enumeration by skipping members not having a 'name' property. (Closes: #368)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Tue, 25 Nov 2025 09:12:04 +0001
proxlb (1.1.9.1) stable; urgency=medium
* Fix quoting in f-strings which may cause issues on PVE 8 / Debian Bookworm systems. (Closes: #352)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 30 Oct 2025 17:41:02 +0001
proxlb (1.1.9) stable; urgency=medium
* Add pressure (PSI) based balancing for memory, cpu, disk (req. PVE9 or greater). (Closes: #339)
* Add (memory) threshold for nodes before running balancing. (Closes: #342)
* Add affinity/anti-affinity support by pools. (Closes: #343)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 30 Oct 2025 06:58:43 +0001
proxlb (1.1.8) stable; urgency=medium
* Fix API errors when using conntrack aware migration with older PVE version. (Closes: #318)
* Add a static ProxLB prefix to the log output when used by journal handler. (Closes: #329)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 09 Oct 2025 09:04:13 +0002
proxlb (1.1.7) stable; urgency=medium
* Add conntrack state aware migrations of VMs. (Closes: #305)
* Add graceful shutdown for SIGINT command. (Closes: #304)
* Fix crash when validating absent migration job ids. (Closes: #308)
* Fix guest object names are not being evaluated in debug log. (Closes: #310)
* Note: Have a great Dutch Proxmox Day 2025!
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 04 Sep 2025 19:23:51 +0000
proxlb (1.1.6.1) stable; urgency=medium
* Validate for node presence when pinning VMs to avoid crashing. (Closes: #296)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 04 Sep 2025 19:23:51 +0000
proxlb (1.1.6) stable; urgency=medium
* Add validation for provided API user token id to avoid confusions. (Closes: #291)
* Fix stacktrace output when validating permissions on non existing users in Proxmox. (Closes: #291)
* Fix Overprovisioning first node if anti_affinity_group has only one member. (Closes: #295)
* Validate for node presence when pinning guests to avoid crashing. (Closes: #296)
* Fix balancing evaluation of guest types (e.g., VM or CT). (Closes: #268)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 04 Sep 2025 05:12:19 +0000
proxlb (1.1.5) stable; urgency=medium
* Allow custom API ports instead of fixed tcp/8006. (Closes: #260)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Mon, 14 Jul 2025 11:07:34 +0000
proxlb (1.1.4) stable; urgency=medium
* Allow pinning of guests to a group of nodes. (Closes: #245)
* Modified log levels to make output lighter at INFO level. (Closes: #255)
* ixed an issue where balancing was performed in combination of deactivated balancing and dry-run mode. (Closes: #248)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Fri, 27 Jun 2025 16:22:58 +0000
proxlb (1.1.3) stable; urgency=medium
* Add relaod (SIGHUP) function to ProxLB to reload the configuration. (Closes: #189)
* Add optional wait time parameter to delay execution until the service takes action. (Closes: #239)
* Make the amount of parallel migrations configurable. (Closes: #241)
* Use the average CPU consumption of a guest within the last 60 minutes instead of the current CPU usage. (Closes: #94)
* Align maintenance mode with Proxmox HA maintenance mode. (Closes: #232)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Thu, 19 Jun 2025 09:10:43 +0000
proxlb (1.1.2) stable; urgency=medium
* Add a configurable retry mechanism when connecting to the Proxmox API. (Closed: #157)
* Add 1-to-1 relationships between guest and hypervisor node to ping a guest on a node. (Closes #218)
* Force type cast cpu count of guests to int for some corner cases where a str got returned. (Closed #222)
* Fix systemd unit file to run after network on non PVE nodes. (Closes #137)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Mon, 13 May 2025 18:12:04 +0000
proxlb (1.1.1) stable; urgency=medium
* Fix tag evluation for VMs for being ignored for further balancing. (Closes: #163)
* Improve logging verbosity of messages that had a wrong servity. (Closes: #165)
* Providing the API upstream error message when migration fails in debug mode (Closes: #205)
* Change the default behaviour of the daemon mode to active. (Closes: #176)
* Change the default banalcing mode to used instead of assigned. (Closes: #180)
* Set cpu_used to the cpu usage, which is a percent, times the total number of cores to get a number where guest cpu_used can be added to nodes cpu_used and be meaningful. (Closes: #195)
* Honor the value when balancing should not be performed and stop balancing. (Closes: #174)
* Allow the use of minutes instead of hours and only accept hours or minutes in the format. (Closes: #187)
* Remove hard coded memory usage from lowest usage node and use method and mode specified in configuration instead. (Closes: #197)
* Fix the guest type relationship in the logs when a migration job failed. (Closes: #204)
* Requery a guest if that running guest reports 0 cpu usage. (Closes: #200)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Sat, 20 Apr 2025 20:55:02 +0000
proxlb (1.1.0) stable; urgency=medium
* Refactored code base of ProxLB. (Closes: #114)
-- Florian Paul Azim Hoberg <gyptazy@gyptazy.com> Mon, 17 Mar 2025 18:55:02 +0000

Some files were not shown because too many files have changed in this diff Show More