Monitoring VMs on OpenStack (or KVM) using Graphite + Collectd


Collect metric of instances via Libvirt on all Compute node
Last updated: 2 years ago

Start with Grafana Cloud and the new FREE tier. Includes 10K series Prometheus or Graphite Metrics and 50gb Loki Logs

Downloads: 243

Reviews: 0

  • Screenshot_3.png

Install Collectd on all Compute node (or KVM node) or any node that installed Libvirt to collect the metrics (ram, cpu, iops,..) of VMs, then push to a Graphite server.

Workflow: Collectd -> Graphite -> Grafana

Collector Configuration Details

Install on CentOS 7

yum install epel-release -y 
yum install collectd -y 
yum install collectd-virt.x86_64 -y

Example /etc/collectd.conf file

Hostname    "compute01"
FQDNLookup   false

LoadPlugin write_graphite
LoadPlugin unixsock
LoadPlugin virt
Interval 120

<Plugin unixsock>
    SocketFile "/var/run/collectd-unixsock"
    SocketGroup "collectd"
    SocketPerms "0770"
    DeleteSocket false

<Plugin "virt">
   RefreshInterval 120
   Connection "qemu:///system"
   BlockDeviceFormat "target"
   HostnameFormat "uuid"
   InterfaceFormat "address"
   PluginInstanceFormat name
   ExtraStats "cpu_util disk_err domain_state job_stats_background perf vcpupin"

<Plugin write_graphite>
  <Node "graphite">
    Host "<ip_graphite>"
    Port "2003"
    Protocol "tcp"
    LogSendErrors true
    Prefix "collectd.compute01."
    #Postfix "collectd"
    StoreRates true
    AlwaysAppendDS false
    EscapeCharacter "_"

Start service

systemctl restart collectd
Get this dashboard: