Collecting memory utilization metrics from KVM virtual machines
You can use the Agent to collect memory utilization metrics from KVM virtual machines. To enable the KVM hypervisor to provide these metrics, you must run the dommemstat command as follows:
- Log in to your KVM host.
- Verify whether the dommemstat version supports the --period <number> option by running the following command. This option is required for enabling the metrics.
virsh help dommemstat Verify whether the following results are displayed that indicate support for the --period <number> option:
NAMEdommemstat - get memory statistics for a domainSYNOPSIS
dommemstat <domain> [--period <number>] [--config] [--live] [--current]DESCRIPTION
Get memory statistics for a running domain.OPTIONS
[--domain] <string> domain name, id or uuid
--period <number> period in seconds to set collection
--config affect next boot
--live affect running domain
--current affect current domain- Run the following command to enable the metrics:
virsh dommemstat <ID> --period 10 --live
where, ID indicates the ID or name of the KVM. Verify that the metrics are enabled by running the following command:
virsh -c qemu:///system --readonly dommemstat <ID| Name of VM>
where ID is a domain name. To view a list of available domains, run the virsh list command.
If the KVM is collecting memory statistics, it displays metrics similar to the following:
swap_inswap_out
major_fault
minor_fault
unused
available
usable
If the KVM is not collecting memory statistics, it displays metrics similar to the following:
actual
last_update
rss
Verify that both the available and unused metrics are displayed and show non-zero values.