weird-aftertaste

Proxmox

运维安全v1.0.1
作者:weird-aftertaste更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-01-22proxmox@clawhub_weird-aftertaste/proxmox
服务器运维#Rest Api

据 AlphaMoat 统计,截至 2026-09,Proxmox 累计下载 4,981 次、获 7 个星标,在全部 5,078 个 AI 技能中排名第 1,844 位,在「运维安全」分类(264 个)中排名第 93 位。

累计安装
258
累计下载
4,981
星标
7
全站排名
#1,844
全站前 37% · 「运维安全」前 36%
平台累计安装累计下载星标评论
ClawHub ↗1524,8346-
SkillHub ↗2584,9817—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

可查看集群/节点状态、列出 VM 与 LXC、执行启动/停止/关机/重启,管理快照、任务日志、存储和 vzdump 备份。使用 /api2/json/... REST API 或 scripts/pve.sh 辅助脚本。凭证通过 PROXMOX_HOST、PROXMOX_TOKEN_ID、PROXMOX_TOKEN_SECRET 环境变量配置,或存于权限为 chmod 600 的 ~/.proxmox-credentials;推荐 API Token 与最小权限。任何状态变更(如停止、重启、回滚、删除)都应先由用户确认并审查命令。自签名证书的 curl -k 仅限受控测试网络,生产环境应使用可信证书。

资料发布于 2026-10-27

可以用来做什么

  • 检查集群与节点状态,管理 VM/LXC、快照、任务和备份。

什么时候用

  • 需要查询或管理 Proxmox VE 基础设施时使用;状态变更前需人工确认。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

列出集群中的 VM 和 LXC,并先给出重启目标与命令供我确认。

月度数据趋势

累计下载4,981
3,4164,2575,0972026-03 · 累计下载 3,5322026-05 · 累计下载 4,1712026-06 · 累计下载 4,3942026-07 · 累计下载 4,6392026-08 · 累计下载 4,7242026-09 · 累计下载 4,98126-0326-09
星标7
6772026-03 · 星标 62026-05 · 星标 62026-06 · 星标 62026-07 · 星标 72026-08 · 星标 72026-09 · 星标 726-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-094,981—7
2026-084,724+1.8%7
2026-074,639+5.6%7
2026-064,394+5.3%6
2026-054,171—6
2026-033,532—6

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

4.3 KB · ClawHub v1.0.1
---
name: proxmox
description: Manage Proxmox VE clusters via REST API. Use when user asks to list, start, stop, restart VMs or LXC containers, check node status, create snapshots, view tasks, or manage Proxmox infrastructure. Requires API token or credentials configured.
---

# Proxmox VE Management

## Configuration

Set environment variables or store in `~/.proxmox-credentials`:
展开全部(共 150 行)

```bash
# Option 1: API Token (recommended)
export PROXMOX_HOST="https://192.168.1.100:8006"
export PROXMOX_TOKEN_ID="user@pam!tokenname"
export PROXMOX_TOKEN_SECRET="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

# Option 2: Credentials file
cat > ~/.proxmox-credentials << 'EOF'
PROXMOX_HOST=https://192.168.1.100:8006
PROXMOX_TOKEN_ID=user@pam!monitoring
PROXMOX_TOKEN_SECRET=your-token-secret
EOF
chmod 600 ~/.proxmox-credentials
```

Create API token in Proxmox: Datacenter → Permissions → API Tokens → Add

## CLI Usage

```bash
# Load credentials
source ~/.proxmox-credentials 2>/dev/null

# Auth header for API token
AUTH="Authorization: PVEAPIToken=$PROXMOX_TOKEN_ID=$PROXMOX_TOKEN_SECRET"
```

## Common Operations

### Cluster & Nodes

```bash
# Cluster status
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/cluster/status" | jq

# List nodes
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes" | jq '.data[] | {node, status, cpu, mem: (.mem/.maxmem*100|round)}'

# Node status
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/status" | jq
```

### List VMs & Containers

```bash
# All VMs on a node
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu" | jq '.data[] | {vmid, name, status, mem: .mem, cpu: (.cpu*100|round)}'

# All LXC containers on a node
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/lxc" | jq '.data[] | {vmid, name, status}'

# Cluster-wide resources
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/cluster/resources?type=vm" | jq '.data[] | {node, vmid, name, type, status}'
```

### VM/Container Control

```bash
# Start VM
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/status/start"

# Stop VM
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/status/stop"

# Shutdown VM (graceful)
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/status/shutdown"

# Reboot VM
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/status/reboot"

# Same for LXC: replace /qemu/ with /lxc/
```

### Snapshots

```bash
# List snapshots
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/snapshot" | jq

# Create snapshot
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/snapshot" \
  -d "snapname=snap1" -d "description=Before update"

# Rollback
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/snapshot/{snapname}/rollback"

# Delete snapshot
curl -ks -X DELETE -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/qemu/{vmid}/snapshot/{snapname}"
```

### Tasks & Logs

```bash
# Recent tasks
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/tasks" | jq '.data[:10] | .[] | {upid, type, status, user}'

# Task log
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/tasks/{upid}/log" | jq -r '.data[].t'
```

### Storage

```bash
# List storage
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/storage" | jq '.data[] | {storage, type, active, used_fraction: (.used/.total*100|round|tostring + "%")}'

# Storage content
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/storage/{storage}/content" | jq
```

### Backups

```bash
# List backups
curl -ks -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/storage/{storage}/content?content=backup" | jq

# Start backup
curl -ks -X POST -H "$AUTH" "$PROXMOX_HOST/api2/json/nodes/{node}/vzdump" \
  -d "vmid={vmid}" -d "storage={storage}" -d "mode=snapshot"
```

## Helper Script

Use `scripts/pve.sh` for common operations:

```bash
./scripts/pve.sh status          # Cluster overview
./scripts/pve.sh vms             # List all VMs
./scripts/pve.sh start {vmid}    # Start VM
./scripts/pve.sh stop {vmid}     # Stop VM
```

## Notes

- Replace `{node}`, `{vmid}`, `{storage}`, `{snapname}` with actual values
- API tokens don't need CSRF tokens for POST/PUT/DELETE
- Use `-k` to skip SSL verification for self-signed certs
- Task operations return UPID for tracking async jobs

「运维安全」分类下的热门技能

weird-aftertaste 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。