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