Skip to content

Conversation

mrstux
Copy link

@mrstux mrstux commented Jun 6, 2025

When creating a volume of type VolumeTypeCustom with the ZFS driver the incus:content_type user property
is used to capture the ContentType. When recovering the storage pool or the volume, this
content_type is used to disambiguate the volume if it is using zfs.block_mode.

Unfortunately, when cloning the volume using zfs.clone_copy mode the content_type is lost
and the filesystem block mode volumes are imported as block mode volumes instead.

The fix corrects by regenerating the content_type during the clone when it is still known.

A test has been added to storage_driver_zfs.sh which reproduces the issue, and confirms the fix.

Stuart Espey added 2 commits June 6, 2025 09:21
Signed-off-by: Stuart Espey <stuart.espey@mactrix.com>
…stom volume

When creating a VolumeTypeCustom volume with the ZFS driver the incus:content_type user property
is used to capture the ContentType. When recovering the storage pool or the volume, this
content_type is used to disambiguate the volume if it is using zfs.block_mode.

Unfortunately, when cloning the volume using zfs.block_copy the content_type is lost
and the filesystem block mode volumes are imported as block mode volumes instead.

The fix corrects by regenerating the content_type after cloning when it is still known.

A test has been added to storage_driver_zfs.sh which tests the issue, and the fix.

Signed-off-by: Stuart Espey <stuart.espey@mactrix.com>
@mrstux mrstux marked this pull request as ready for review June 6, 2025 09:27
@mrstux mrstux requested a review from stgraber as a code owner June 6, 2025 09:27
@mrstux mrstux changed the title incusd/storage/zfs: Fix missing incus:content_type after cloning a custom volume ZFS: Fix missing incus:content_type after cloning a custom volume Jun 6, 2025
@mrstux mrstux changed the title ZFS: Fix missing incus:content_type after cloning a custom volume incusd/storage/zfs: Fix missing incus:content_type after cloning a custom volume Jun 6, 2025
@stgraber stgraber merged commit 7228341 into lxc:main Jun 6, 2025
38 checks passed
@mrstux mrstux deleted the se/fix-zfs-content_type-after-clone branch August 1, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants