Easy way to backup all VMs via the API, without enumerating them one by one?

victorhooi

Well-Known Member
Apr 3, 2018
250
20
58
38
Hi,

We have a test lab for users to spin up VMs on demand.

Is there an easy way to call backup on all created VMs, without needing to explicitly specify the set?

(As a hack, I assume we can enumerate the VMs using the API, and then call backup individually on each one - but I wondered if there was perhaps a cleaner way, to just do a bulk "backup all my VMs please!")

Regards,
Victor
 
you can simply copy a curl command from your browser's dev console and adapt it..
 
Update: Nevermind... don't know why didn't work before but trying it again by adding vmids as a parameters works.

--

Is it possible with one curl command to copy several vmid using the API? I would like to replicate same behaviour than a backup job but with API. Now I have one curl per each backup and would like to simplify it a bit.
I tried to add vmid=XXX&vmid=YYY and so on but only first one is back it up.
 
Last edited:

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!