List where each VM is hosted

ejc317

Member
Oct 18, 2012
263
0
16
Is there a way to show all the vms in the cluster and which node its on?

We're coding a custom panel so need to know - also if apache is down will the api work? We're deciding between api or ssh tunelling
 
Is there a way to show all the vms in the cluster and which node its on?

We're coding a custom panel so need to know - also if apache is down will the api work? We're deciding between api or ssh tunelling



Quick one liner that may do what you want though it only works with KVM guests. Run this from any node in the cluster and it will show the cluster node name and the guest name.

find /etc/pve/nodes/*/qemu-server -type f |xargs grep 'name:' |perl -pi -e 's|/etc/pve/nodes/([^/]*)/.*name:(.*)$|\1 \2|'
 
Is there a way to show all the vms in the cluster and which node its on?

The url is '/cluster/resources'

To test you can use:

# pvesh get /cluster/resources

We're coding a custom panel so need to know - also if apache is down will the api work?

No.