Proxmox Guest Control
Overview
Use this skill from the directory that contains .env.
Prefer the bundled helper script over ad-hoc curl snippets. The script reads IP, USR, and PWD from the local .env, normalizes usernames that omit a realm, authenticates against the Proxmox REST API, and handles the cookie plus CSRF token needed for write operations.
Safety Rules
-
Read
.envfrom disk instead of sourcing it into the shell.- This repo stores the password under
PWD=..., which collides with common shell environment usage. - Let
scripts/proxmox_vm.pyload the file directly.
- This repo stores the password under
-
Normalize the Proxmox username before calling the API.
- If
USRalready contains a realm such asroot@pam, use it as-is. - If it does not contain
@, treat it as@pamby default.
- If
-
Inspect before mutating.
- Start with
nodes,nextid, orlist-vmsbeforestart,create, orclone. - Confirm the target node name, the VM ID, and the bridge or storage name before writing anything.
- Start with
-
Prefer
clonewhen a template already exists.- Use
createfor a blank VM shell. - Use
clonefor faster provisioning from a prepared template.
- Use
-
Use
--verify-sslonly when the Proxmox certificate chain is already trusted on this machine.- The helper defaults to the common self-signed Proxmox setup.
Quick Start
Run all commands from this skill root so the helper can find .env automatically.
Inspect nodes:
uv run .\scripts\proxmox_vm.py nodes
Inspect the next free VM ID:
uv run .\scripts\proxmox_vm.py nextid
Inspect VMs on a node:
uv run .\scripts\proxmox_vm.py list-vms --node pve
Inspect LXC containers on a node:
uv run .\scripts\proxmox_vm.py list-cts --node pve
Inspect all nodes at once:
uv run .\scripts\proxmox_vm.py list-vms
Start an Existing VM
Use this flow when the VM already exists and only needs to be powered on.
- Find the target node and VM ID.
uv run .\scripts\proxmox_vm.py list-vms --node pve
- Start the VM and wait for the task to finish when the caller needs confirmation.
uv run .\scripts\proxmox_vm.py start --node pve --vmid 120 --wait
- Re-check the VM list if the caller needs a second confirmation pass.
uv run .\scripts\proxmox_vm.py list-vms --node pve
Create a Blank VM
Use this flow when the caller wants a new VM shell with explicit CPU, memory, network, and optional disk settings.
- Get a free VM ID.
uv run .\scripts\proxmox_vm.py nextid
- Create the VM shell.
uv run .\scripts\proxmox_vm.py create `
--node pve `
--vmid 220 `
--name app-220 `
--memory 4096 `
--cores 4 `
--bridge vmbr0 `
--storage local-lvm `
--disk-gb 32 `
--wait
-
Add any Proxmox-specific arguments with repeated
--param key=value.- Use this for options that are not covered by the first-class flags.
- Example:
--param tags=lab --param ciuser=ubuntu
-
Start the new VM if the caller wants the shell booted immediately.
uv run .\scripts\proxmox_vm.py start --node pve --vmid 220 --wait
Clone from a Template
Use this flow when a template VM already exists on the target cluster.
- Inspect the source template and the destination node.
uv run .\scripts\proxmox_vm.py list-vms --node pve
- Clone it to a new VM ID.
uv run .\scripts\proxmox_vm.py clone `
--node pve `
--source-vmid 9000 `
--newid 221 `
--name app-221 `
--full `
--wait
- Boot the cloned VM when needed.
uv run .\scripts\proxmox_vm.py start --node pve --vmid 221 --wait
Create an LXC Container
Use this flow when the caller explicitly wants a lightweight container rather than a full VM.
-
Inspect the available Proxmox templates and confirm the target node.
- Read references/api-notes.md for the known template patterns in this environment.
- Prefer a
local:vztmpl/...template that already exists on the node.
-
Get a free ID.
uv run .\scripts\proxmox_vm.py nextid
- Create the container from a template and optionally boot it immediately.
uv run .\scripts\proxmox_vm.py create-ct `
--node pve `
--vmid 230 `
--hostname codex-230 `
--ostemplate local:vztmpl/ubuntu-24.04-standard_24.04-2_amd64.tar.zst `
--storage local-lvm `
--memory 512 `
--swap 512 `
--cores 1 `
--disk-gb 8 `
--bridge vmbr0 `
--ip dhcp `
--wait `
--start-after-create
- If the container was created without
--start-after-create, boot it with:
uv run .\scripts\proxmox_vm.py start-ct --node pve --vmid 230 --wait
- Re-check the container list when the caller wants a visible state confirmation.
uv run .\scripts\proxmox_vm.py list-cts --node pve
Verification
- Use
--waitonstart,create,clone,start-ct, andcreate-ctwhen the caller needs the Proxmox task result instead of only the queued task ID. - Re-run
list-vmsafter a mutation when the caller wants a visible state check. - Re-run
list-ctsafter container mutations when the caller wants a visible state check. - Read references/api-notes.md when you need the exact API assumptions or command patterns behind the helper.
Avoid
- Do not duplicate credentials from
.envinto logs, markdown, or chat output. - Do not guess the node name, bridge, storage, or free VM ID.
- Do not guess the template volid for
create-ct. - Do not call
createwithout checking whether the caller actually wantedclone.