Skip to content

Bug: balance_types ignored #268

@sebastianberm

Description

@sebastianberm

General

When I am rebalancing our nodes, I don't want to reboot the containers, so I set balance_types to ['vm'] only. This is then ignored by the system when doing a rebalance.
Note that I am not using the service at the moment.

Weighting

Score: 5

Config

proxmox_cluster:
  maintenance_nodes: ['virt66.example.com']
  ignore_nodes: ['prod-cloud']
  overprovisioning: True

balancing:
  enable: True
  enforce_affinity: False
  parallel: False
  # If running parallel job, you can define
  # the amount of prallel jobs (default: 5)
  parallel_jobs: 1
  live: True
  with_local_disks: False
  balance_types: ['vm']
  max_job_validation: 1800
  balanciness: 5
  method: memory
  mode: used

service:
  daemon: False
  schedule:
    interval: 12
    format: hours
  delay:
    enable: False
    time: 1
    format: hours
  log_level: DEBUG

Log

Debug log available upon request by secure mail.

Meta

Please provide some more information about your setup. This includes where you obtained ProxLB (e.g., as a .deb file, from the repository or container image) and also which version you're running in which mode. You can obtain the used version from you image version, your local repository information or by running proxlb -v.

ProxLB version: 1.1.5
Installed from: deb file
Running as: on hypervisor connecting to rest of the hypervisors

I have made the following 'temp fix' so it works for my setup and I could continue (note that this isn't a fix):
In the tags model I added additional tags to make sure all my ct's are ignored and pinned to their respective current nodes correctly.

def get_tags_from_guests(proxmox_api: any, node: str, guest_id: int, guest_type: str) -> List[str]:
    """
    Get tags for a guest from the Proxmox cluster by the API.

    This method retrieves all tags for a given guest from the Proxmox API which
    is held in the guest_config.

    Args:
        proxmox_api (any): The Proxmox API client instance.
        node (str): The node name where the given guest is located.
        guest_id (int): The internal Proxmox ID of the guest.
        guest_type (str): The type (vm or ct) of the guest.

    Returns:
        List: A list of all tags assoiciated with the given guest.
    """
    logger.debug("Starting: get_tags_from_guests.")
    time.sleep(0.1)
    if guest_type == 'vm':
        guest_config = proxmox_api.nodes(node).qemu(guest_id).config.get()
        tags = guest_config.get("tags", [])
    if guest_type == 'ct':
        guest_config = proxmox_api.nodes(node).lxc(guest_id).config.get()
        tags = guest_config.get("tags", [])

    if isinstance(tags, str):
        tags = tags.split(";")
    if guest_type == 'ct':
        tags.append('plb_ignore_ct')
        tags.append('plb_pin_' + node)

    logger.debug("Finished: get_tags_from_guests.")
    return tags

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions