360 Secure SkillHub
360 安全技能中心

proxmox-ops

围绕 Proxmox VE 运维的 Skill:使用 curl、jq 和 pve.sh 调用用户自建 Proxmox 主机的 REST API,列出与开关虚拟机/LXC、检查节点和存储、创建快照、调整磁盘、查询任务及按参考文档进行创建和克隆;破坏性操作要求先确认。

分类:自动化
eddygk
eddygk
热度 48.40
最近更新 2026-11-19 03:45:19

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add eddygk/proxmox-ops
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
proxmox-ops
description
Ops-focused Proxmox VE management via REST API — monitor, control, provision, and troubleshoot VMs and LXC containers with battle-tested operational patterns. Use when asked to: - List, start, stop, restart VMs or LXC containers - Check node status, cluster health, or resource usage - Create, clone, or delete VMs and containers - Manage snapshots, backups, storage, or templates - Resize disks (API + in-guest filesystem steps) - Query guest agent for IP addresses - View tasks or system event logs Includes helper script (pve.sh) with auto node discovery from VMID, operational safety gates (read-only vs reversible vs destructive), vmstate snapshot warnings, post-resize guest filesystem steps, and a separate provisioning reference. Requires: curl, jq. Credentials: PROXMOX_HOST, PROXMOX_TOKEN_ID, PROXMOX_TOKEN_SECRET — set as env vars or stored in ~/.proxmox-credentials (sourced at runtime, user-created, mode 600). Writes: ~/.proxmox-credentials (user-created, API token, mode 600). Network: connects to user-configured Proxmox host only (HTTPS, TLS verification disabled for self-signed certs). Helper script: scripts/pve.sh (relative to this skill) Configuration: ~/.proxmox-credentials
metadata
{"openclaw":{"emoji":"🖥️","homepage":"https://github.com/eddygk/proxmox-ops-skill","requires":{"bins":["curl","jq"]},"os":["darwin","linux"]}}

Proxmox VE Management

First-Time Setup

Credentials file ~/.proxmox-credentials (or env vars) and least-privilege API token creation → See references/setup.md

Auth Header

source ~/.proxmox-credentials
AUTH="Authorization: PVEAPIToken=$PROXMOX_TOKEN_ID=$PROXMOX_TOKEN_SECRET"

Helper Script

scripts/pve.sh auto-discovers nodes from VMID — no need to specify the node for most operations.

pve.sh status              # Cluster nodes overview
pve.sh vms [node]          # List all VMs (optionally filter by node)
pve.sh lxc <node>          # List LXC containers on node
pve.sh start <vmid>        # Start VM/LXC
pve.sh stop <vmid>         # Force stop VM/LXC
pve.sh shutdown <vmid>     # Graceful shutdown VM/LXC
pve.sh reboot <vmid>       # Reboot VM/LXC
pve.sh snap <vmid> [name]  # Create snapshot (disk-only, safe)
pve.sh snapshots <vmid>    # List snapshots
pve.sh tasks <node>        # Show recent tasks
pve.sh storage <node>      # Show storage status
pve.sh ips [prefix]        # List configured IPs across cluster (e.g. "10.10.20")

⚠️ vms and lxc are SEPARATE enumerations — a fleet-wide claim needs both

Command families per guest type (pct exec vs qm guest exec), list-output field gotchas, and the real cost of getting it wrong → See references/guest-types.md

Workflow

  1. Load credentials from ~/.proxmox-credentials
  2. Determine operation type:
    • Read-only (status, list, storage, tasks) → Execute directly
    • Reversible (start, stop, reboot, snapshot) → Execute, note UPID for tracking
    • Destructive (delete VM, resize disk, rollback snapshot) → Confirm with user first
  3. Query Proxmox API via curl + API token auth
  4. Parse JSON with jq
  5. Track async tasks — create/clone/backup operations return UPID

Common Operations

Cluster & nodes, list VMs/LXC, power control, snapshots (⚠️ omit vmstate=1), disk resize + in-guest steps, guest-agent IP discovery, storage & backups, tasks → See references/api-operations.md

Provisioning

For create VM, create LXC, clone, convert to template, and delete operations:

→ See references/provisioning.md

Security Notes

  • Credential file (~/.proxmox-credentials) is user-created, not auto-generated by this skill. Must be mode 600 (chmod 600 ~/.proxmox-credentials). Rotate tokens immediately if exposed
  • TLS verification disabled (-k / --insecure) — Proxmox VE uses self-signed certificates by default (Proxmox docs). If you deploy a trusted CA cert on your Proxmox node, remove the -k flag from curl commands and pve.sh
  • Least-privilege tokens — create tokens with only the roles your workflow needs. PVEAuditor for monitoring, PVEVMAdmin for VM ops. Full-access tokens are not required for most operations
  • Network scope — all API calls target PROXMOX_HOST only. No external endpoints. Verify by reviewing scripts/pve.sh (small, readable). In agent contexts, restrict network access to your Proxmox hosts only
  • API tokens don't need CSRF tokens for POST/PUT/DELETE
  • Power and delete operations are destructive — confirm with user first
  • Never expose credentials in responses

Notes

  • Replace {node}, {vmid}, {storage}, {snapname} with actual values
  • Task operations return UPID for tracking async jobs
  • Use qemu for VMs, lxc for containers in endpoint paths