First Step to do if no data is available for a KVM VM Monitor

First Step to do if no data is available for a KVM VM Monitor

In KVM all the data has been collected via CLI Commands. So if any of data is not retrieved properly in the UI, we can check it by executing CLI Commands.

The below table contails the List of CLI Commands used for each metrics present under the KVM VM Monitor:

Attributes
CLI Command
Output
CPU:
$ virsh cpu-stats --total
test@APM-KVM-U1:~$ virsh cpu-stats --total centos7.0
Total:
        cpu_time          2089.714823565 seconds
        user_time          104.750000000 seconds
        system_time        330.430000000 seconds
CPU utilization

Value of cpu_time
User

Value of user_time
System

Value of system_time



Memory:
virsh dommemstat <VMname>
virsh dommemstat centos7.0 —period 10 —live
The above command is used to enable metrics

test@APM-KVM-U1:~$ virsh dommemstat centos7.0
actual 4194304
swap_in 0
swap_out 0
major_fault 1424
minor_fault 19368780
unused 2776976
available 3882420
last_update 1544636808
rss 1567572
Ballooned Memory


Read from Swap

Value of swap_in
Write into Swap

Value of swap_out
Disk I/O Fault Count

Value of major_fault
Page Fault Count

Value of minor_fault
RSS Memory

Value of rss
Total Memory
$ sudo virsh dominfo APM-C764-5
Value of MaxMemory
Used Memory
$ sudo virsh dominfo APM-C764-5
Value of UsedMemory
Free Memory

Max Memory - Used Memory
Memory Utilization





Disk Details:
$virsh domblklist --details
$virsh domblklist --details <VMname> | grep 'disk'
$virsh domblkinfo <VM_Name> <Block_devName>
virt-df
test@APM-KVM-U1:~$ virsh domblklist centos7.0
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/centos7.0.qcow2
hda        -

test@APM-KVM-U1:~$ virsh domblkinfo centos7.0 vda
Capacity:       107374182400
Allocation:     5553049600
Physical:       107390828544
Name

Value of Target
Source

Value of Source
Capacity

Value of Capacity
Used

Value of Allocation
Free

Capacity-Allocation



Disk I/O Details:
$virsh domblkstat <VMname> <diskName> --human
test@APM-KVM-U1:~$ virsh domblkstat centos7.0 vda --human
Device: vda
 number of read operations:      19405
 number of bytes read:           541752832
 number of write operations:     4209
 number of bytes written:        31960576
 number of flush operations:     651
 total duration of reads (ns):   1047787890
 total duration of writes (ns):  94970385161
 total duration of flushes (ns): 140993649
Name

Value of 'Device'
Read Operations

Value of 'number of read operations'
Write Operations

Value of 'number of write operations'
Bytes Received

Value of 'number of bytes read'
Bytes Transmitted

Value of 'number of bytes written'
Time taken for Read

Value of ' total duration of reads (ns)'
Time taken for Write

Value of ' total duration of writes (ns)'



Network Interface:
$ virsh domiflist <VMName>
[test@APM-KVM-C7-1 ~]$ virsh domiflist APM-U18-3
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet1      bridge     br0        rtl8139     52:54:00:b7:a5:f8
Name

Value of ' Interface'
Type

Value of ' Type'
Source

Value of ' Source'
Model

Value of ' Model'
MAC Address

Value of ' MAC'



Network Interface Utilization:
$ virsh domifstat <VMName> <InterfaceName>
test@APM-KVM-U1:~$ virsh domifstat centos7.0 vnet0
vnet0 rx_bytes 54127329
vnet0 rx_packets 450484
vnet0 rx_errs 0
vnet0 rx_drop 1066
vnet0 tx_bytes 47532
vnet0 tx_packets 352
vnet0 tx_errs 0
vnet0 tx_drop 0s
Interface Name


Received Bytes

Value of rx_bytes
Packets Received

Value of rx_packets
Transmitted Bytes

Value of tx_bytes
Packets Transmitted

Value of tx_packets



Configuration:
$ virsh dominfo <VMName>
test@APM-KVM-U1:~$ virsh dominfo centos7.0
Id:             11
Name:           centos7.0
UUID:           684b1cd4-0969-4683-8134-e9ca021a7601
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       128.8s
Max memory:     4194304 KiB
Used memory:    4194304 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: apparmor
Security DOI:   0
Security label: libvirt-684b1cd4-0969-4683-8134-e9ca021a7601 (enforcing
Id

Value of Id
Name

Value of Name
IP Address


UUID

Value of UUID
OS Type

Value of OS Type
Installed OS


State

Value of State
CPU(s)

Value of CPU(s)
Autostart

Value of Autostart