]> git.proxmox.com Git - pve-docs.git/blame - pve-storage-zfspool.adoc
Fix formatting failure
[pve-docs.git] / pve-storage-zfspool.adoc
CommitLineData
aa039b0f
DM
1Local ZFS Pool Backend
2----------------------
5f09af76
DM
3ifdef::wiki[]
4:pve-toplevel:
cb84ed18 5:title: Storage: ZFS
5f09af76
DM
6endif::wiki[]
7
aa039b0f
DM
8Storage pool type: `zfspool`
9
5eba0743 10This backend allows you to access local ZFS pools (or ZFS file systems
aa039b0f
DM
11inside such pools).
12
5eba0743 13
aa039b0f
DM
14Configuration
15~~~~~~~~~~~~~
16
17The backend supports the common storage properties `content`, `nodes`,
18`disable`, and the following ZFS specific properties:
19
20pool::
21
22Select the ZFS pool/filesystem. All allocations are done within that
23pool.
24
25blocksize::
26
27Set ZFS blocksize parameter.
28
29sparse::
30
31Use ZFS thin-provisioning. A sparse volume is a volume whose
32reservation is not equal to the volume size.
33
8c1189b6 34.Configuration Example (`/etc/pve/storage.cfg`)
aa039b0f
DM
35----
36zfspool: vmdata
37 pool tank/vmdata
38 content rootdir,images
39 sparse
40----
41
5eba0743 42
aa039b0f
DM
43File naming conventions
44~~~~~~~~~~~~~~~~~~~~~~~
45
46The backend uses the following naming scheme for VM images:
47
48 vm-<VMID>-<NAME> // normal VM images
49 base-<VMID>-<NAME> // template VM image (read-only)
50 subvol-<VMID>-<NAME> // subvolumes (ZFS filesystem for containers)
51
52`<VMID>`::
53
54This specifies the owner VM.
55
56`<NAME>`::
57
5eba0743 58This can be an arbitrary name (`ascii`) without white space. The
aa039b0f
DM
59backend uses `disk[N]` as default, where `[N]` is replaced by an
60integer to make the name unique.
61
62
63Storage Features
64~~~~~~~~~~~~~~~~
65
66ZFS is probably the most advanced storage type regarding snapshot and
67cloning. The backend uses ZFS datasets for both VM images (format
68`raw`) and container data (format `subvol`). ZFS properties are
69inherited from the parent dataset, so you can simply set defaults
70on the parent dataset.
71
72.Storage features for backend `zfs`
73[width="100%",cols="m,m,3*d",options="header"]
74|==============================================================================
75|Content types |Image formats |Shared |Snapshots |Clones
76|images rootdir |raw subvol |no |yes |yes
77|==============================================================================
78
5eba0743 79
aa039b0f
DM
80Examples
81~~~~~~~~
82
5eba0743 83It is recommended to create an extra ZFS file system to store your VM images:
aa039b0f
DM
84
85 # zfs create tank/vmdata
86
5eba0743 87To enable compression on that newly allocated file system:
aa039b0f
DM
88
89 # zfs set compression=on tank/vmdata
90
91You can get a list of available ZFS filesystems with:
92
93 # pvesm zfsscan
deb4673f
DM
94
95ifdef::wiki[]
96
97See Also
98~~~~~~~~
99
f532afb7 100* link:/wiki/Storage[Storage]
deb4673f 101
b3b9becb
DM
102* link:/wiki/ZFS_on_Linux[ZFS on Linux]
103
deb4673f 104endif::wiki[]