[[storage_zfspool]] Local ZFS Pool Backend ---------------------- ifdef::wiki[] :pve-toplevel: :title: Storage: ZFS endif::wiki[] Storage pool type: `zfspool` This backend allows you to access local ZFS pools (or ZFS file systems inside such pools). Configuration ~~~~~~~~~~~~~ The backend supports the common storage properties `content`, `nodes`, `disable`, and the following ZFS specific properties: pool:: Select the ZFS pool/filesystem. All allocations are done within that pool. blocksize:: Set ZFS blocksize parameter. sparse:: Use ZFS thin-provisioning. A sparse volume is a volume whose reservation is not equal to the volume size. mountpoint:: The mount point of the ZFS pool/filesystem. Changing this does not affect the `mountpoint` property of the dataset seen by `zfs`. Defaults to `/`. .Configuration Example (`/etc/pve/storage.cfg`) ---- zfspool: vmdata pool tank/vmdata content rootdir,images sparse ---- File naming conventions ~~~~~~~~~~~~~~~~~~~~~~~ The backend uses the following naming scheme for VM images: vm-- // normal VM images base-- // template VM image (read-only) subvol-- // subvolumes (ZFS filesystem for containers) ``:: This specifies the owner VM. ``:: This can be an arbitrary name (`ascii`) without white space. The backend uses `disk[N]` as default, where `[N]` is replaced by an integer to make the name unique. Storage Features ~~~~~~~~~~~~~~~~ ZFS is probably the most advanced storage type regarding snapshot and cloning. The backend uses ZFS datasets for both VM images (format `raw`) and container data (format `subvol`). ZFS properties are inherited from the parent dataset, so you can simply set defaults on the parent dataset. .Storage features for backend `zfs` [width="100%",cols="m,m,3*d",options="header"] |============================================================================== |Content types |Image formats |Shared |Snapshots |Clones |images rootdir |raw subvol |no |yes |yes |============================================================================== Encryption ~~~~~~~~~~ ZFS supports encryption of dataset hierarchies. Each encrypted dataset, is either an `encryption_root`, storing the properties for encryption itself or descendant of its `encryption_root` - see the `zfs-load-key(8)` manpage for details. Sending and receiving encrypted datasets is subject to constraints as some encryption parameters (initialization vectors for the symmetric ciphers) need to be either transferred with the data, breaking inheriting the encryption properties on the receiving side, or need to be recreated on target, requiring the data to be sent unencrypted - see the `zfs-recv(8)` manpage for details. For migration and storage replication of encrypted datasets in {pve}, the data is sent without the encryption properties, and the state of encryption is determined by the target. If you want to send and receive encrypted ZFS datasets, you need to ensure that all involved storages on all nodes are encrypted. Examples ~~~~~~~~ It is recommended to create an extra ZFS file system to store your VM images: # zfs create tank/vmdata To enable compression on that newly allocated file system: # zfs set compression=on tank/vmdata You can get a list of available ZFS filesystems with: # pvesm scan zfs ifdef::wiki[] See Also ~~~~~~~~ * link:/wiki/Storage[Storage] * link:/wiki/ZFS_on_Linux[ZFS on Linux] endif::wiki[]