2018-07-06 13:30:33 +02:00
[[storage_zfspool]]
2016-01-05 10:02:14 +01:00
Local ZFS Pool Backend
----------------------
2016-10-08 17:22:48 +02:00
ifdef::wiki[]
:pve-toplevel:
2016-10-10 08:55:17 +02:00
:title: Storage: ZFS
2016-10-08 17:22:48 +02:00
endif::wiki[]
2016-01-05 10:02:14 +01:00
Storage pool type: `zfspool`
2016-09-27 10:58:51 +02:00
This backend allows you to access local ZFS pools (or ZFS file systems
2016-01-05 10:02:14 +01:00
inside such pools).
2016-09-27 10:58:51 +02:00
2016-01-05 10:02:14 +01:00
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.
2019-11-18 11:45:39 +01:00
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 `/<pool>`.
2016-09-27 10:58:50 +02:00
.Configuration Example (`/etc/pve/storage.cfg`)
2016-01-05 10:02:14 +01:00
----
zfspool: vmdata
pool tank/vmdata
content rootdir,images
sparse
----
2016-09-27 10:58:51 +02:00
2016-01-05 10:02:14 +01:00
File naming conventions
~~~~~~~~~~~~~~~~~~~~~~~
The backend uses the following naming scheme for VM images:
vm-<VMID>-<NAME> // normal VM images
base-<VMID>-<NAME> // template VM image (read-only)
subvol-<VMID>-<NAME> // subvolumes (ZFS filesystem for containers)
`<VMID>`::
This specifies the owner VM.
`<NAME>`::
2016-09-27 10:58:51 +02:00
This can be an arbitrary name (`ascii`) without white space. The
2016-01-05 10:02:14 +01:00
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
|==============================================================================
2016-09-27 10:58:51 +02:00
2016-01-05 10:02:14 +01:00
Examples
~~~~~~~~
2016-09-27 10:58:51 +02:00
It is recommended to create an extra ZFS file system to store your VM images:
2016-01-05 10:02:14 +01:00
# zfs create tank/vmdata
2016-09-27 10:58:51 +02:00
To enable compression on that newly allocated file system:
2016-01-05 10:02:14 +01:00
# zfs set compression=on tank/vmdata
You can get a list of available ZFS filesystems with:
# pvesm zfsscan
2016-05-04 07:22:27 +02:00
ifdef::wiki[]
See Also
~~~~~~~~
2016-08-12 10:51:16 +02:00
* link:/wiki/Storage[Storage]
2016-05-04 07:22:27 +02:00
2017-07-03 12:52:42 +02:00
* link:/wiki/ZFS_on_Linux[ZFS on Linux]
2016-05-04 07:22:27 +02:00
endif::wiki[]