]> git.proxmox.com Git - pve-docs.git/blame - pve-storage-zfspool.adoc
update link qemu documentation non web.archive
[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
82f71eea
FE
35mountpoint::
36
37The mount point of the ZFS pool/filesystem. Changing this does not
38affect the `mountpoint` property of the dataset seen by `zfs`.
39Defaults to `/<pool>`.
40
8c1189b6 41.Configuration Example (`/etc/pve/storage.cfg`)
aa039b0f
DM
42----
43zfspool: vmdata
44 pool tank/vmdata
45 content rootdir,images
46 sparse
47----
48
5eba0743 49
aa039b0f
DM
50File naming conventions
51~~~~~~~~~~~~~~~~~~~~~~~
52
53The 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
61This specifies the owner VM.
62
63`<NAME>`::
64
5eba0743 65This can be an arbitrary name (`ascii`) without white space. The
aa039b0f
DM
66backend uses `disk[N]` as default, where `[N]` is replaced by an
67integer to make the name unique.
68
69
70Storage Features
71~~~~~~~~~~~~~~~~
72
73ZFS is probably the most advanced storage type regarding snapshot and
74cloning. The backend uses ZFS datasets for both VM images (format
75`raw`) and container data (format `subvol`). ZFS properties are
76inherited from the parent dataset, so you can simply set defaults
77on 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
5eba0743 86
aa039b0f
DM
87Examples
88~~~~~~~~
89
5eba0743 90It is recommended to create an extra ZFS file system to store your VM images:
aa039b0f
DM
91
92 # zfs create tank/vmdata
93
5eba0743 94To enable compression on that newly allocated file system:
aa039b0f
DM
95
96 # zfs set compression=on tank/vmdata
97
98You can get a list of available ZFS filesystems with:
99
100 # pvesm zfsscan
deb4673f
DM
101
102ifdef::wiki[]
103
104See Also
105~~~~~~~~
106
f532afb7 107* link:/wiki/Storage[Storage]
deb4673f 108
b3b9becb
DM
109* link:/wiki/ZFS_on_Linux[ZFS on Linux]
110
deb4673f 111endif::wiki[]