Automation
Proxmox Automation
Cheat sheet · https://pcornel.dk/topic.php?topic=5720
Answer
Proxmox automation manages VMs, containers, storage and clusters through the Proxmox VE REST API, the qm and pct CLIs, pvesh, Terraform providers and Ansible modules, often combined with cloud-init templates.
Remember
- Use API tokens with limited privileges.
- Cloud-init templates speed up VM provisioning.
- Tasks run asynchronously; check task status.
First checks
pvesh get /version— API via CLIcurl -sS -H 'Authorization: PVEAPIToken=<user>@<realm>!<id>=<secret>' https://<host>:8006/api2/json/cluster/resources— REST- Terraform (bpg/proxmox) or Ansible (community.general.proxmox*) usage — tools
Commands
pvesh- Proxmox VE command-line client for the Proxmox API.
qm- Proxmox VE command for managing QEMU/KVM virtual machines.
pct- Proxmox VE command for managing LXC containers.
Verify in this order
tool → API token → /api2/json → tasks
Where it usually breaks
Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5720