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