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