Repository navigation
[14.5-stable] zfs: report zvol provisioned size (volsize) in volume metrics - #6876
Merged
rene merged 1 commit intoOct 26, 2026
Merged
Conversation
4 of 7 tasks
fillImgInfo() populated ImgInfo.ActualSize (from the zfs "usedbydataset" property) but never set ImgInfo.VirtualSize. volumeHandlerZVol's GetVolumeDetails() returns imgInfo.VirtualSize as the volume's max size, so every ZFS zvol reported a provisioned size of 0: AppDiskMetric ProvisionedBytes was 0, and volume resource MaxSizeBytes was 0, for all zvol-backed volumes -- even though the zvol has a non-zero volsize (e.g. `zfs get volsize` reports 5G while ProvisionedBytes was 0). Read the "volsize" property and set VirtualSize from it. This is best-effort: fillImgInfo also runs on every dataset via GetAllZFSVolumeInfo (including filesystem datasets and the pool root, which have no volsize), so a missing or non-numeric value leaves VirtualSize at 0 rather than returning an error, to avoid dropping non-volume datasets from the results. Add an evetest regression test (TestZVolProvisionedSizeReported) on a KVM + ZFS device. It declares a single standalone empty block-device (VCOT_BLANK) volume -- no application, no image download, no data I/O, since the provisioned size is fixed at zvol creation and independent of usage -- then waits for volumemgr to create it and asserts the reported provisioned size is the zvol volsize (~1 GiB), not 0, at all three layers: ZInfoVolume.Resources.MaxSizeBytes, ZMetricVolume.TotalBytes, and volumemgr's AppDiskMetric.ProvisionedBytes pubsub object. This also adds the EdgeDeviceConfig.AddBlankVolume builder, since evetest previously had no way to declare an empty block-device volume. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Andrew Durbin <andrewd@zededa.com> (cherry picked from commit d80e69a)
milan-zededa
force-pushed
the
14.5-backport-6154-zvol-volsize
branch
from
October 22, 2026 14:16
41672dd to
2fd6ba3
Compare
rene
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #6154 to
14.5-stable.Clean cherry-pick with
-xfromd80e69ac2f, no conflicts. Only the pillar part (zfs.go) of the PR is backported; its evetest changes are part of the evetest backport (#6873).Without this fix
TestZVolProvisionedSizeReportedfails: every ZFS zvol reports a provisioned size of 0.PR dependencies
None.
How to test and validate this PR
Covered by the evetest test
TestZVolProvisionedSizeReported(added to14.5-stableby #6873):Changelog notes
ZFS zvol-backed volumes now report their provisioned size (volsize) instead of 0.
Checklist
For backport PRs (remove it if it's not a backport):
And the last but not least:
check them.