mirror of
https://github.com/gyptazy/ProxLB.git
synced 2026-04-05 20:31:57 +02:00
Merge pull request #269 from gyptazy/fix/268-evaluate-balancing-types
fix: Fix balancing evaluation of guest types (e.g., VM or CT).
This commit is contained in:
2
.changelogs/1.1.6/268_fix_balancing_type_eval.yml
Normal file
2
.changelogs/1.1.6/268_fix_balancing_type_eval.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
fixed:
|
||||
- Fix balancing evaluation of guest types (e.g., VM or CT) (@gyptazy). [#268]
|
||||
1
.changelogs/1.1.6/release_meta.yml
Normal file
1
.changelogs/1.1.6/release_meta.yml
Normal file
@@ -0,0 +1 @@
|
||||
date: TBD
|
||||
@@ -90,11 +90,23 @@ class Balancing:
|
||||
|
||||
# VM Balancing
|
||||
if guest_meta["type"] == "vm":
|
||||
job_id = self.exec_rebalancing_vm(proxmox_api, proxlb_data, guest_name)
|
||||
if 'vm' in proxlb_data["meta"]["balancing"].get("balance_types", []):
|
||||
logger.debug("Balancing: Balancing for guest {guest_name} of type VM started.")
|
||||
job_id = self.exec_rebalancing_vm(proxmox_api, proxlb_data, guest_name)
|
||||
else:
|
||||
logger.debug(
|
||||
f"Balancing: Balancing for guest {guest_name} will not be performed. "
|
||||
"Guest is of type VM which is not included in allowed balancing types.")
|
||||
|
||||
# CT Balancing
|
||||
elif guest_meta["type"] == "ct":
|
||||
job_id = self.exec_rebalancing_ct(proxmox_api, proxlb_data, guest_name)
|
||||
if 'ct' in proxlb_data["meta"]["balancing"].get("balance_types", []):
|
||||
logger.debug("Balancing: Balancing for guest {guest_name} of type CT started.")
|
||||
job_id = self.exec_rebalancing_ct(proxmox_api, proxlb_data, guest_name)
|
||||
else:
|
||||
logger.debug(
|
||||
f"Balancing: Balancing for guest {guest_name} will not be performed. "
|
||||
"Guest is of type CT which is not included in allowed balancing types.")
|
||||
|
||||
# Just in case we get a new type of guest in the future
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user