Project | LXD |
Status | Draft |
Author(s) | @monstermunchkin |
Approver(s) | @stgraber @tomp |
Release | 5.10 |
Internal ID | LXXXX |
Abstract
This adds support for ZFS block mode.
Rationale
LXD currently doesn’t support ZFS block mode. Supporting this will allow the use of btrfs, ext4, and xfs filesystems on top of ZFS.
Specification
Design
The following new configuration keys will be added for ZFS storage pools:
volume.zfs.block_mode
volume.block.mount_options
volume.block.filesystem
Setting volume.zfs.block_mode
to true
on the storage pool will turn on ZFS block mode. This setting can be changed per-volume, setting zfs.block_mode
on the volume itself. This will use ZFS zvols instead of ZFS datasets. Zvols need to be formatted with a filesystem. The default FS will be ext4
but can be configured using the volume.block.filesystem
configuration key.
Once ZFS block mode is turned on, new instances will be created as zvols. Existing instances which use datasets will not be converted to zvols. Also, copying dataset based instances will not create zvols but instead create new datasets.
Zvols will follow the same naming pattern as the existing datasets except for images. These will be suffixed with the filesystem they were formatted with.
Example:
default/images/999c7ff6585ab0bcc6ff21736407cfd494dcdde2c68907512fef2b307a25c36b_ext4
If there are both a zvol and a dataset for the same image, this will not create an additional database record.
When deleting image storage volumes, it will attempt to delete both datasets and zvols.
API changes
No API changes.
CLI changes
No CLI changes.
Database changes
No database changes.
Upgrade handling
No upgrading handling.
Further information
No further information.