Is there a NON-host way to automate zfs dataset snapshot creation?

MrPete

Well-Known Member
Aug 6, 2021
128
67
48
68
Before I waste a bunch of time on this... has anybody either succeeded in doing this in an LXC, or ("expertly") concluded that zfs snapshot automation must be done in the PVE host?

I too of course would love to see Proxmox add a feature for dataset snapshot automation ( every M minutes, every H hours, D days, W weeks, M months... plus retained counts for each), compatible with windows previous-version tools (ie timestamp at end of snapshot name, and no colons ;) )...

But we don't have that. I see plenty of addons that can be installed in the host for this.

BUT: can it be done in an LXC in 2026? Or perhaps the near future?
 
Well, I believe handling the hardware storage manage should be done from the host. But you may find a way to run command on the host from a container. Think a stringent configured ssh account which can only run specific enumerated commands like "ssh user@pvehost zfs snapshot pool/home/johndoe@johndoe".

That said..., and just to mention my own choice of tools: you already noticed that there are several external PVE tools out there. I use https://github.com/Corsinvest/cv4pve-autosnap for VMs and zfs-auto-snapshot for non-VM datasets to create snapshots by time schedule.

Then, for the end users: take a look at https://github.com/bashclub/zamba-lxc-toolbox

They do Samba with ZFS-snapshots which are simply visible in the Windows File Explorer as "Previous Versions". It is a Container with mount-points, so no VM overhead with pass-through problems required.

You probably don't want to change your server part - and it is not clear if you run Samba or something else. But if you do use Samba then a peek into their resulting smb.conf might reveal some interesting details regarding the "shadow"-settings.