semvec/pypi-packages huggingface dataset:
python-cyberfusion-proxmox-resource-distributor 1.1.1.1
Program to distribute resources over Proxmox nodes.
License: MIT
Requires Python: >=3.6
Keywords: cyberfusion,proxmox

# Wish

* At Cyberfusion, we provide customers with services such as IMAP, POP, DNS and web hosting.
* Services run on multiple resources. That way, an outage on a single resource wouldn't impact availability of the service.
* To ensure services stay available in case of physical component failure, resources belonging to the services should be spread over failure domains.

## Terminology

* Resources: Virtual Machines and Containers.

# Solution

Proxmox Resource Distributor expects three things to be done:

* Group Proxmox cluster nodes into zones. Zones are failure domains (e.g. a datacenter).
* Group service resources into pools. E.g. in case of a DNS cluster consisting of Virtual Machines `dns0`, `dns1` and `dns2`, add these Virtual Machines to the pool `dns` (pools may be named anything).
* Add zones and pools to configuration (more information below).

Proxmox Resource Distributor will then make sure resources in a pool run:

* On as many different nodes as possible.
* In as many different failure domains as possible.

...depending on the amount of nodes, resources and failure domains.

# What it does and does not do

## What it does

When Proxmox Resource Distributor determines resources should be migrated, two things will happen:

* The program will exit with [status code 78](https://www.freebsd.org/cgi/man.cgi?query=sysexits).
* The program will output the resources to migrate, and possible destination zones.

### Example output

```
$pool_name
  - Migrate $resource_name ($resource_id) from $current_zone_name
    Possible destinations:
      - $possible_new_zone_name
        Nodes:
          - $node_name
          - $node_name
      - $possible_new_zone_name
        Nodes:
          - $node_name
```

### Running in cron

Running Proxmox Resource Distributor in cron will yield the following results:

* If no resources have to be migrated, nothing will happen.
* If resources have to be migrated, `cron` should send mail.

## What it does not do

Proxmox Resource Distributor will not migrate resources automatically. We think migrating resources automatically would cause more problems than it would solve. If running in cron, the administrator should monitor mail sent by `cron` and migrate resources manually. The program's output should contain all information the administrator needs.

# Usage

First, install the package using `pip`.

## Configuration format

Then, add a configuration file at `/etc/proxmox-resource-distributor.yml`.

Format:

```
---
proxmox:
  host: string
  username: string
  realm: string
  password: string
  verify_ssl: boolean

zones:
  - name: string
    nodes:
      - string

pools:
  - string
```

# Permissions

The Proxmox user specified in the configuration should have the following privileges:

* `Pool.Allocate` on path `/pool`.