Command Line: List all containers, vm in a cluster

steff123

Member
Aug 1, 2020
55
2
13
43
When running pct list or qm list I get the objects on the current node. How can I get all objects in one cluster?
 
I realize that this is an ancient thread, but I stumbled across this looking for an answer to this very same question.

The stated "use pvesh" answer isn't entirely helpful; nor is "man pvesh", for that matter. After some sputtering I found that pvesh get cluster/nextid got me the answer I needed - the next available instance ID (100+n+1).

But I still have no idea how to get a list of all instances that are in my cluster, from ID 100 through 100+n. Maybe this is an odd question to ask...
 
  • Like
Reactions: Gerk
fter some sputtering I found that pvesh get cluster/nextid got me the answer I needed - the next available instance ID (100+n+1).
Hi @maarten256 , the request of the OP in this thread was not to find next available ID. But good for you on finding the correct API call for your needs.
But I still have no idea how to get a list of all instances that are in my cluster, from ID 100 through 100+n. Maybe this is an odd question to ask...
Its a good question to ask. Here is a collection of mostly more recent threads with examples of how to extract various data:
https://forum.proxmox.com/threads/get-individual-per-vm-disk-info-via-api.143443/#post-644558

While "man pvesh" is definitely a resource you should be familiar with, the more fundamental documentation can be found here:
https://pve.proxmox.com/pve-docs/api-viewe

Cheers.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
I know this thread is existing for long time , but I came across today as I needed to list all VMs in our cluster and I couldn't find the correct command , so I am sharing the command here
command pvesh get cluster/resources will list all available resources like nodes , networks and VMs , so you need to filter for qemu only

Code:
pvesh get cluster/resources --output-format json \
| jq -r '.[] | select(.type=="qemu") | .name'
 
  • Like
Reactions: bbgeek17