原文链接:https://pve.proxmox.com/pve-docs/chapter-pvesh.html 最后更新:2026-02-25
pvesh是Proxmox VE的Shell接口,用于与Proxmox VE API交互。它是一个命令行工具,允许用户直接在shell中执行API调用。
pvesh <command> [OPTIONS]
pvesh get /nodes
pvesh get /nodes/{node}/status
pvesh get /cluster/resources
pvesh get /nodes/{node}/syslog
pvesh使用与Proxmox VE API相同的认证机制。您可以使用以下方式认证:
* 用户名和密码 * API令牌
* -h, –help - 显示帮助信息
* –output-format json - 以JSON格式输出
* –quiet - 安静模式
pvesh create /nodes/{node}/qemu -vmid 100 -name test-vm -ostype l26
pvesh create /nodes/{node}/qemu/100/status/start
pvesh create /nodes/{node}/qemu/100/status/stop
* pvesh是一个强大的工具,可以执行几乎所有可以通过Web界面或API执行的操作 * 使用时请小心,因为某些操作可能会导致数据丢失 * 建议在使用前先了解相应的API文档