With the modular OpenNebula architecture, it is possible to extend the default IM driver to expose new variables that could be used by the scheduler or whatever monitoring information we may need.
IM drivers are arranged in these directories:
/usr/lib/one/mads
or$ONE_LOCATION/lib/mads
: The drivers' main executable files/var/lib/one/remotes/im/<virtualizer>.d
or$ONE_LOCATION/var/remotes/im/<virtualizer>.d
: Hypervisor-specific probes to gather every monitoring metric
For example, we can decide to introduce a new TEMPERATURE attribute for our KVM-based cloud, to be used in the RANK attribute for the scheduler. This is as simple as defining a shell script that will output one per line:
PARAMETER=VALUE
Place the new script inside the remotes/im/kvm.d
directory, called temperature.sh
:
#!/bin/bash echo TEMP=`sensors|grep 'CPU Temperature'|awk -F' ' '{ print $3}'| sed s/+//|sed s/\.[0-9]°C//`
You may need to adjust the first grep...