proxmox api / python module

proxmox api / python module

  • Written by
    Walter Doekes
  • Published on

So, my VM was slow, and I needed to know which VM guest was eating all the resources. These VM containers are all managed by Proxmox; which is great, but it doesn’t show which VM guest is eating all the resources.

Luckily, Proxmox provides an API to get that info.

The docs pointed to two API modules for Python, my language of choice for these kinds of jobs: proxmoxer and pyproxmox. Others include Proxmoxia and pve2 (404 at the time of writing).

proxmoxer came out as the winner because:

  • Pretty good PEP score
  • Both HTTPS and SSH support (not needed in our case, but cleanly separated)
  • Hosted on GitHub
  • Travis build check (and friends)

The only thing that pyproxmox has going for it, is the convenience functions, but they limit functionality, making it kind of crippled instead.

# I don't see how I'm supposed to specify
# the timeframe with pyproxmox:
pyproxmox.getContainerRRDData(node, vmid)

# versus


# See:
# Path: /nodes/{node}/openvz/{vmid}/rrddata

Next time, an example script.

Back to overview Newer post: proxmox / resource usage Older post: zabbix api / python module