cvk98 / Proxmox-load-balancer

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

Script crashes when run on fresh installation without any HA enabled vm #27

Open labkeeper opened 6 months ago

labkeeper commented 6 months ago

As title says, when I run script in cluster of 3 fresh machines, 3 vms on one of them, no vm has HA enabled./

INFO | START ***Load-balancer!***
Traceback (most recent call last):
  File "/usr/local/Proxmox-load-balancer/./plb.py", line 494, in <module>
    main()
  File "/usr/local/Proxmox-load-balancer/./plb.py", line 464, in main
    cluster = Cluster(server_url)
              ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Proxmox-load-balancer/./plb.py", line 95, in __init__
    self.cl_nodes: dict = self.cluster_hosts()  # All cluster nodes
                          ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Proxmox-load-balancer/./plb.py", line 167, in cluster_hosts
    self.master_node = rr.json()['data']['manager_status']['master_node']
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'master_node'
cvk98 commented 6 months ago

You need to turn off the "run only on the masternode" in the config