ProxmoxGuide
Isometric storage server with rows of drive bays under a glowing cyan cylinder of data blocks, cubes streaming down to the disks, and a lit cache module.
storage

Proxmox ZFS Storage: Pools, Zvols, volblocksize, ARC

Set up Proxmox VE on ZFS, choose mirrors or RAIDZ for VM disks, set and verify zvol block size, and cap ARC to leave RAM for guests.

By ProxmoxGuide Editorial · ·Updated · 7 min read

For Proxmox VE on ZFS, use a mirrored boot pool if the host needs to survive a boot disk failure. Favor a separate pool built from mirrors for VM disks with heavy random I/O. Set the storage’s block size before creating VM disks, then check that the ZFS ARC cap leaves room for the host and guests. Proxmox VE ZFS guide

Should you run Proxmox on ZFS?

ZFS suits hosts that need checksummed storage, snapshots and clones, and have RAM available for the cache. If you only have room for one boot drive, decide whether checksums and snapshots alone justify root-on-ZFS. A separate guest pool is also an option if you prefer a simpler host filesystem. Proxmox VE ZFS guide

Root-on-ZFS and the boot pool

The Proxmox installer offers mirrored and RAIDZ layouts for root-on-ZFS. It creates the host pool as rpool and registers rpool/data as local-zfs for guest storage. Keep guest disks on a separate pool if you want to manage their capacity and layout independently of the boot disks. Proxmox VE ZFS guide

Replacing a boot disk. Run proxmox-boot-tool status to identify the boot setup. Restoring the mirror and preparing a boot partition are separate steps. Verify the healthy and replacement disk identifiers first. The partition copy overwrites the replacement disk’s partition table, and formatting erases the contents of its EFI System Partition (ESP). Proxmox VE failed boot device procedure · Proxmox VE host bootloader guide

On a host managed by proxmox-boot-tool, substitute your device names and run the following as root. This example uses the installer pool name rpool. Proxmox VE failed boot device procedure

sgdisk <healthy-boot-disk> -R <replacement-disk>
sgdisk -G <replacement-disk>
zpool replace -f rpool <failed-zfs-partition> <replacement-zfs-partition>
zpool status -v
proxmox-boot-tool format <replacement-esp>
proxmox-boot-tool init <replacement-esp>

If the existing disks use GRUB through proxmox-boot-tool, append grub to the init command. A host using plain GRUB needs the separate procedure in the guide. Proxmox VE failed boot device procedure

If you need swap, prefer a partition on a physical disk. Swap on a zvol can cause stalls or heavy I/O. For planning the host layout, see hardware requirements and how to install Proxmox VE. Proxmox VE swap guidance

How Proxmox stores a VM disk on ZFS

  • Local ZFS pool storage (zfspool). VM disks are raw ZFS volumes, or zvols, with native snapshots and clones. LXC containers use ZFS filesystem subvolumes, sized with refquota when a size is set. The zvol block-size setting applies to VM disks. Proxmox VE ZFS backend guide · Proxmox VE backend implementation
  • Directory storage on a ZFS filesystem. VM images can be files such as raw or qcow2. Directory storage also holds ISOs, container templates and backups. The backend uses qcow2’s own snapshots and clones for VM images. Proxmox VE Directory backend guide

The sparse setting enables thin provisioning for zvols. This lets the total disk sizes promised to guests exceed the space the pool has available. Track actual pool usage so there is room for guest writes. For the guest format tradeoff, see LXC vs VM. Proxmox VE ZFS backend guide · OpenZFS volume reservations

Choosing and checking volblocksize

Set blocksize on the zfspool storage in /etc/pve/storage.cfg before creating VM disks. This example puts a 16 KiB block size on storage vmdata, backed by an existing ZFS dataset named tank/vmdata. Once data has been written, using a different volblocksize requires a new zvol. Proxmox VE storage configuration · Proxmox VE block-size format · OpenZFS volume properties

zfspool: vmdata
        pool tank/vmdata
        content images,rootdir
        blocksize 16k

The Proxmox backend passes an explicit size when blocksize is set. For a new zvol with that option unset, OpenZFS supplies its default. The OpenZFS 2.1 manual lists 8 KiB, and OpenZFS changed the default to 16 KiB in 2.2. Proxmox VE allocation code · OpenZFS 2.1 volume properties · OpenZFS workload tuning

Check the actual property on the host. Substitute the pool, dataset and zvol name for your VM disk. OpenZFS property commands · Proxmox VE volume naming

zfs get volblocksize tank/vmdata/vm-100-disk-0

Smaller blocks can reduce I/O amplification for small random writes but add metadata and can waste space on RAIDZ. Larger blocks give compression more data to work with but can increase the work needed for partial writes. Use 16 KiB as a starting point and check it against your workload, especially for database guests with small writes. Choose ashift at vdev creation to suit the drives’ sector size. OpenZFS workload tuning

RAIDZ capacity and VM workloads

On RAIDZ, small zvol blocks spend a larger share of each allocation on parity and sector rounding. For example, with RAIDZ2 and ashift=12, an 8 KiB data block needs two 4 KiB parity sectors in Proxmox’s simplified calculation. That totals 16 KiB before accounting for compression or metadata. Proxmox VE RAID level considerations · OpenZFS workload tuning

