Storage: ZFS: Difference between revisions
(fix duplicate import) |
No edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 18: | Line 18: | ||
Use ZFS thin-provisioning. A sparse volume is a volume whose | Use ZFS thin-provisioning. A sparse volume is a volume whose | ||
reservation is not equal to the volume size. | reservation is not equal to the volume size. | ||
mountpoint | |||
The mount point of the ZFS pool/filesystem. Changing this does not | |||
affect the mountpoint property of the dataset seen by zfs. | |||
Defaults to /<pool>. | |||
Configuration Example (/etc/pve/storage.cfg) | Configuration Example (/etc/pve/storage.cfg) | ||
zfspool: vmdata | zfspool: vmdata | ||
Line 25: | Line 29: | ||
File naming conventions | File naming conventions | ||
The backend uses the following naming scheme for VM images: | The backend uses the following naming scheme for VM images: | ||
vm- | vm-<VMID>-<NAME> // normal VM images | ||
base- | base-<VMID>-<NAME> // template VM image (read-only) | ||
subvol- | subvol-<VMID>-<NAME> // subvolumes (ZFS filesystem for containers) | ||
<VMID> | |||
This specifies the owner VM. | This specifies the owner VM. | ||
<NAME> | |||
This can be an arbitrary name (ascii) without white space. The | This can be an arbitrary name (ascii) without white space. The | ||
backend uses disk[N] as default, where [N] is replaced by an | backend uses disk[N] as default, where [N] is replaced by an | ||
Line 60: | Line 64: | ||
See Also | See Also | ||
Storage | Storage | ||
ZFS on Linux | |||
</pvehide> | </pvehide> | ||
<!--PVE_IMPORT_END_MARKER--> | <!--PVE_IMPORT_END_MARKER--> | ||
Latest revision as of 08:08, 6 December 2019
Storage pool type: zfspool
This backend allows you to access local ZFS pools (or ZFS file systems inside such pools).
Configuration
The backend supports the common storage properties content, nodes, disable, and the following ZFS specific properties:
- pool
-
Select the ZFS pool/filesystem. All allocations are done within that pool.
- blocksize
-
Set ZFS blocksize parameter.
- sparse
-
Use ZFS thin-provisioning. A sparse volume is a volume whose reservation is not equal to the volume size.
- mountpoint
-
The mount point of the ZFS pool/filesystem. Changing this does not affect the mountpoint property of the dataset seen by zfs. Defaults to /<pool>.
zfspool: vmdata pool tank/vmdata content rootdir,images sparse
File naming conventions
The backend uses the following naming scheme for VM images:
vm-<VMID>-<NAME> // normal VM images base-<VMID>-<NAME> // template VM image (read-only) subvol-<VMID>-<NAME> // subvolumes (ZFS filesystem for containers)
- <VMID>
-
This specifies the owner VM.
- <NAME>
-
This can be an arbitrary name (ascii) without white space. The backend uses disk[N] as default, where [N] is replaced by an integer to make the name unique.
Storage Features
ZFS is probably the most advanced storage type regarding snapshot and cloning. The backend uses ZFS datasets for both VM images (format raw) and container data (format subvol). ZFS properties are inherited from the parent dataset, so you can simply set defaults on the parent dataset.
Content types | Image formats | Shared | Snapshots | Clones |
---|---|---|---|---|
images rootdir |
raw subvol |
no |
yes |
yes |
Examples
It is recommended to create an extra ZFS file system to store your VM images:
# zfs create tank/vmdata
To enable compression on that newly allocated file system:
# zfs set compression=on tank/vmdata
You can get a list of available ZFS filesystems with:
# pvesm zfsscan
See Also