Use this when automating Proxmox VMs, containers, storage and clusters.
Proxmox Automation
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.
1. Proxmox automation via REST API, pvesh, Terraform providers, Ansible modules.
2. API tokens with privilege separation.
3. Poll task UPIDs.
4. Verify TLS.
5. Idempotent tooling.
tool → API token → /api2/json → tasks
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
pveshPrimary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Target-state verification ladder Verify boundary
Proxmox Automation uses a strict target-state ladder for Proxmox task/UPID to VM/storage/network state: request accepted → job/task succeeded → target object changed → effective runtime state confirmed → original workload verified.
Step 2 Verification path Verify boundary
Record cluster/node, VMID/CTID or storage/object ID, API token/user, UPID task ID and configuration revision; inspect the runtime/control-plane result; then query the Proxmox cluster object plus guest/storage/network state visible after the asynchronous task converges through an independent read path and compare it with the versioned intent. For Automation → Proxmox Automation, the evidence must connect the control-plane result to the Proxmox cluster object plus guest/storage/network state visible after the asynchronous task converges and explain any gap between desired, controller-reported and consumer-visible state.
Step 3 Where it fails Narrow the fault
Failure analysis for Automation → Proxmox Automation should follow the path through the components: automation definition → Proxmox API → cluster/node service → UPID task → VM/LXC/storage/network/Ceph object → status/config read-back. Common failure classes include wrong node/VMID, task accepted but later failed, cluster quorum/lock contention, storage/network mismatch, stale API view and retrying a still-running task. Before retrying a mutating operation, read current target state using the stable identity cluster/node, VMID/CTID or storage/object ID, API token/user, UPID task ID and configuration revision; if state is unknown, stop broad retries.
Subtopics
Go one level deeper into this subject.
The Proxmox VE API is a REST API at https://host:8006/api2/json covering nodes, VMs, containers, storage and clusters.
Subtopic VM ProvisioningProxmox VM provisioning clones a cloud-init template with qm clone, sets CPU, memory, disk size, network and cloud-init user data, then starts the VM — scriptable through the API or CLI.
Subtopic LXC ProvisioningLXC provisioning in Proxmox creates containers from templates with pct create or the API, setting CPU, memory, rootfs, network and SSH keys, much faster than full VMs.
Subtopic Cluster AutomationProxmox cluster automation creates and joins clusters with pvecm, manages HA groups and resources with ha-manager and runs maintenance across nodes via the API.
Subtopic Storage AutomationProxmox storage automation adds and configures storage with pvesm or the API, creates ZFS pools, LVM-thin or Ceph pools, and assigns content types such as images, backups and ISOs.
Subtopic Network AutomationProxmox network automation manages Linux bridges, bonds and VLANs in /etc/network/interfaces or SDN zones and VNets via the API, applying changes with ifreload -a.
Subtopic Backup AutomationProxmox backup automation schedules vzdump jobs or Proxmox Backup Server jobs with retention, verify and prune settings, and checks job results through the API or notifications.
Subtopic Ceph AutomationCeph automation in Proxmox uses pveceph and the API to create monitors, managers, OSDs and pools, and checks health with ceph -s, keeping hyper-converged clusters consistent.
Subtopic Terraform / OpenTofuTerraform and OpenTofu manage Proxmox VMs declaratively with providers such as bpg/proxmox or Telmate/proxmox, cloning templates with cloud-init settings and tracking them in state.
Subtopic AnsibleAnsible for Proxmox uses the community.general.proxmox modules to create, clone and manage VMs and containers through the API, and roles to configure the guests afterwards.
Subtopic Proxmox Automation TroubleshootingTroubleshoot Proxmox automation by checking API token privileges and paths, task logs in the UI or pvesh get /cluster/tasks, locked VMs (qm unlock), storage availability and cloud-init settings.
- Use API tokens with limited privileges.
- Cloud-init templates speed up VM provisioning.
- Tasks run asynchronously; check task status.
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
ReferenceWhy it matters1 section · depth on demand
In depth
Proxmox automation uses the Proxmox VE REST API (directly, through pvesh, or via Terraform and Ansible) to create VMs and containers, manage storage and backups, and configure clusters.
pveum user token add automation@pve tf --privsep 1
pvesh get /cluster/resources --type vm --output-format json
qm clone 9000 121 --name web04 --full true && qm set 121 --ipconfig0 ip=10.0.20.24/24,gw=10.0.20.1
| Tool | Note |
|---|---|
| REST API tokens | Prefer over passwords; scope with roles |
bpg/proxmox Terraform provider | Declarative VMs/containers |
community.general.proxmox* | Ansible modules |
| cloud-init | Guest customisation from templates |
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Automation → Proxmox Automation is owned at runtime by the Proxmox VE API, cluster services and asynchronous task workers acting on VM, LXC, storage, network, backup or Ceph objects. Its durable intent is versioned API/automation intent with explicit node, VMID/CTID, storage/network/cluster scope and task lifecycle; the stable identity contract is cluster/node, VMID/CTID or storage/object ID, API token/user, UPID task ID and configuration revision. The consumer-visible target is the Proxmox cluster object plus guest/storage/network state visible after the asynchronous task converges. The operating invariants are that node/object identity is explicit, API tasks are followed to terminal UPID state, permissions are scoped, cluster quorum/availability is considered and target state is re-read from Proxmox. Follow the chain of components automation definition → Proxmox API → cluster/node service → UPID task → VM/LXC/storage/network/Ceph object → status/config read-back and record which layer currently owns truth. The linked authority for bounded mechanics is Proxmox VE API Viewer; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Proxmox Automation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://pve.proxmox.com/pve-docs/api-viewer/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum cluster/node, object ID, API endpoint, UPID, task status/log, config digest, storage/network placement and final object status.