Check zvol usage with the command below. Compare volsize with refreservation on a reserved zvol. On a sparse zvol, compare space used inside the guest with used before taking snapshots, which can affect that number. Proxmox VE RAID level considerations

zfs get volsize,refreservation,used tank/vmdata/vm-100-disk-0

Favor mirrors for VM disks where small random I/O matters. Consider RAIDZ for bulk storage when usable capacity matters more. If VM disks have to live on RAIDZ, check pool use with a representative workload before settling on a block size. Plan the layout with the ZFS pool capacity calculator. For other storage designs, see Proxmox Ceph storage and Proxmox vs TrueNAS SCALE. OpenZFS pool geometry

Sizing ARC when guests compete for RAM

ARC caches ZFS reads in host RAM. Starting with Proxmox VE 8.1, new installs set its limit to 10% of host RAM, up to 16 GiB. On hosts first installed before 8.1, check /etc/modprobe.d/zfs.conf for an explicit cap. OpenZFS caching guide · Proxmox VE ARC guidance

With zfs_arc_max unset or zero, OpenZFS 2.2 on Linux uses half of system memory as the limit. The 2.3 manual gives the larger of RAM minus 1 GiB and five-eighths of RAM. Use the installer setting and installed OpenZFS release to interpret what you see on the host. OpenZFS 2.2 module parameters · OpenZFS 2.3 module parameters

Budget for the peak memory of guests that run together, then reserve RAM for the host and room for spikes. As an example budget, 64 GiB total minus 48 GiB for guests and 8 GiB for the host and headroom leaves 8 GiB for ARC. Treat that as a ceiling for this example and check storage performance after changing the cap.

  1. Add or update the following line in /etc/modprobe.d/zfs.conf for an 8 GiB cap. The value is in bytes. Proxmox VE ARC guidance

    options zfs zfs_arc_max=8589934592
  2. If the host boots from ZFS, regenerate the initramfs as root with the command below. Then reboot the host during a maintenance window to load the persistent setting. Proxmox VE ARC guidance

    update-initramfs -u -k all
  3. Under a typical VM workload, run zarcsummary for a snapshot and zarcstat 1 to watch ARC behavior. Before OpenZFS 2.4.0, use arc_summary and arcstat 1. Check cache activity alongside guest memory pressure before adjusting the cap again. OpenZFS caching guide

For a temporary change, Proxmox documents writing to /sys/module/zfs/parameters/zfs_arc_max. If the cap is at or below zfs_arc_min, check the documented minimum adjustment before trying it. ARC may stay above the lowered limit until memory pressure causes it to shrink. Proxmox VE ARC guidance · OpenZFS 2.3 module parameters

Keep the default VM disk cache mode, No cache, as a starting point. It bypasses the host page cache. Consider an L2ARC device only after looking at read behavior and available RAM, since its cached blocks still need headers in ARC. Proxmox VE VM disk cache · OpenZFS caching guide

Settings for VM disks and ZFS datasets

  • Compression. Use LZ4 as a starting point. It can reduce space and disk I/O for compressible data. OpenZFS workload tuning
  • Discard. Enable Discard on a thin-provisioned VM disk when the guest supports TRIM. This lets the guest tell the storage which blocks can be reclaimed. Some guests also need SSD Emulation to issue TRIM. That flag is unavailable on VirtIO Block disks. Proxmox VE Trim/Discard documentation
  • Synchronous writes. Keep sync=standard for VM storage. With sync=disabled, ZFS can acknowledge a synchronous write before it reaches stable storage, so a crash can lose acknowledged writes. OpenZFS sync property
  • Access times. On a ZFS filesystem, atime=off suppresses file access-time updates. Consider it for a directory-backed store only if the software using those files can do without access times. OpenZFS atime property
  • Special vdevs. A special vdev holds pool metadata and can also hold small file blocks. Match its redundancy to the rest of the pool because it carries data the pool needs. OpenZFS caching and auxiliary devices

Replication and backups

Proxmox storage replication copies local ZFS guest disks to another node on a schedule using snapshots. If a node fails, changes since the last successful sync can be lost. Factor that gap into your high availability and cluster plans. Proxmox VE storage replication guide

Snapshots are stored in the source pool. Use them for rollback and keep independent backups to recover from losing the pool. See Proxmox snapshots explained and Proxmox Backup Server. OpenZFS snapshot concepts

Evidence and limits. The procedures were checked against Proxmox VE documentation and OpenZFS 2.1 through 2.4 references. No hands-on testing was performed for this guide.

Sources

  1. Proxmox VE ZFS on Linux
  2. Proxmox VE Host Bootloader
  3. Proxmox VE Local ZFS Pool Backend
  4. Proxmox VE Directory Backend
  5. Proxmox VE ZFS pool backend implementation
  6. Proxmox VE QEMU/KVM Virtual Machines
  7. Proxmox VE Storage Replication
  8. OpenZFS Workload Tuning
  9. OpenZFS 2.1 dataset properties
  10. OpenZFS 2.3 dataset properties
  11. OpenZFS 2.3 dataset property commands
  12. OpenZFS 2.2 module parameters
  13. OpenZFS 2.3 module parameters
  14. OpenZFS Caching and Auxiliary Devices
  15. OpenZFS 2.3 snapshot concepts

Related