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