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