[libvirt] libvirt memory flags

Hallo all, I am using libvirt version 1.1.1 on one of the nodes which has several VMs. When I executed the command, virsh dommemstat <domain UUID>, I am getting the following flags as output: actual, swap_in and rss. The API does not return "unused memory" flag that is associated to the virtual machine / domain. Can I kindly know is there a documentation that describes different memory flags? Further, can I get help from the forum to obtain information about the unused memory associated with the virtual machine / domain? Regards, Krishnaprasad

On Wed, Dec 31, 2014 at 01:36:21AM +0000, Narayanan, Krishnaprasad wrote:
Hallo all,
I am using libvirt version 1.1.1 on one of the nodes which has several VMs. When I executed the command, virsh dommemstat <domain UUID>, I am getting the following flags as output: actual, swap_in and rss. The API does not return "unused memory" flag that is associated to the virtual machine / domain.
It's hard to define what you mean by "unused" memory. The API you are talking about returns (at least for the QEMU driver) memory information about the process itself. These are, of course, different values than he amount of memory inside the VM. If you want to know what is the current memory amount set for the VM, you can find it in the XML output of 'virsh dumpxml <domain>'. Further data should be available from guest agent, but libvirt does not have an API for this. You can, however, query that information using an arbitrary guest agent command (virsh qemu-agent-command), but I'm not sure about that and neither about the commands. Martin
Can I kindly know is there a documentation that describes different memory flags? Further, can I get help from the forum to obtain information about the unused memory associated with the virtual machine / domain?
Regards, Krishnaprasad
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Hi Martin, Thanks for your reply. Please correct me if I am wrong here. The latest version of libvirt generates the following flags with respect to memory a) swap_in b) swap_out c) major_fault d) minor_fault e) unused f) available g) actual_balloon h) rss I assumed that the "unused" flag represents the memory that is not consumed / not used by the virtual machine. In order to calculate the memory that is used by the VM / KVM process associated with the VM, I thought I should subtract the available or set memory - unused memory. Regards, Krishnaprasad -----Original Message----- From: Martin Kletzander [mailto:mkletzan@redhat.com] Sent: Freitag, 2. Januar 2015 16:15 To: Narayanan, Krishnaprasad Cc: libvir-list@redhat.com Subject: Re: [libvirt] libvirt memory flags On Wed, Dec 31, 2014 at 01:36:21AM +0000, Narayanan, Krishnaprasad wrote:
Hallo all,
I am using libvirt version 1.1.1 on one of the nodes which has several VMs. When I executed the command, virsh dommemstat <domain UUID>, I am getting the following flags as output: actual, swap_in and rss. The API does not return "unused memory" flag that is associated to the virtual machine / domain.
It's hard to define what you mean by "unused" memory. The API you are talking about returns (at least for the QEMU driver) memory information about the process itself. These are, of course, different values than he amount of memory inside the VM. If you want to know what is the current memory amount set for the VM, you can find it in the XML output of 'virsh dumpxml <domain>'. Further data should be available from guest agent, but libvirt does not have an API for this. You can, however, query that information using an arbitrary guest agent command (virsh qemu-agent-command), but I'm not sure about that and neither about the commands. Martin
Can I kindly know is there a documentation that describes different memory flags? Further, can I get help from the forum to obtain information about the unused memory associated with the virtual machine / domain?
Regards, Krishnaprasad
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[please, do not top-post on technical lists. And, can you teach your mailer to wrap long lines. Thanks.] At Fri, 2 Jan 2015 15:36:19 +0000, Narayanan, Krishnaprasad wrote:
Hi Martin,
Thanks for your reply. Please correct me if I am wrong here.
The latest version of libvirt generates the following flags with respect to memory a) swap_in b) swap_out c) major_fault d) minor_fault e) unused f) available g) actual_balloon h) rss
I assumed that the "unused" flag represents the memory that is not consumed / not used by the virtual machine. In order to calculate the memory that is used by the VM / KVM process associated with the VM, I thought I should subtract the available or set memory - unused memory.
The actual data available depends on the hypervisor, the guest OS and whether you have the balloon driver running inside the guest. If you provide that information we probably would be able to help you better. For some of the statistics, you have to instruct the driver to collect them in the first place. Try running the dommemstat command with the --period N option once. Then, try running it repeatedly without that option. Claudio --
participants (3)
-
Claudio Bley
-
Martin Kletzander
-
Narayanan, Krishnaprasad