pve-zsync backup + daily zfs snapshot

yena

Renowned Member
Nov 18, 2011
385
6
83
Hello,
i have a pve-zsync procedure to replicate a VM every 15 min and retain the last 7 snapshot.
I wold like to have also a daily snapshot of the last 15 Days.

Can i schedule every night a cron that create a snapshot of the replicated disk ?
I'm testing it:

In my test procedure every night i do a snapshot of:
rpool/BackupPrx8/subvol-103-disk-1

-----------------------------------------------------------------------------------------------------------
rpool/BackupPrx8/subvol-103-disk-1 22.7G 2.28T 22.7G /rpool/BackupPrx8/subvol-103-disk-1
rpool/BackupPrx8/subvol-103-disk-1@rep_MyContainerName_2016-11-28_15:00:02 4.43M - 22.7G -
rpool/BackupPrx8/subvol-103-disk-1@rep_MyContainerName_2016-11-28_15:45:01 180K - 22.7G -
rpool/BackupPrx8/subvol-103-disk-1@rep_MyContainerName_2016-11-28_16:00:01 180K - 22.7G -
rpool/BackupPrx8/subvol-103-disk-1@rep_MyContainerName_2016-11-28_16:45:01 1.16M - 22.7G -
rpool/BackupPrx8/subvol-103-disk-1@rep_MyContainerName_2016-11-28_17:00:01 0 - 22.7G -
rpool/BackupPrx8/subvol-103-disk-1@SnapDay_28_11_2016_17:00:18 0 - 22.7G -
rpool/BackupPrx8/subvol-103-disk-1@SnapDay_28_11_2016_17:00:55 0 - 22.7G -
--------------------------------------------------------------------------------------------------------------------------

Thanks!
 
Hi

I you zfSnap on the backup side.
It is a Debian packet and works great.
 
I just discovered zfSnap and it works like a charm.

I set it up when a reboot of one of the HA servers happened in the middle of a sync which messed up the entire database. I had to restore from the backup made 23 hours earlier and recover what I could frome the broken database.

I added a zfsnap file in my /etc/cron.d directories on all servers in the cluster. I am currently taking snapshots of all machines every 30 minutes and I keep them 3 days (I may adjust that depending on the size it takes up, etc). 'vmpool' is the name of the zfs pool.

Code:
ZFSNAP=/usr/sbin/zfSnap
6/36 * * * * root   $ZFSNAP -a 3d -p halfhour- -r vmpool
21   4 * * * root   $ZFSNAP -d

I still have to determine properly how to recover from a snapshot...

It's a real pitty that when the VM migrates from host A to host B following a host failure on host A, that the ZFS copy of that machine A is overwritten by the reverse synchronisation from B. There should be at least a snapshot of the state of the ZFS drive on machine A that failed ,made just after reboot of A and before any synchronisation from B to A.

It would be nice to have a similar solution (zfsSnap) for (external) ceph storage, and of course to see this kind of functionnality integrated in proxmox - it does not look that hard (making and destroying the snapshots, "restoring" from a snapshot).