Scheduled snapshots

Syndicate

Member
Oct 5, 2019
23
1
6
31
Hi,

Is there a way to schedule snapshots? the backup schedule in datacenter makes snapshots but it doesn't save RAM apparently because the vm is not at the right state when restoring those backups.

Haven't found a way to do this from the GUI, seems like a simple feature.

Thanks
 
Is there a way to schedule snapshots?
...
Haven't found a way to do this from the GUI, seems like a simple feature.

... and that is already a clue, that it is not that simple if you look closer. I'll try to explain "why" ...

You also cannot compare the snapshot feature on the VM with the snapshot (besides the same name) in backup. These are different things that are unfortunately for lack of a better word named the same.

but it doesn't save RAM apparently because the vm is not at the right state when restoring those backups.

It's also not in the right state if you restore them including the RAM. Firstly, you will have a jump in the internal clock. Secondly and most importantly, all network connections that were ongoing at the time of the snapshot will be long gone, so can be the internal state of those applications. If you wrote files from clients or to network storages, they will also be broken and in a unfinished state. This is the same as if you do a backup. Thirdly, operating systems are written in such a way, that crash recovery from "plugs out" events (backup) are handled, because power outages, resets etc. happen often, they are not optimised to be restored from a snapshot including RAM.

If you don't have those network conditions, you will have less problems, but in general you still do, so it does not matter what you do in the end. A backup is always better in the sense, that you normally store it off-site.
 
Thanks for such a complete explanation, I tried manual snapshots and they work 100% perfectly with what I'm trying to do giving no problems, at least for now, users can just re-log and keep going after a restore.

The only problem I have is that I can't get snapshots done automatically on a schedule, I really don't know why this isn't a feature.

The snapshot feature is already there and there's not a good reason for not automating something that can be done manually, it's what computers are for.

I just don't have the knowledge required for programming a script and adding it to cron for doing this on a schedule.
 
@Syndicate I think you are looking for this: https://github.com/Corsinvest/cv4pve-autosnap

I made an LXC container with ubuntu running crontab-ui (to manage from web instead of CLI) to save snapshots of every VM and CT from there on the schedule of my preference (hourly, daily, weekly and monthly). Those commands even delete old snapshots and let you keep the new ones.

The commands are well explained in their GitHub.
 
  • Like
Reactions: guiambros

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!