diff --git a/.changelogs/1.1.0/40_add_option_to_run_only_on_cluster_master_node.yml b/.changelogs/1.1.0/40_add_option_to_run_only_on_cluster_master_node.yml new file mode 100644 index 0000000..4320350 --- /dev/null +++ b/.changelogs/1.1.0/40_add_option_to_run_only_on_cluster_master_node.yml @@ -0,0 +1,2 @@ +added: + - Add option to run ProxLB only on the Proxmox's master node in the cluster. [40] diff --git a/.changelogs/1.1.0/41_add_option_run_migration_parallel_or_sequential.yml b/.changelogs/1.1.0/41_add_option_run_migration_parallel_or_sequential.yml new file mode 100644 index 0000000..f3417e2 --- /dev/null +++ b/.changelogs/1.1.0/41_add_option_run_migration_parallel_or_sequential.yml @@ -0,0 +1,2 @@ +added: + - Add option to run migrations in parallel or sequentially. [#41] diff --git a/.changelogs/1.1.0/45_fix_daemon_timer.yml b/.changelogs/1.1.0/45_fix_daemon_timer.yml new file mode 100644 index 0000000..b6a4dd5 --- /dev/null +++ b/.changelogs/1.1.0/45_fix_daemon_timer.yml @@ -0,0 +1,2 @@ +changed: + - Fix daemon timer to use hours instead of minutes. [#45] diff --git a/.changelogs/1.1.0/release_meta.yml b/.changelogs/1.1.0/release_meta.yml new file mode 100644 index 0000000..c19765d --- /dev/null +++ b/.changelogs/1.1.0/release_meta.yml @@ -0,0 +1 @@ +date: TBD diff --git a/README.md b/README.md index 8034628..0dbf341 100644 --- a/README.md +++ b/README.md @@ -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` | @@ -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 ``` diff --git a/proxlb b/proxlb index 9832346..ec107c7 100755 --- a/proxlb +++ b/proxlb @@ -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]:' @@ -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]:' @@ -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 @@ -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)