Coder Social home page Coder Social logo

pve-cslb's Introduction

pve-cslb

A Central Scheduler Load Balancer (CSLB) for PromoxVE (PVE)

Identifies nodes with resource surpluses and deficits (presently only CPU and memory) and migrates workloads around to balance things out. Takes inspiration from, and expands upon, ideas in this oft-cited paper from 2012.

Installing

Using

The defaults are reasonable. Config file is optional. Command line arguments are optional unless you want to use a config file. Follows 12-factor conventions and configurable from environment variables ("CSLB_" namespace).

API endpoint and credentials with read and migrate permissions are required.

CLI

$ ./pve-cslb.py --exclude-node firefly -v --help
usage: pve-cslb [-h] [-c FILE] [-v] [-q] [-d] [--proxmox-node NODE] [--proxmox-port PORT]
                [--proxmox-user USER] [--proxmox-pass PASS] [-m NUM] [--percent-cpu %]
                [--percent-mem %] [--exclude-node EXCLUDE_NODE]
                [--exclude-vmid EXCLUDE_VMID] [--exclude-type EXCLUDE_TYPE]
                [--include-node INCLUDE_NODE] [--include-vmid INCLUDE_VMID]
                [--include-type INCLUDE_TYPE]

pve-cslb 1.0.3 - A workload balancing engine for ProxmoxPVE. Identifies nodes with
imbalanced loads and migrates workloads around to even things out.

options:
  -h, --help            show this help message and exit
  -c FILE, --config-file FILE
                        YAML configuration file (default: None)
  -v, --verbose         Increase verbosity (default: False)
  -q, --quiet           Only output errors (default: False)
  -d, --dry-run         Perform read-only analysis; no write actions. (default: False)
  --proxmox-node NODE   Proxmox node (default: localhost)
  --proxmox-port PORT   Proxmox port (default: 8006)
  --proxmox-user USER   Proxmox user (default: root@pam)
  --proxmox-pass PASS   Proxmox password (no default)
  -m NUM, --max-migrations NUM
                        Max simultaneous migrations to start (default: 5)
  --percent-cpu %       Percent priority of CPU rule (p-cpu and p-mem must equal 1.0;
                        default: 0.4)
  --percent-mem %       Percent priority of MEM rule (p-cpu and p-mem must equal 1.0;
                        default: 0.6)
  --exclude-node EXCLUDE_NODE
                        Exclude a node (can be specified multiple times)
  --exclude-vmid EXCLUDE_VMID
                        Exclude a VMID (can be specified multiple times)
  --exclude-type EXCLUDE_TYPE
                        Exclude a workload type ('lxc' or 'qemu'; can be specified multiple
                        times)
  --include-node INCLUDE_NODE
                        Include a previously excluded node (can be specified multiple times)
  --include-vmid INCLUDE_VMID
                        Include a previously excluded VMID (can be specified multiple times)
  --include-type INCLUDE_TYPE
                        Include a previously excluded workload type (must be 'lxc' or
                        'qemu'; can be specified multiple times)

Copyright (C) 2024 Travis Wichert <[email protected]>

Available Env Vars

Env Vars
CSLB_PROXMOX_NODE
CSLB_PROXMOX_PORT
CSLB_PROXMOX_USER
CSLB_PROXMOX_PASS
CSLB_PERCENT_CPU
CLSB_PERCENT_MEM
CLSB_MAX_MIGRATIONS
CSLB_VERBOSE
CSLB_QUIET
CSLB_DRY_RUN

Known Issues

pve-cslb tries to avoid moving the same workload multiple times, but an edge-case exists in which lightly loaded clusters with few workloads and many nodes may see more migrations than strictly necessary. Adding more workloads to the cluster will generally cease this behavior.

Contributors

padthaitofuhot
padthaitofuhot

pve-cslb's People

Contributors

padthaitofuhot avatar coloredbytes avatar

Stargazers

Chris Harris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.