Feature #244

Network interface statistics for KVM

Added by Javi Fontan over 1 year ago. Updated 11 months ago.

Status:Closed Start date:05/17/2010
Priority:Normal Due date:
Assignee:Jaime Melis % Done:

0%

Category:Drivers
Target version:Release 2.0
Resolution: Addon:
Story points-
Velocity based estimate-

Description

Currently VMM KVM driver does not retrieve network statistics. Rogier Mars has created a patch to get this information, here follows his email:

I've created a quick patch (see below) to the file one_vmm_kvm.rb to include proper monitoring of network interface statistics for KVM.
This patch uses the libvirt dumpxml command and domifstat to get interface statistics.

I've attached the updated one_vmm_kvm.rb file, see the patch below.

Best regards,

Rogier

42a43
> require 'rexml/document'
61c62,65
<         :poll     => "virsh --connect #{LIBVIRT_URI} dominfo" 
---
>         :poll     => "virsh --connect #{LIBVIRT_URI} dominfo",
>         :netstats => "virsh --connect #{LIBVIRT_URI} domifstat",
>         :dumpxml  => "virsh --connect #{LIBVIRT_URI} dumpxml" 
>
146a151,162
>         exe2  = SSHCommand.run("#{LIBVIRT[:dumpxml]} #{deploy_id}", host,
>                               log_method(id))
>
>        doc = REXML::Document.new(exe2.stdout)
>        interfaces = []
>        doc.elements.each('domain/devices/interface/target') do |ele|
>           interfaces << ele.attributes["dev"]
>        end
>
>         exe3  = SSHCommand.run("#{LIBVIRT[:netstats]} #{deploy_id} #{interfaces}", host,
>                               log_method(id))
>
182a199
>
185a203,212
>         exe3.stdout.each_line {|line|
>             columns=line.split(" ").collect {|c| c.strip }
>             case columns[1]
>                 when 'rx_bytes'
>                     info << " #{POLL_ATTRIBUTE[:netrx]}="  << (columns[2].to_i).to_s
>                 when 'tx_bytes'
>                     info << " #{POLL_ATTRIBUTE[:nettx]}="  << (columns[2].to_i).to_s
>             end
> }
>

Associated revisions

Revision cc827fb5
Added by Jaime Melis over 1 year ago

Applied patch for network device statistics in KVM (#244)

Revision 1243da07
Added by Javi Fontan about 1 year ago

New KVM poll command

feature #446: gets information from all vm's in the host so
it can be used with ganglia
feature #244: gets network interface statistics
feature #472: gets cpu consumption

Revision fa0d4a19
Added by Javi Fontan 12 months ago

New probes and ganglia readers

Feature #244: Network interface statistics for KVM
Feature #446: Probe to get monitoring info from ganglia
Feature #472: Get cpu consumption from KVM VMs

poll_xen_kvm.rb - This new probe gets information from XEN and KVM vms.
If it is called with the name of a VM then its monitoring information
is written in standard poll probe way. If called without parameters
a base64-encoded yaml-representation of a hash containing the information
about all the VMs running in the host is returned.

poll_ganglia.rb - This probe gets information from ganglia pushed by gmetric.
Consumes the information generated by poll_xen_kvm.rb

ganglia_probe - Gets host monitoring information from ganglia. It pushes all
metrics that start by OPENNEBULA_

Ganglia.rb - library that holds ganglia reading code

Revision ff8e45da
Added by Javi Fontan 12 months ago

New probes and ganglia readers (from branch feature-446)

Feature #244: Network interface statistics for KVM
Feature #446: Probe to get monitoring info from ganglia
Feature #472: Get cpu consumption from KVM VMs

poll_xen_kvm.rb - This new probe gets information from XEN and KVM vms.
If it is called with the name of a VM then its monitoring information
is written in standard poll probe way. If called without parameters
a base64-encoded yaml-representation of a hash containing the information
about all the VMs running in the host is returned.

poll_ganglia.rb - This probe gets information from ganglia pushed by gmetric.
Consumes the information generated by poll_xen_kvm.rb

ganglia_probe - Gets host monitoring information from ganglia. It pushes all
metrics that start by OPENNEBULA_

Ganglia.rb - library that holds ganglia reading code

History

Updated by Ruben S. Montero over 1 year ago

  • Target version deleted (Release 2.0)

Updated by Ruben S. Montero over 1 year ago

  • Assignee changed from Javi Fontan to Jaime Melis
  • Target version set to Release 2.0

Updated by Jaime Melis over 1 year ago

  • Status changed from New to Closed

Fixed according to the proposed solution. Closing ticket.

Updated by Ruben S. Montero over 1 year ago

  • Status changed from Closed to Assigned

This functionality has been lost since the migration to the remotes scripts.

Updated by Daniel Molina over 1 year ago

  • Target version deleted (Release 2.0)

Updated by Ruben S. Montero 11 months ago

  • Status changed from Assigned to Closed
  • Target version set to Release 2.0

This has been implemented in since 2.2

Also available in: Atom PDF