Pcornel
Virtualization · Proxmox VE

API

Cheat sheet · https://pcornel.dk/topic.php?topic=3764

Back to the Topic

Answer

Separate transport/TLS, authentication, authorization, request validation, task execution and resulting resource state. HTTP success can mean request acceptance rather than operation completion.

Remember

  • HTTP 200/UPID returned ≠ task succeeded.
  • API reachable ≠ credentials authorized.
  • Task OK ≠ guest application healthy.
  • Automation must handle asynchronous status, idempotency and version-specific parameters.

First checks

  • pvesh get /version — CLI to API
  • curl -s -k -H 'Authorization: PVEAPIToken=<user>@<realm>!<tokenid>=<secret>' https://<host>:8006/api2/json/nodes — token auth
  • pvesh get /nodes/<node>/tasks/<upid>/status — task status

Commands

pvesh get <api-path> [--output-format json]
Query local Proxmox API tree.

Verify in this order

client → auth → API → task → result

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

Proxmox VE → API reference map

BoundaryWhat to verifyEvidence limit
Configured stateExpected API configuration is presentConfiguration alone does not prove runtime behavior
Runtime stateRelevant API service/object is active and error-freeRuntime state does not prove dependencies
DependencyBacking network, storage, cluster or host dependency is healthyLocal success does not prove end-to-end outcome
AcceptanceOriginal VM/container/workload test succeedsRequired to close the incident

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3764

Confirmation

Confirm action

Continue?