[Users] [TRD] VM data stats supported switch to native KVM ones

Alexander Kurbatov alkurbatov at virtuozzo.com
Mon Apr 11 09:06:35 PDT 2016


1. Feature
VM data stats supported switch to native KVM ones.


2. Description
The feature introduce performance monitoring of a VM using libvirt API. 
Names of the counters,
units (except guest.cpu.time and host.cpu.time), SDK API and CLI commands 
are the same as in Virtuozzo 6.

The performance counters values can be extracted in the following ways:
 * via async subscription in SDK (*PerfStats calls)
 * using prlctl:
    prlctl statistics <VM> (report the values once)
    prlctl statistics <VM> --loop (report the values periodically)


List of supported VM counters:
Please pay attention that 'incremental' values are calculated from start of 
a VM.

* CPU:
Reported as a diff from last query:
  guest.cpu.usage - usage of host cpu in percent.
  guest.cpu.time - average time used by guest per host CPU in microseconds 
(TSC in Virtuozzo 6).
  host.cpu.time - host time change from last query in microseconds (TSC in 
Virtuozzo 6).

Reported as incremental value:
  guest.vcpu#.time - time used by # vCPU in nanoseconds.

* Memory
Reported as absolute value:
  guest.ram.usage - memory used by VM in Mbs.
  guest.ram.total - total memory avaliable for VM in Mbs.
  guest.ram.balloon_actual - memory used by VM on host in Mbs.

Reported as incremental value:
  guest.ram.swap_in - count of pages swapped in from disk.
  guest.ram.swap_out - count of pages swapped out to disk.
  guest.ram.minor_fault - count of minor memory faults.
  guest.ram.major_fault - count of major memory faults.

* Network devices
Reported as incremental value:
  net.nic#.pkts_in - count of packets to VM through network interface.
  net.nic#.pkts_out - count of packets from VM through network interface.
  net.nic#.bytes_in - count of bytes to VM through network interface.
  net.nic#.bytes_out - count of bytes from VM through network interface.
  net.classful.traffic - Classful network traffic counting info (0 - 15). 
Only first class is filled for VMs.

* Disk devices (supported types are ide, scsi, virtio)
Reported as incremental value:
  devices.<disk-type>#.read_requests - count of read requests to disk 
controller.
  devices.<disk-type>#.read_total - count of read bytes through disk 
controller.
  devices.<disk-type>#.write_requests - count of write requests to disk 
controller.
  devices.<disk-type>#.write_total - count of written bytes through disk 
controller.

Note:
Be aware that the index of a disk depends on VM configuration, e.g.:

  prlctl statistics cf375ad9-4217-45bc-b472-4f670383cb25 | grep 
devices\..*\.read_requests
       devices.scsi0.read_requests:     4040

  prlctl set cf375ad9-4217-45bc-b472-4f670383cb25 --device-add hdd --iface 
virtio

  prlctl statistics cf375ad9-4217-45bc-b472-4f670383cb25 | grep 
devices\..*\.read_requests
       devices.scsi0.read_requests:     40306
       devices.virtio0.read_requests:   915

  prlctl set cf375ad9-4217-45bc-b472-4f670383cb25 --device-add hdd --iface 
scsi

  prlctl statistics cf375ad9-4217-45bc-b472-4f670383cb25 | grep 
devices\..*\.read_requests
       devices.scsi0.read_requests:     2756
       devices.scsi1.read_requests:     121
       devices.virtio0.read_requests:   231


3. Limitations
 * we report counters only for VMs in running state;
 * there is no need in guest tools installed in a VM because all values are 
taken directly from libvirt.


4. Products
Virtuozzo 7, prl-disp-service >= 7.0.322


5. Testing recommendations
 * counters should be checked on various guest OSes and types (i.e. Windows 
and Linux);
 * feel free to experiment with various VM's configurations (especially 
with hdd and net devices because names of counters are dependant on VM 
config);
 * check reporting of CT counters as a regresson pass. 


6. Known issues
None



-- 
Bene vale,
Alexander.



More information about the Users mailing list