Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Proxmox Automation

Direct 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.

When to use this

Use this when automating Proxmox VMs, containers, storage and clusters.

First 30 seconds

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.

Operational verification

tool → API token → /api2/json → tasks

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Proxmox VE API automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProxmox VE API automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior. · Proxmox VE
Key commandpvesh
Scope / prerequisiteUse this when automating Proxmox VMs, containers, storage and clusters.
Reference · 3
What next?3 suggested next steps
Child topics (this level)11
Catalog command links3
Evidence0
On this pageJump to a specific section
Automation command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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.

Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Proxmox API

The Proxmox VE API is a REST API at https://host:8006/api2/json covering nodes, VMs, containers, storage and clusters.

Subtopic VM Provisioning

Proxmox 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 Provisioning

LXC 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 Automation

Proxmox 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 Automation

Proxmox 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 Automation

Proxmox 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 Automation

Proxmox 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 Automation

Ceph 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 / OpenTofu

Terraform 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 Ansible

Ansible 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 Troubleshooting

Troubleshoot 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.

Key points
  • Use API tokens with limited privileges.
  • Cloud-init templates speed up VM provisioning.
  • Tasks run asynchronously; check task status.
Key checks
  • pvesh get /version — API via CLI
  • curl -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
ToolNote
REST API tokensPrefer over passwords; scope with roles
bpg/proxmox Terraform providerDeclarative VMs/containers
community.general.proxmox*Ansible modules
cloud-initGuest 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProxmox VE API automation current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Depth when you need it

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.

Confirmation

Confirm action

Continue?