mirror of
https://github.com/gyptazy/ProxLB.git
synced 2026-04-05 20:31:57 +02:00
Merge pull request #409 from gyptazy/fix/tags-ignore
Fix that ignored VMs/CTs got moved to another node when being ignored.
This commit is contained in:
2
.changelogs/1.1.11/408_fix_moving_ignored_guests.yml
Normal file
2
.changelogs/1.1.11/408_fix_moving_ignored_guests.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
fixed:
|
||||
- Fixed that ignored VMs/CTs got moved to another node when being ignored (@gyptazy). [#408]
|
||||
@@ -580,8 +580,11 @@ class Calculations:
|
||||
proxlb_data["nodes"][node_current]["disk_used_percent"] = proxlb_data["nodes"][node_current]["disk_used"] / proxlb_data["nodes"][node_current]["disk_total"] * 100
|
||||
|
||||
# Assign guest to the new target node
|
||||
proxlb_data["guests"][guest_name]["node_target"] = node_target
|
||||
logger.debug(f"Set guest {guest_name} from node {node_current} to node {node_target}.")
|
||||
if not proxlb_data["guests"][guest_name]["ignore"]:
|
||||
proxlb_data["guests"][guest_name]["node_target"] = node_target
|
||||
logger.debug(f"Set guest {guest_name} from node {node_current} to node {node_target}.")
|
||||
else:
|
||||
logger.debug(f"Guest {guest_name} is marked as ignored. Skipping target node assignment.")
|
||||
|
||||
logger.debug("Finished: update_node_resources.")
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class Tags:
|
||||
logger.debug(f"Adding affinity group for tag {tag}.")
|
||||
affinity_tags.append(tag)
|
||||
else:
|
||||
logger.debug(f"Skipping affinity group for tag {tag}.")
|
||||
logger.debug(f"Skipping evaluation of tag: {tag} This is not an affinity tag.")
|
||||
|
||||
# Pool based affinity groups
|
||||
if len(pools) > 0:
|
||||
@@ -117,7 +117,7 @@ class Tags:
|
||||
logger.debug(f"Adding affinity group for pool {pool}.")
|
||||
affinity_tags.append(pool)
|
||||
else:
|
||||
logger.debug(f"Skipping affinity group for pool {pool}.")
|
||||
logger.debug(f"Skipping evaluation of pool: {pool} This is not an affinity pool.")
|
||||
|
||||
# HA rule based affinity groups
|
||||
if len(ha_rules) > 0:
|
||||
@@ -157,7 +157,7 @@ class Tags:
|
||||
logger.debug(f"Adding anti-affinity group for tag {tag}.")
|
||||
anti_affinity_tags.append(tag)
|
||||
else:
|
||||
logger.debug(f"Skipping anti-affinity group for tag {tag}.")
|
||||
logger.debug(f"Skipping evaluation of tag: {tag} This is not an anti-affinity tag.")
|
||||
|
||||
# Pool based anti-affinity groups
|
||||
if len(pools) > 0:
|
||||
@@ -167,7 +167,7 @@ class Tags:
|
||||
logger.debug(f"Adding anti-affinity group for pool {pool}.")
|
||||
anti_affinity_tags.append(pool)
|
||||
else:
|
||||
logger.debug(f"Skipping anti-affinity group for pool {pool}.")
|
||||
logger.debug(f"Skipping evaluation of pool: {pool} This is not an anti-affinity pool.")
|
||||
|
||||
# HA rule based anti-affinity groups
|
||||
if len(ha_rules) > 0:
|
||||
@@ -197,9 +197,14 @@ class Tags:
|
||||
ignore_tag = False
|
||||
|
||||
if len(tags) > 0:
|
||||
logger.debug(f"Found {len(tags)} tags to evaluate.")
|
||||
for tag in tags:
|
||||
logger.debug(f"Evaluating tag: {tag}.")
|
||||
if tag.startswith("plb_ignore"):
|
||||
logger.debug(f"Found valid ignore tag: {tag}. Marking guest as ignored.")
|
||||
ignore_tag = True
|
||||
else:
|
||||
logger.debug(f"Tag: {tag} This is not an ignore tag.")
|
||||
|
||||
logger.debug("Finished: get_ignore.")
|
||||
return ignore_tag
|
||||
|
||||
Reference in New Issue
Block a user