Proxmox Backup to ZFS

Recently, I’ve been experimenting with switching around my homelab, which was primarily a combination of bare-metal thin clients and Docker containers, to Proxmox. One of the first complications I ran into is that there are several storage options. I tend to use ZFS anywhere and everywhere I can use it; however, in Proxmox, you can’t actually perform all of the types of operations on a Zpool that you can with LVM storage. Or… can you?

This is the default set of options for “content” that you are allowed to put in ZFS storage on Proxmox. You can see that we’re limited to “Disk image” and “Container.”

ZFS Storage Options

In contrast, for a Directory style storage you have tons of options:

Directory Storage Options

Fortunately, we can put a Directory on top of a Proxmox managed ZFS pool. First, we’ll need to have a Zpool created. Then, drop into a terminal on the VM that the Zpool exists on.

List existing Zpools

We need to create a ZFS Dataset on one of these pools, which we can do by invoking:

zfs create POOLNAME/DATASETNAME

We can also invoke compression, which can be of type:

  • on
  • off
  • lzjb
  • gzip
  • gzip-[1-9]
  • zle
  • lz4
  • zstd
  • zstd-[1-19]
  • zstd-fast
  • zstd-fast-[1-10,20,30,40,50,60,70,80,90,100,500,1000]

For my purposes, I’m using this particular drive for backups, so I chose zstd-19. This compression algorithm defaults to 3, with 1 being the fastest (1) (with the least amount of compression) to the slowest (19), but with the best compression.

zfs create -o compression=zstd-19 SSD2TB1/VMBACKUPS

Now, navigate to your Datacenter inside the Proxmox GUI:

Then, navigate to Storage and then press Add -> Directory:

For the ID, give it a descriptive name and for the Directory, provide it with the path to the ZPool, which in this case is:

/SSD2TB1/VMBACKUPS

This is in the form of /[ZPool name]/[Name of the Dataset you created from above].

Then, for content, select the types of content you want to be able to store. In my case, I simply selected all of them because, despite the name, I’ll be using this directory as a catchall for certain types of content. Anything where I care about having a balance of speed (since it’s an SSD) and high compression. This is on a pretty beefy machine with many cores and RAM, so I’m not too concerned about the zstd-19 performance.

Important Caveat!
Note that this Directory datatype puts a folder on each Proxmox node. On the node that I have the ZFS mount running on, I already had directory /SSD2TB1, so adding this new data source added /SSD2TB1/VMBACKUPS inside the Zpool. However, on machines that do not have the ZFS mount, this will create a directory on the root file system!

df -h of the machine with the Zpool on it
df -h; ls -ltr / of another VM

Therefore, you can’t back up or use this storage on other nodes in your cluster; only the node with the Zpool can utilize this storage!

This includes if you check the Shared box in the directory creation!

You get the same issue. The “Shared” flag does not cause something to be shared; it indicates to Proxmox that it is already shared (if it is, indeed, already Shared).

In other words, if you want to have multiple nodes connect to the same storage, you have to do the legwork to make sure that the devices are networked together (Samba, NFS-Server, etc.)

Leave a comment

Your email address will not be published.