cvk98 / Proxmox-load-balancer

Designed to constantly maintain the Proxmox cluster in balance
GNU General Public License v3.0
185 stars 22 forks source link

Exclude VM from migration if it is the only VM on a node #26

Open mjolnirgs opened 5 months ago

mjolnirgs commented 5 months ago

I have a large cluster of 10 nodes, that is sometimes very lightly loaded with less than 10 VMs. Then we will provision a large number of temporary VMs that require balancing. This is part of an automated provisioning system, so we are not always aware that we need to turn on the load-balancer.

Currently the script will endlessly migrate VMs from one host to another when the cluster has fewer than 1 VM per host.

We can set the memory percentage very high, but then that would defeat the purpose of the load balancer, and starting and stopping the script manually would be less than ideal. We could also manually exclude the long running VMs from migration, but then they might require migration in the future and it would be better not to have to manually manage the load-balancer like that.

In all use cases, I cannot see any value at all in the load balancer migrating a VM away from a node when it is the only VM on the node.

cvk98 commented 5 months ago

I absolutely agree with you. It was this logic that I put into my program. If this is not the case, then something did not go according to plan =)

mjolnirgs commented 4 months ago

I can confirm it is definitely endlessly migrating a VM around the empty nodes in the cluster.