Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: Fix ZFS incorrect VM cached image volume regeneration when zfs.block_mode enabled #12077

Merged
merged 6 commits into from
Jul 25, 2023

Conversation

tomponline
Copy link
Member

@tomponline tomponline commented Jul 25, 2023

The root cause of this issue was that filesystem block volume related settings were incorrectly being stored for ZFS VM block volumes. This PR changes that so that only filesystem volumes using ZFS block mode have the volume block settings stored.

Fixes #12067
Closes #12075

This will use the underlying pool's isBlockBacked() function rather than relying on the pool's static BlockBacking setting,
as this may change on a per volume basis.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Removes redundant blockBacked argument and instead relies on the vol.IsBlockBacked function,
which uses the pools' underlying isBlockBacked() function rather than using the pools static BlockBacking setting.
This allows for block backing setting to be altered on a per-volume basis.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
…Image when comparing cached volumes

This allows for logic inside FillVolumeConfig to alter the default settings for new volumes and these then
be used for the comparison with the previous cached image volumes, rather than only considering the pool
config directly.

This is needed for ZFS because zfs.block_mode can be enabled on the pool, but it shouldn't be used for
comparison with VM image volumes because its not relevant for VM image volumes.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
…ettings for VM volumes in FillVolumeConfig

As these are not used.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
@tomponline tomponline self-assigned this Jul 25, 2023
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
@tomponline tomponline marked this pull request as ready for review July 25, 2023 19:25
@tomponline tomponline merged commit 9145785 into canonical:main Jul 25, 2023
@tomponline tomponline deleted the tp-storage-zfs-blockmode branch July 25, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LXD 5.16 - Creating new virtual machine instances import again the image on creation
2 participants