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.
 

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!