[pve-devel] Finding a VM's Node via API
lindsay.mathieson at gmail.com
Thu Jan 15 09:24:35 CET 2015
On 15 January 2015 at 17:08, Lindsay Mathieson <lindsay.mathieson at gmail.com>
> I'm adapting spice-example.sh to just require a VMID, so we can launch a
> spice client from the cmd line without needing to know which node it is on.
> Is there an API call for finding a VM's node from its id? or an
> alternative way of handling this?
/pools/<PoolName> is sufficient broad for my purposes - doesn't list all
vms, but I can pass a pool name, confident that the VM will be in there.
I'm using jq to parse the JSON output, so:
pvesh get /pools/$POOLNAME |jq -r ".members | select(.vmid == $VMID) |
returns the node for a vm
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pve-devel