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
累計下載
4981
星標
7
全站排名
#1,844
全站前 37% · 「運維安全」前 36%
平台累計安裝累計下載星標評論
ClawHub ↗15248346-
SkillHub ↗25849817—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

可檢視叢集/節點狀態、列出 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,並先給出重啟目標與命令供我確認。

月度資料趨勢

累計下載4981
3416425750972026-03 · 累計下載 35322026-05 · 累計下載 41712026-06 · 累計下載 43942026-07 · 累計下載 46392026-08 · 累計下載 47242026-09 · 累計下載 498126-0326-09
星標7
6772026-03 · 星標 62026-05 · 星標 62026-06 · 星標 62026-07 · 星標 72026-08 · 星標 72026-09 · 星標 726-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094981—7
2026-084724+1.8%7
2026-074639+5.6%7
2026-064394+5.3%6
2026-054171—6
2026-033532—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),按月更新。口徑說明見資料方法。