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