---
title: "Proxmox VM Management Approaches"
aliases: [proxmox-vm-creation, proxmox-api, proxmox-terraform, qm-commands]
tags: [proxmox, vm, infrastructure, homelab, iac, terraform, ansible]
sources:
  - "daily/2026-04-18.md"
created: 2026-04-18
updated: 2026-04-18
---

# Proxmox VM Management Approaches

Proxmox VE exposes several interfaces for creating and managing VMs. The right choice depends on whether the task is one-off or repeatable, and how much automation is required. SSH + `qm` commands is the fastest path for ad-hoc work; the Proxmox REST API is the best foundation for repeatable automation.

## Key Points

- **Proxmox REST API** — the canonical approach; can be called via `curl` or the Python `proxmoxer` SDK without SSH
- **Terraform + Proxmox provider** (`bpg/terraform-provider-proxmox`) — IaC approach; best for repeatable, version-controlled infrastructure
- **Ansible** — playbook-based automation; good when the same VM config is deployed multiple times or when post-provision config is also needed
- **SSH + `qm` commands** — fastest for one-off tasks; `qm create`, `qm start`, `qm stop`, `qm destroy`; no additional tooling needed
- **Proxmox MCP** — Claude Code natural-language interface wrapping the REST API; good for interactive, conversational VM management

## Details

### Comparison Table

| Approach | Setup Cost | Repeatable | Version-Controlled | Interactive |
|----------|-----------|------------|-------------------|-------------|
| SSH + qm | None | Low | No | Yes |
| Proxmox REST API | Low | High | With scripts | No |
| Terraform | Medium | High | Yes (tfstate) | No |
| Ansible | Medium | High | Yes | No |
| Proxmox MCP | Low (one-time config) | Medium | No | Yes |

### SSH + qm Commands

The built-in CLI on the Proxmox host. No extra software needed — just SSH access:

```bash
# Create a VM
qm create 200 --name kali-linux --memory 4096 --cores 4 --net0 virtio,bridge=vmbr0

# Attach ISO
qm set 200 --ide2 local:iso/kali-linux-2024.2-installer-amd64.iso,media=cdrom
qm set 200 --scsi0 local-lvm:32  # 32 GB disk
qm set 200 --boot order=ide2

# Lifecycle
qm start 200
qm status 200
qm stop 200
qm destroy 200
```

Best for: ad-hoc VM creation, quick testing, situations where Terraform/Ansible is overkill.

### Proxmox REST API (Python proxmoxer)

```python
from proxmoxer import ProxmoxAPI

proxmox = ProxmoxAPI('192.168.x.x', user='root@pam', password='...', verify_ssl=False)

# Create VM via API
proxmox.nodes('pve').qemu.post(
    vmid=201,
    name='new-vm',
    memory=4096,
    cores=4,
    net0='virtio,bridge=vmbr0',
)
proxmox.nodes('pve').qemu(201).status.start.post()
```

Best for: scripted automation without IaC overhead, integrations with other systems.

### Terraform (bpg/terraform-provider-proxmox)

```hcl
resource "proxmox_virtual_environment_vm" "kali" {
  name      = "kali-linux"
  node_name = "pve"

  cpu { cores = 4 }
  memory { dedicated = 4096 }

  disk {
    datastore_id = "local-lvm"
    size         = 32
    interface    = "scsi0"
  }
}
```

Best for: production infrastructure, reproducible environments, teams needing code review for VM changes.

### Choosing an Approach

- **One-off / exploration:** SSH + qm or Proxmox MCP
- **Scripted repeatable (no IaC):** Proxmox REST API (proxmoxer)
- **IaC / team environment:** Terraform
- **Post-provision config included:** Ansible (can call Proxmox API + configure the VM)
- **Claude Code interactive session:** Proxmox MCP

## Related Concepts

- [[wiki/concepts/proxmox-mcp-server]] — MCP server that wraps the Proxmox REST API for Claude Code use
- [[wiki/homelab/_index]] — Proxmox installation, IOMMU, hypervisor configuration

## Sources

- [[daily/2026-04-18.md]] — User asked if SSH+qm is the only way to create VMs from Claude Code; assistant outlined all four approaches (Proxmox API, Terraform, Ansible, SSH+qm); discussion led to discovering Proxmox MCP as a fifth option
