<div dir="ltr">Hi Martin,<div><br></div><div>Thank you so much for your explanation. As you said here:</div><div><br></div><div><div class="im" style="font-family:arial,sans-serif;font-size:13px">> Right now we can get domain memory statistics through the following virsh<br>
> cmds:<br>> 1.      dumpxml: this returns "memory" and "currentMemory"<br>><br><br></div><span style="font-family:arial,sans-serif;font-size:13px">This are settings for the domain that you can change before the domain</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">starts.  "memory" is the maximum it can reach and "currentMemory" is</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">what the domain will have it cut down to using a memballoon.</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">However somehow we can observe RSS greater than the "memory", which is supposed to be the maximum it can reach. Have you ever seen this happen and could you provide us any comment?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Bruce</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 11:16 AM, Martin Kletzander <span dir="ltr"><<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, Feb 25, 2014 at 09:19:34AM -0500, Qiang Fu wrote:<br>
> Hi all,<br>
><br>
> I am trying to use virsh to get the memory and storage usage for KVM domain.<br>
><br>
> Right now we can get domain memory statistics through the following virsh<br>
> cmds:<br>
> 1.      dumpxml: this returns "memory" and "currentMemory"<br>
><br>
<br>
</div>This are settings for the domain that you can change before the domain<br>
starts.  "memory" is the maximum it can reach and "currentMemory" is<br>
what the domain will have it cut down to using a memballoon.<br>
<div class=""><br>
> 2.      dominfo: this returns "Max memory" and "Used memory"<br>
><br>
<br>
</div>This is "memory" and "currentMemory" respectively.<br>
<div class=""><br>
> 3.      dommemstat: this returns "actual" and "rss"<br>
><br>
<br>
</div>"actual" is what qemu reports when we call for stats on monitor, "rss"<br>
is RSS of the qemu process you'd get from /proc, e.g.<br>
<br>
# grep VmRSS /proc/$(pidof qemu-system-x86_64)/status<br>
VmRSS:   610508 kB<br>
<div class=""><br>
> We think "memory" (from dumpxml) = "Max memory" (from dominfo) and<br>
> "currentMemory" (from dumpxml) = "Used memory" (from dominfo). Can anyone<br>
> please help us to confirm this?<br>
><br>
<br>
</div>Yes.<br>
<div class=""><br>
> We don't understand what does "actual" stand for in dommemstat. Can anyone<br>
> please explain us about that?<br>
><br>
<br>
</div>As I said above, that's what qemu tells us on the monitor.  I haven't<br>
gone into too much detail when looking at the code, so I can't tell<br>
you many more details, that may be a question for qemu.<br>
<div class=""><br>
> Finally, we want to get the memory utilization of the domain on VM level in<br>
> percentage. And we derive it as:<br>
> Utilization = rss / Used memory<br>
> Can anyone please provide any comment on this?<br>
><br>
> In terms of disk usage, it seems virsh / libvirt does not support any<br>
> domain disk information right now. If not, can anyone please give us any<br>
> idea how to get the domain disk information (size, used space and so on)?<br>
><br>
<br>
</div>You can get data about volumes in pools (vol-info), about volumes<br>
per-domain (domblkinfo) and their statistics (domblkstat).<br>
<br>
Martin<br>
<br>
> Thanks a lot,<br>
> Bruce<br>
<span class="HOEnZb"><font color="#888888"><br>
> --<br>
> libvir-list mailing list<br>
> <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/libvir-list" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
</font></span></blockquote></div><br></div>