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: Round ZFS volume sizes to nearest 16KiB #13470

Merged
merged 5 commits into from
May 23, 2024

Conversation

MggMuggins
Copy link
Contributor

This rounds ZFS volume sizes using zfs.blocksize or the openzfs default 16KiB instead of LXD's default 8KiB. Reported in #13420.

It looks like the default was changed in OpenZFS in Q3 2021: openzfs/zfs#12406

I'm not super pleased with the refactor of roundVolumeBlockSizeBytes to take a vol Volume, but we need a reference to the volume in order to query its config keys. This seemed like the least invasive way to accomplish it.

The new test fails before patches and passes after.

@simondeziel
Copy link
Member

It looks like the default was changed in OpenZFS in Q3 2021: openzfs/zfs#12406

Thanks for finding this bug! It looks like the change was integrated in OpenZFS 2.2.0. It's weird that it took so long to be noticed here.

Need to be able to check the block size associatd with a volume for zfs
(see next commit)

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions, but I think this is looking good, thanks!

Fixes canonical#13420

Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
@tomponline
Copy link
Member

Thanks!

Please can you add a test to https://github.com/canonical/lxd-ci/blob/main/tests/storage-vm so that we can ensure this fix is backported to the other tracks.

@tomponline tomponline merged commit 1514a40 into canonical:main May 23, 2024
29 checks passed
@MggMuggins MggMuggins deleted the fix-zfs-size-rounding branch May 23, 2024 13:13
tomponline added a commit to tomponline/lxd-pkg-snap that referenced this pull request Jun 7, 2024
For canonical/lxd#13470

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
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.

3 participants