]>
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 | ||
8c1189b6 | 35 | .Configuration Example (`/etc/pve/storage.cfg`) |
aa039b0f DM |
36 | ---- |
37 | zfspool: vmdata | |
38 | pool tank/vmdata | |
39 | content rootdir,images | |
40 | sparse | |
41 | ---- | |
42 | ||
5eba0743 | 43 | |
aa039b0f DM |
44 | File naming conventions |
45 | ~~~~~~~~~~~~~~~~~~~~~~~ | |
46 | ||
47 | The backend uses the following naming scheme for VM images: | |
48 | ||
49 | vm-<VMID>-<NAME> // normal VM images | |
50 | base-<VMID>-<NAME> // template VM image (read-only) | |
51 | subvol-<VMID>-<NAME> // subvolumes (ZFS filesystem for containers) | |
52 | ||
53 | `<VMID>`:: | |
54 | ||
55 | This specifies the owner VM. | |
56 | ||
57 | `<NAME>`:: | |
58 | ||
5eba0743 | 59 | This can be an arbitrary name (`ascii`) without white space. The |
aa039b0f DM |
60 | backend uses `disk[N]` as default, where `[N]` is replaced by an |
61 | integer to make the name unique. | |
62 | ||
63 | ||
64 | Storage Features | |
65 | ~~~~~~~~~~~~~~~~ | |
66 | ||
67 | ZFS is probably the most advanced storage type regarding snapshot and | |
68 | cloning. The backend uses ZFS datasets for both VM images (format | |
69 | `raw`) and container data (format `subvol`). ZFS properties are | |
70 | inherited from the parent dataset, so you can simply set defaults | |
71 | on the parent dataset. | |
72 | ||
73 | .Storage features for backend `zfs` | |
74 | [width="100%",cols="m,m,3*d",options="header"] | |
75 | |============================================================================== | |
76 | |Content types |Image formats |Shared |Snapshots |Clones | |
77 | |images rootdir |raw subvol |no |yes |yes | |
78 | |============================================================================== | |
79 | ||
5eba0743 | 80 | |
aa039b0f DM |
81 | Examples |
82 | ~~~~~~~~ | |
83 | ||
5eba0743 | 84 | It is recommended to create an extra ZFS file system to store your VM images: |
aa039b0f DM |
85 | |
86 | # zfs create tank/vmdata | |
87 | ||
5eba0743 | 88 | To enable compression on that newly allocated file system: |
aa039b0f DM |
89 | |
90 | # zfs set compression=on tank/vmdata | |
91 | ||
92 | You can get a list of available ZFS filesystems with: | |
93 | ||
94 | # pvesm zfsscan | |
deb4673f DM |
95 | |
96 | ifdef::wiki[] | |
97 | ||
98 | See Also | |
99 | ~~~~~~~~ | |
100 | ||
f532afb7 | 101 | * link:/wiki/Storage[Storage] |
deb4673f | 102 | |
b3b9becb DM |
103 | * link:/wiki/ZFS_on_Linux[ZFS on Linux] |
104 | ||
deb4673f | 105 | endif::wiki[] |