Will I screw anything up if I create my OWN zfs snapshots of lxc/qm disks which I have on zfs?

loneboat

Member
Jan 17, 2019
36
2
13
32
I keep my LXC container and QM VM disks on a ZFS filesystem. I don't know much about how PVE manages the ZFS snapshots associated with a given container/vm, but I do see in my filesystem that it does have various snapshots which it creates for migrations etc:

Code:
root@node1:~# zfs list -r -t snapshot tank/proxmox/lxc-containers |head
NAME                                                                            USED  AVAIL     REFER  MOUNTPOINT
tank/proxmox/lxc-containers/basevol-130-disk-0@__base__                           0B      -     1.10G  -
tank/proxmox/lxc-containers/basevol-130-disk-0@__replicate_130-1_1645779656__     0B      -     1.10G  -
tank/proxmox/lxc-containers/basevol-130-disk-0@__replicate_130-0_1645781475__     0B      -     1.10G  -
tank/proxmox/lxc-containers/basevol-131-disk-0@__base__                           0B      -     1.11G  -
tank/proxmox/lxc-containers/basevol-131-disk-0@__replicate_131-1_1645779662__     0B      -     1.11G  -
tank/proxmox/lxc-containers/basevol-131-disk-0@__replicate_131-2_1645781482__     0B      -     1.11G  -
tank/proxmox/lxc-containers/basevol-133-disk-0@__base__                           0B      -     1.11G  -
tank/proxmox/lxc-containers/basevol-133-disk-0@__replicate_133-1_1645779670__     0B      -     1.11G  -
tank/proxmox/lxc-containers/basevol-133-disk-0@__replicate_133-0_1645781490__     0B      -     1.11G  -

root@node1:~# zfs list -r -t snapshot tank/proxmox/vm-disks |head
NAME                                                                 USED  AVAIL     REFER  MOUNTPOINT
tank/proxmox/vm-disks/vm-117-disk-0@__replicate_117-0_1645779637__     0B      -      129G  -
tank/proxmox/vm-disks/vm-117-disk-0@__replicate_117-1_1645781451__     0B      -      129G  -
tank/proxmox/vm-disks/vm-137-disk-0@__replicate_137-0_1645779682__     0B      -     54.2G  -
tank/proxmox/vm-disks/vm-137-disk-0@__replicate_137-1_1645781504__     0B      -     54.2G  -
tank/proxmox/vm-disks/vm-154-disk-0@__replicate_154-1_1645779847__     0B      -     42.9G  -
tank/proxmox/vm-disks/vm-154-disk-0@__replicate_154-0_1645781402__     0B      -     42.9G  -

I'm looking at using a script I found for managing automated zfs snapshots here: https://github.com/zfsonlinux/zfs-auto-snapshot, which takes daily, weekly, and monthly snapshots automatically. However I do not know if doing so would mess up anything with Proxmox. The scripts snapshots would be kind of mixed in with Proxmox's own snapshots of the volumes, and I don't know if that would throw anything off when Proxmox is trying to manage its own generated snapshots.

Is this a common thing to do? Can I freely create snapshots at the ZFS level without interfering with Proxmox's operation? Or is this something I should avoid?
 

Dunuin

Famous Member
Jun 30, 2020
8,016
1,994
149
Germany
Why don't you just use this script instead: https://github.com/Corsinvest/cv4pve-autosnap?
Its also auto creating/deleting ZFS snapshots but this using the PVE API or PVE CLI tools so all snapshots are correctly created/deleted by PVE. So it can't screw things up because you get the same snapshots like manually taking them in the webUI. And it also can make use of fsfreeze (if the qemu-guest-agent is installed) and save additional RAM dumps with the snapshots so in contrast to normal ZFS snapshots done using "zfs create" these snapshot will be consistent even when snapshotting a running guest.
 
Last edited:

loneboat

Member
Jan 17, 2019
36
2
13
32
Why don't you just use this script instead: https://github.com/Corsinvest/cv4pve-autosnap?
Its also auto creating/deleting ZFS snapshots but this using the PVE API or PVE CLI tools so all snapshots are correctly created/deleted by PVE. So it can't screw things up because you get the same snapshots like manually taking them in the webUI. And it also can make use of fsfreeze (if the qemu-guest-agent is installed) and save additional RAM dumps with the snapshots so in contrast to normal ZFS snapshots done using "zfs create" these snapshot will be consistent even when snapshotting a running guest.


Hmmm, I'll have a look at this. The reason I was hoping to do plain-vanilla ZFS snapshots is because I intend to use this same process to snapshot some other (non-PVE) zfs datasets as well. But your points about fsfreeze and RAM dumps are good - maybe I just need to split my automatic-snapshot process into two - one for my PVE stuff, and one for my non-PVE stuff.

Thanks for the suggestion!
 

LnxBil

Famous Member
Feb 21, 2015
6,660
878
163
Saarland, Germany
Just a little addendum:
LX(C) containers are easier, because you don't have the RAM part and everything is always atomic and consistent with ZFS.
 

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 your own in 60 seconds.

Buy now!