Using a ZFS pool for backups (iso, vztmpl)

ndejay

New Member
Dec 19, 2020
8
1
1
35
Hi,

I have a ZFS dataset intended for backing up QEMU and LXC images.

Code:
root@doctor:~# zpool list
NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
slim  1.81T   163G  1.65T        -         -     0%     8%  1.00x    ONLINE  -
root@doctor:~# zfs list
NAME               USED  AVAIL     REFER  MOUNTPOINT
slim               163G  1.60T      112K  /slim
slim/backup        138G   374G      138G  /slim/backup
slim/vz           24.3G  39.7G     24.3G  /slim/vz

I configured the PVE storage to use it for backup purposes, as follows:

Code:
root@doctor:~# cat /etc/pve/storage.cfg
dir: slim-vz
       path /slim/vz
       content iso,vztmpl,snippets
       nodes doctor,dope-dean
       shared 0

dir: slim-backup
       path /slim/backup
       content backup
       nodes doctor,dope-dean
       shared 0

However, sometimes when I reboot, PVE is loaded before ZFS and creates the whole directory tree structure and prevents the ZFS pool from being mounted where it should be.

Code:
tree /slim
/slim
├── backup
│   └── dump
└── vz
    ├── snippets
    └── template
        ├── cache
        └── iso

Is there a simple solution for this i.e. telling PVE not to create the directory structure?

Many thanks!
 
I figured it out, I simply made sure that ZFS pools are mounted before PVE storage runs.

Code:
$ cat /lib/systemd/system/pve-storage.target
After=zfs-mount.service
 
  • Like
Reactions: elriti

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!