[SOLVED] List all VM's in specific pool with PVESH

pizza

Renowned Member
Nov 7, 2015
96
9
73
pvesh get /cluster/resources --type vm => get VM list

pvesh get /pools/xxx => show al members from pool xxx

But how can I get a list of all VM's from pool xxx with pvesh?
 
With more fields like vmid, name & node:

Code:
export mypool="pool1";pvesh get /cluster/resources --type vm  --output-format json |jq '.[]|select(.pool == env.mypool)| .vmid, .name, .node' | tr -d \" | awk
'NR%3{printf "%s ",$0;next;}1' | column -t | sort -k1 -n
 
I missed that you also had sort:
export mypool="pool1";pvesh get /cluster/resources --type vm --output-format json |jq -r 'sort_by(.vmid)|.[]|select(.pool == env.mypool)| [.vmid, .name, .node]|@tsv' 100 vm100 pve7demo1 202 Copy-of-VM-vm200 pve7demo1 2000 vm2000 pve7demo1


Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: UdoB