backup only running VMs

badsmoke

Member
Nov 12, 2020
14
0
6
34
hello,

we have some VMs on our system that are off almost all the time. but this can change weekly.


I would find a backup "selection mode" good in which you select "include running VMs".

that might be useful for others as well
 
Hi,

you could also try to automate this using the API. Off the top of my head I could imagine:
  1. Get all VMs through /cluster/resources
  2. Manually run the backup on all instances which have the "running" status
this might be a bit racy though, since VMs could change their state in the time between querying and actually doing the backup. Otherwise, you could also just query the status of each VM right before you do the backup (/nodes/{node}/qemu/{vmid}/status/current).
 
As an alternative, create a pool "do_backup_this" and schedule the backup task to use that pool. Then change the pool membership to include/exclude the VM's that must be copied.

Check the bug reports that Neobin linked above as they expose a few corner cases were you might get changes in your VMs that won't be backed up.
 
  • Like
Reactions: badsmoke

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!