Repository navigation
[17.0-stable] zfs: report zvol provisioned size (volsize) in volume metrics - #6835
Merged
Merged
Conversation
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. Backport note: only the pkg/pillar/zfs/zfs.go change is backported. The original commit's evetest regression test (TestZVolProvisionedSizeReported) and the EdgeDeviceConfig.AddBlankVolume builder are omitted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit 24ef315) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Durbin <andrewd@zededa.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 17.0-stable #6835 +/- ##
===============================================
+ Coverage 22.70% 23.04% +0.34%
===============================================
Files 512 522 +10
Lines 94725 96426 +1701
===============================================
+ Hits 21504 22221 +717
- Misses 71387 72191 +804
- Partials 1834 2014 +180 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
fillImgInfo()never setImgInfo.VirtualSizefor ZFS zvols, so everyzvol-backed volume reported a provisioned size of 0: AppDiskMetric
ProvisionedBytesand the volume resourceMaxSizeByteswere both 0.This reads the zvol
volsizeproperty and setsVirtualSizefrom it,best-effort, so filesystem datasets without a volsize keep reporting 0.
Scope of this backport
Only the
pkg/pillar/zfs/zfs.gochange is backported.The evetest half of #6154, the
TestZVolProvisionedSizeReportedregression test and theEdgeDeviceConfig.AddBlankVolumebuilder, is not part of this PR. It reaches 17.0-stable in a newer form through #6833, which syncs evetest with master. Picking it here as well would collide with #6833 onevetest/devconfig.goandevetest/tests/storage/zvol_provisioned_size_test.go.How to test and validate this PR
Once #6833 is merged, the regression test from #6154 is available on this branch:
Until then, validate by hand as described below.
On an HV=kvm device with a ZFS persist pool, deploy an app with a
zvol-backed volume, then compare:
ProvisionedBytesmust match the zvolvolsize, not 0. The volume'sMaxSizeBytesreported to the controller must match too.Changelog notes
Report provisioned/virtual size for ZFS persist AppDiskMetrics
PR Backports
This is the backport
Checklist
For backport PRs (remove it if it's not a backport):
And the last but not least:
check them.
Please, check the boxes above after submitting the PR in interactive mode.
🤖 Generated with Claude Code