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

pizza

Renowned Member
Nov 7, 2015
96
8
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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!