enable blockstats for network disks#296
Merged
retspen merged 1 commit intoretspen:masterfrom Apr 29, 2014
Merged
Conversation
retspen
added a commit
that referenced
this pull request
Apr 29, 2014
enable blockstats for network disks
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.
Reading through the libvirt API I found that it is possible to retrieve block stats from network disks.
'dev_file' is assumed to be the path to the virtual hard disk which is gathered from the source element. However, network disks do not have a 'dev' or 'file' attribute as documented here:
http://libvirt.org/formatdomain.html#elementsDisks
Libvirt:blockStats will not only accept a path to the virtual disk, but also a target block device such as 'vdz'. This change set detects a network disk, and set dev_file = dev_bus in only that case.
I've tested this change locally, and disk usage is shown for both virtual machines with physical virtual hard disks, and network (rbd) disks! It would be nice if anyone else using a network disk to test if this and validate that is working for them as well.
Here is a picture of disk usage reporting for a network disk: