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

HA priority & Hardware Pass Through #8

Closed VibroAxe closed 2 years ago

VibroAxe commented 2 years ago

Does this script take into account ha priority (if a machine has a node affinity set, migrating it will only cause it to bounce back to the original node) and will it ignore (/pin) machines with hardware pass through, as they are not able to be migrated?

cvk98 commented 2 years ago

No. It focuses only on loading the RAM of the node.

VibroAxe commented 2 years ago

Might be worth a note in the readme, as running the script in this situation would end up with the server flapping :D

Shame, any chance of getting this accounted for, it looks like an awesome script but wont work in my environment! I'd PR but having looked at it, it's way beyond my Python experience :D

cvk98 commented 2 years ago

Our cluster does not use HA. Therefore, I wrote the script without taking into account its needs. I didn't even know that HA had priority of node selection. But I can tell you how you can use this script at home. In the config, you can specify a list of exceptions for nodes by entering nodes not participating in HA there. Then your virtual machines from the HA cluster will not migrate to a random node. Next to it, you can run a second instance, in the config of which there will be nodes with HA in exceptions. You will get 2 load balancers for 2 parts of the cluster. Maybe (not 100%), this is what you need. And in the readme I will add the warning you recommended. Thanks.

VibroAxe commented 2 years ago

Oh thats cool, didn't realise it had the exemptions added, looking at the config I assume use the

exclusions:
  vms: []    # Example: [100] or [100, 101, 102, 113, 125, 131]

Perfect thanks!

cvk98 commented 2 years ago

It is worth adding that all virtual machines that run on nodes added to "exclusions: nodes" will be ignored. If the script works for you, I'm waiting for a screenshot in issue #7))