Package: pvecontrol
Proxmox VE Controlpvecontrol(https://pypi.org/project/pvecontrol/) software allows you to manage a Proxmox VE cluster using it's API with a convenient cli for you shell.It is designed to easy usage of multiple large clusters and get some detailled informations not easily available on the UI and integrated tools.pvecontrolis based uponproxmoxera wonderfull framework to communicate with Proxmox projects APIs.InstallationThe software need Python version 3.7+.The easiest way to install it is simply using pip. New versions are automatically published topypirepository. It is recommended to usepipxin order to automatically create a dedicated python virtualenv.pipxinstallpvecontrolConfigurationConfiguration is a yaml file in$HOME/.config/pvecontrol/config.yaml. It contains configuration needed by proxmoxer to connect to a cluster.pvecontrolcurently only use the http API and so work with an pve realm user or token (and also a@pamuser but is not recommended at all).It is highly recommended to setup a dedicated user for the tool usage. You should not useroot@pamproxmox node credentials in any ways for production systems because the configuration file is stored in plain text without ciphering on your system.If you plan to usepvecontrolin read only mode to fetch cluster informations you can limit user with onlyPVEAuditoron Path/Permissions. This is the minimum permissions needed bypvecontrolto work.
For other operations on VMs it is recommended to grantPVEVMAdminon Path/. This allows start, stop, migrate, ...Once you have setup your management user forpvecontrolyou can generate your configuration file. Default configuration template with all options is available (here)[https://github.com/enix/pvecontrol/blob/dev/src/pvecontrol/config_default.yaml]. Use this file to build your own configuration file or the above exemple:---clusters:-name:my-test-clusterhost:192.168.1.10user:pvecontrol@pvepassword:superpasssecret-name:prod-cluster-1host:10.10.10.10user:pvecontrol@pvepassword:Supers3cUreUsagepvecontrolprovide a completehelpmessage for quick usage:$pvecontrol--help
usage:pvecontrol[-h][-v][--debug]-cCLUSTER{clusterstatus,nodelist,vmlist,tasklist,taskget}...

ProxmoxVEcontrolcli.

positionalarguments:{clusterstatus,nodelist,vmlist,tasklist,taskget}sub-commandhelpclusterstatusShowclusterstatusnodelistListnodesintheclustervmlistListVMsintheclustertasklistListtaskstaskgetGettaskdetail

options:-h,--helpshowthishelpmessageandexit-v,--verbose--debug-cCLUSTER,--clusterCLUSTERProxmoxclusternameasdefinedinconfigurationpvecontrolworks with subcommands for each operation. Each subcommand have it's ownhelp:$pvecontroltaskget--help
usage:pvecontroltaskget[-h]--upidUPID[-f]options:-h,--helpshowthishelpmessageandexit--upidUPIDProxmoxtasksUPIDtogetinformations-f,--followFollowtasklogoutputFor each operation it is mandatory to tellpvecontrolon which cluster from your configuration file you want to operate. So the--clusterargument is mandatory.The simpliest operation on a cluster that allows to check that user is correctly configured isclusterstatus:$pvecontrol--clustermy-test-clusterclusterstatus
INFO:root:Proxmoxcluster:my-test-cluster
INFO:root:{'nodes':9,'id':'cluster','type':'cluster','quorate':1,'version':17,'name':'pve-r1az2'}+-----------+-------+---------+--------------+--------------+|name|nodes|quorate|allocatedmem|allocatedcpu|+-----------+-------+---------+--------------+--------------+|pve-r1az2|9|1|583.5GiB|167|+-----------+-------+---------+--------------+--------------+If this works, you're ready to goDevelopmentInstall python requirements and directly use the script. All the configurations are common with the standard installation.pip3install-rrequirements.txt
python3src/pvecontrol/pvecontrol.py-hThis project usesemantic versioningwithpython-semantic-releasetoolkit in order to automate release process. All the commits must so use theAngular Commit Message Conventions. Repositorymainbranch is also protected to prevent any unwanted publish of a new release. All updates must go thru a PR with a review.Made with :heart: by Enix (http://enix.io) :monkey: from Paris :fr:.