Comments (3)
This is really a question of understanding what the libvirt API does: libvirt virConnectGetAllDomainStats. If you scroll down on that page to the section about "VIR_DOMAIN_STATS_BLOCK" , it describes what each of those fields mean.
None of them are going to be filesystem-aware and some will depend on how the device is being attached (i.e. is it being attached as a virtio device? are unmap operations supported?). The way I read that documentation, physical is probably the closest to what you're looking for, but it's aware of the blocks of the device as a whole and not your internally formatted partition. You might also be running into some oddities with how fallocate is virtualized for your disk in particular... maybe see what happens if you create the file using something like dd with /dev/random as input.
Regardless, this isn't related to go-libvirt, but libvirt itself. Hopefully the above information helps, but you could also try follow up there.
from go-libvirt.
Creating a file with /dev/random data did indeed grow the disk size, it seems fallocate
won't cut it in VMs. For anyone that ends up here, the only way I have found of accurately measuring disk space used by a VM from the host is through the virt-df
command. It's quite computationally costly, and it's not fast, but it outputs the data correctly.
from go-libvirt.
from go-libvirt.
Related Issues (20)
- Support for connection URIs HOT 6
- Tunnel via SSH? HOT 3
- Migrate Operations missing HOT 1
- Document minimum (or maximum) supported toolchain requirements
- Mentioned method Disconnected() does not exist HOT 1
- libvirttest.MockLibvirt does not implement net.Conn HOT 2
- Broken link to libvirt RPC knowledgebase HOT 1
- Inability to subscribe `metdata-change`, `device-added` and `device-removed` events HOT 5
- Support for QEMU Agent Command HOT 4
- CI occasionally times out HOT 1
- Can libvirt arm platform run X86 system? HOT 1
- Support for modular libvirt daemons HOT 4
- suggested breaking change: add context.Context support to API HOT 1
- cannot use 2147483648 (untyped int constant) as * value in constant declaration (overflows) HOT 4
- Connecting to Libvirt
- Deadlock if Stream Shutdown races with Push
- Q: What is the meaning of `NeedResults`? HOT 1
- Qemu special api
- how to connect libvirtd with tcp and sasl auth?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-libvirt.