I have some maintenance scripts where I need to pause/resume a set of VMs on my PVE 9.1 cluster. I want this script to operate on all VMs that are set to auto-start (
I found the
I can get what I'm after by looping over each node, getting a list of VMs with
...but with 3 nodes and 20-25 VMs, this ends up being 75 API calls to get a simple list of VMs that are set to autostart across the whole cluster.
Is there a more efficient way?
onboot=1)I found the
/nodes/{node}/qemu API endpoint, but sadly the onboot parameter is not included in its output.I can get what I'm after by looping over each node, getting a list of VMs with
/nodes/{node}/qemu, and then iterating over every single VM ID with /nodes/{node}/qemu/{vmid}/config --output-format json | jq .onboot...but with 3 nodes and 20-25 VMs, this ends up being 75 API calls to get a simple list of VMs that are set to autostart across the whole cluster.
Is there a more efficient way?