]>
Commit | Line | Data |
---|---|---|
8119f671 | 1 | [[storage_zfspool]] |
aa039b0f DM |
2 | Local ZFS Pool Backend |
3 | ---------------------- | |
5f09af76 DM |
4 | ifdef::wiki[] |
5 | :pve-toplevel: | |
cb84ed18 | 6 | :title: Storage: ZFS |
5f09af76 DM |
7 | endif::wiki[] |
8 | ||
aa039b0f DM |
9 | Storage pool type: `zfspool` |
10 | ||
5eba0743 | 11 | This backend allows you to access local ZFS pools (or ZFS file systems |
aa039b0f DM |
12 | inside such pools). |
13 | ||
5eba0743 | 14 | |
aa039b0f DM |
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 | ||
82f71eea FE |
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 | ||
8c1189b6 | 41 | .Configuration Example (`/etc/pve/storage.cfg`) |
aa039b0f DM |
42 | ---- |
43 | zfspool: vmdata | |
44 | pool tank/vmdata | |
45 | content rootdir,images | |
46 | sparse | |
47 | ---- | |
48 | ||
5eba0743 | 49 | |
aa039b0f DM |
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 | ||
5eba0743 | 65 | This can be an arbitrary name (`ascii`) without white space. The |
aa039b0f DM |
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 | ||
5eba0743 | 86 | |
aa039b0f DM |
87 | Examples |
88 | ~~~~~~~~ | |
89 | ||
5eba0743 | 90 | It is recommended to create an extra ZFS file system to store your VM images: |
aa039b0f DM |
91 | |
92 | # zfs create tank/vmdata | |
93 | ||
5eba0743 | 94 | To enable compression on that newly allocated file system: |
aa039b0f DM |
95 | |
96 | # zfs set compression=on tank/vmdata | |
97 | ||
98 | You can get a list of available ZFS filesystems with: | |
99 | ||
100 | # pvesm zfsscan | |
deb4673f DM |
101 | |
102 | ifdef::wiki[] | |
103 | ||
104 | See Also | |
105 | ~~~~~~~~ | |
106 | ||
f532afb7 | 107 | * link:/wiki/Storage[Storage] |
deb4673f | 108 | |
b3b9becb DM |
109 | * link:/wiki/ZFS_on_Linux[ZFS on Linux] |
110 | ||
deb4673f | 111 | endif::wiki[] |