]>
Commit | Line | Data |
---|---|---|
1 | Local ZFS Pool Backend | |
2 | ---------------------- | |
3 | include::attributes.txt[] | |
4 | ||
5 | ifdef::wiki[] | |
6 | :pve-toplevel: | |
7 | :title: Storage: ZFS | |
8 | endif::wiki[] | |
9 | ||
10 | Storage pool type: `zfspool` | |
11 | ||
12 | This backend allows you to access local ZFS pools (or ZFS file systems | |
13 | inside such pools). | |
14 | ||
15 | ||
16 | Configuration | |
17 | ~~~~~~~~~~~~~ | |
18 | ||
19 | The backend supports the common storage properties `content`, `nodes`, | |
20 | `disable`, and the following ZFS specific properties: | |
21 | ||
22 | pool:: | |
23 | ||
24 | Select the ZFS pool/filesystem. All allocations are done within that | |
25 | pool. | |
26 | ||
27 | blocksize:: | |
28 | ||
29 | Set ZFS blocksize parameter. | |
30 | ||
31 | sparse:: | |
32 | ||
33 | Use ZFS thin-provisioning. A sparse volume is a volume whose | |
34 | reservation is not equal to the volume size. | |
35 | ||
36 | .Configuration Example (`/etc/pve/storage.cfg`) | |
37 | ---- | |
38 | zfspool: vmdata | |
39 | pool tank/vmdata | |
40 | content rootdir,images | |
41 | sparse | |
42 | ---- | |
43 | ||
44 | ||
45 | File naming conventions | |
46 | ~~~~~~~~~~~~~~~~~~~~~~~ | |
47 | ||
48 | The 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 | ||
56 | This specifies the owner VM. | |
57 | ||
58 | `<NAME>`:: | |
59 | ||
60 | This can be an arbitrary name (`ascii`) without white space. The | |
61 | backend uses `disk[N]` as default, where `[N]` is replaced by an | |
62 | integer to make the name unique. | |
63 | ||
64 | ||
65 | Storage Features | |
66 | ~~~~~~~~~~~~~~~~ | |
67 | ||
68 | ZFS is probably the most advanced storage type regarding snapshot and | |
69 | cloning. The backend uses ZFS datasets for both VM images (format | |
70 | `raw`) and container data (format `subvol`). ZFS properties are | |
71 | inherited from the parent dataset, so you can simply set defaults | |
72 | on 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 | ||
81 | ||
82 | Examples | |
83 | ~~~~~~~~ | |
84 | ||
85 | It is recommended to create an extra ZFS file system to store your VM images: | |
86 | ||
87 | # zfs create tank/vmdata | |
88 | ||
89 | To enable compression on that newly allocated file system: | |
90 | ||
91 | # zfs set compression=on tank/vmdata | |
92 | ||
93 | You can get a list of available ZFS filesystems with: | |
94 | ||
95 | # pvesm zfsscan | |
96 | ||
97 | ifdef::wiki[] | |
98 | ||
99 | See Also | |
100 | ~~~~~~~~ | |
101 | ||
102 | * link:/wiki/Storage[Storage] | |
103 | ||
104 | endif::wiki[] |