Skip to content

Commit

Permalink
Merge branch 'main' into feature/auto-node-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
gyptazy committed Aug 7, 2024
2 parents e3fdc50 + 101855b commit 23eff50
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
added:
- Add option to run ProxLB only on the Proxmox's master node in the cluster. [40]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
added:
- Add option to run migrations in parallel or sequentially. [#41]
2 changes: 2 additions & 0 deletions .changelogs/1.1.0/45_fix_daemon_timer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
changed:
- Fix daemon timer to use hours instead of minutes. [#45]
1 change: 1 addition & 0 deletions .changelogs/1.1.0/release_meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
date: TBD
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ The following options can be set in the `proxlb.conf` file:
| 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) |
| 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) |
| master_only | 0 | Defines is this should only be performed (1) on the cluster master node or not (0). (default: 0) |
| daemon | 1 | Run as a daemon (1) or one-shot (0). (default: 1) |
| schedule | 24 | Hours to rebalance in hours. (default: 24) |
| log_verbosity | INFO | Defines the log level (default: CRITICAL) where you can use `INFO`, `WARN` or `CRITICAL` |
Expand All @@ -133,9 +135,16 @@ type: vm
# 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
ignore_nodes: dummynode01,dummynode02
ignore_vms: testvm01,testvm02
[service]
# The master_only option might be usuful 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
```

Expand Down
6 changes: 6 additions & 0 deletions proxlb
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def validate_cluster_master(cluster_master):
return True


<<<<<<< HEAD
def get_node_update_status(api_object):
""" Get the current update status of the current executing host node in the cluster. """
info_prefix = 'Info: [node-update-status-getter]:'
Expand Down Expand Up @@ -360,6 +361,8 @@ def run_node_reboot(api_object, node_requires_reboot):
logging.info(f'{info_prefix} Rebooting node now: {node_executor_hostname}.')


=======
>>>>>>> main
def get_node_statistics(api_object, ignore_nodes):
""" Get statistics of cpu, memory and disk for each node in the cluster. """
info_prefix = 'Info: [node-statistics]:'
Expand Down Expand Up @@ -984,6 +987,7 @@ def main():
validate_daemon(daemon, schedule)
continue

<<<<<<< HEAD
# Validate for node auto update in cluster for rolling updates.
# Note: This requires proxlb-additions with a patched Proxmox API!
#rolling_updates = 1
Expand All @@ -994,6 +998,8 @@ def main():
if node_requires_reboot:
ignore_nodes = extend_ignore_node_list(ignore_nodes)

=======
>>>>>>> main
# Get metric & statistics for vms and nodes.
node_statistics = get_node_statistics(api_object, ignore_nodes)
vm_statistics = get_vm_statistics(api_object, ignore_vms, balancing_type)
Expand Down

0 comments on commit 23eff50

Please sign in to comment.