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

Wrong USED disk space reported #1423

Open
shodanshok opened this issue Feb 6, 2024 · 0 comments · May be fixed by #1467
Open

Wrong USED disk space reported #1423

shodanshok opened this issue Feb 6, 2024 · 0 comments · May be fixed by #1467

Comments

@shodanshok
Copy link

As reported in a old issue for the cockpit project, USED disk space is wrongly reported. Original issue link: cockpit-project/cockpit#9052

NOTE: I am opening an issue here because I think it is the more appropriate place, but feel free to close this issue if you want.

As explained in cockpit-project/cockpit#9052 (comment) the issue is about reading the wrong field from libvirt stats: cockpit-machines reads allocation rather than physical. From libvirt man page:

block.<num>.allocation - offset of highest written sector in bytes
block.<num>.physical - physical size of source file in bytes

So block.<num>.physical should be read to show USED disk space (as seen by the host).

From my understanding the fix is very simple: replace !isNaN(vm.disksStats[target].allocation) with !isNaN(vm.disksStats[target].physical) in vmDisksCard.jsx

martinpitt added a commit to martinpitt/cockpit-machines that referenced this issue Feb 28, 2024
Showing "allocation" in the UI doesn't make much sense. According to
the manpage [1] it describes "offset of highest written sector in
bytes". Showing the "physical size of source file in bytes" is much more
useful.

Thanks to @shodanshok for figuring this out!

Fixes cockpit-project#1423

[1] https://www.libvirt.org/manpages/virsh.html
@martinpitt martinpitt linked a pull request Feb 28, 2024 that will close this issue
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 a pull request may close this issue.

1 participant