Package: virtualisation-resource-distributor
Virtualisation Resource DistributorCyberfusion provides services such as IMAP, DNS and web hosting. These services run on multiple virtual machines. Therefore, services stay available when a virtual machine is out of service. Virtualisation Resource Distributor spreads virtual machines belonging to specific services over multiple zones.The hypervisor Proxmox VE is supported.SolutionVirtualisation Resource Distributor expects three things to be done:Group Proxmox VE 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 machinesdns0,dns1anddns2, add these virtual machines to the pooldns. Pools may be named anything.Add zones and pools to database (more information below).Virtualisation Resource Distributor makes sure resources in a pool run:On as many different nodes as possible.In as many different zones as possible.... depending on the amount of nodes, resources and zones.What it does and does not doWhat it doesWhen Virtualisation Resource Distributor determines resources should be migrated, two things happen:The program exits withstatus code 78.The program outputs the names of pools with resources to migrate.Running in cronRunning Virtualisation Resource Distributor in cron yields the following results:If no resources have to be migrated, nothing happens.If resources have to be migrated,cronshould send mail.What it does not doVirtualisation Resource Distributor does not migrate resources automatically. Migrating resources automatically causes more problems than it solves. When running in cron, the administrator should monitor mail sent bycronand migrate resources manually.UsageInstallInstall the package from PyPI:pip3 install virtualisation-resource-distributorConfigurationEnvironmentAdd the following settings to the.envfile. This file is relative to your working directory.DATABASE_PATH. Type: string. Default:/var/lib/virtualisation-resource-distributor.sqlite3PROXMOX_HOST. Type: string. Default:pve-test:8006. If the port is omitted, it defaults to 8006. The port must be set to run the tests.PROXMOX_USERNAME. Type: string. Default:guestPROXMOX_REALM. Tyoe: string. Default:pvePROXMOX_VERIFY_SSL. Type: boolean. Default:TrueEXCLUDE_POOLS_NAMES. Type: JSON (e.g.'["pool1", "pool2"]'). Default: empty list, all pools are included.These settings can be overridden by specifying them as environment variables.SecretsCreate the directory/etc/virtualisation-resource-distributorwith secure permissions.Create the fileproxmox_passwordwith secure permissions.Place the password for the Proxmox user in it.PermissionsThe Proxmox user specified in the configuration should have the following privileges:Pool.Allocateon path/poolCreate databaseCreate the file specified inDATABASE_PATHwith secure permissions.Copyvirtualisation-resource-distributor.sqlite3(can be found in the Git repository) to the path specified inDATABASE_PATH.Manage zones and nodesAdd zones with:virtualisation-resource-distributor create-zone --name=<name>Add nodes with:virtualisation-resource-distributor create-node --name=<name> --zone-name=<zone-name>Delete nodes with:virtualisation-resource-distributor delete-node --name=<name>Delete zones with:virtualisation-resource-distributor delete-zone --name=<name>TestsUnit tests are located intests/unit_tests. Run them with pytest. The tests must be run from the project root.The database (atDATABASE_PATH) is removed after the tests were run. Set it to a volatile file.