Pcornel
Automation · Proxmox Automation

Terraform / OpenTofu

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

Back to the Topic

Answer

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.

Remember

  • Providers: bpg/proxmox or Telmate/proxmox.
  • Clone templates with cloud-init settings.
  • State tracks managed VMs.

First checks

  • terraform init && terraform plan — bpg/proxmox provider plan
  • API token and TLS settings in provider — auth
  • terraform state list — managed VMs

Verify in this order

HCL → provider → Proxmox API → resources

Where it usually breaks

Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.

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

Confirmation

Confirm action

Continue?