Recently I have been working on python-rrdtool Python binding to
rrdtool utility.
On PyPI there has already existed py-rrdtool package, but it did not
work at all.
It turned out, that rrdtool sources had a nice looking
rrdtoolmodule.c, all I needed was to compile it.
Long story short: rrdtoolmodule.c includes a non-existent header,
which is created during ./configure run. So I had to figure out how to
call ./configure from inside setup.py script.
(You may take a look at actual setup.py instead of reading this blog
post.)
In order to run ./configure at specific moment before your module is
being built, you have to use distutils command extensions:
build_configure and build_ext.
BuildConfigure class has to call the configure executable. But this
class is not enough, distutils requires special building extension.
I override run method to explicitly run our commands. In
sub_commands list of 2-element tuples, first element stays for command
extension, and second for usage circumstances (None == always, function
== depending on it’s boolean output).
Note: if you happen to see “permission error” somewhere, make sure
that you set chmods for configure executable:
If you don’t have a very modern computer with CPU supporting hardware
virtualization, like me, and you want to use Vagrant, you’ll likely
have lots of issues.
TL;DR: you’d better buy a new PC. Hardware virtualization is a
must-have nowadays.
In case you don’t want to buy it, here’s some issues I had with Vagrant
and how I fixed them.
VM can’t be started (even through VirtualBox GUI) due to “VT-x is not available”.
Solution: In this GUI select VM → Settings → System → Acceleration,
then uncheck everything.
Acceleration tab is not active.
Solution: Go to the directory containing your VirtualBox VMs, then
to your VM’s directory, then edit *.vbox XML file. Within <CPU> tag
children (like <HardwareVirtEx> or <PAE>), replace every
enabled="true" with enabled="false".
I can do that all with Vagrantfile and do not need to change my *.vbox config!
Solution: Even though you can turn hardware virtualization off via
Vagrantfile
(config.vm.customize ["modifyvm", :id, "--hwvirtex", "off"]), it might
not work. At least it didn’t in my case. If it does the same for you, go
and change your *.vbox XML file.
Still not working. What can be wrong?
Solution: Check if number of CPUs for your Vagrant virtual machine
is greater than 1. If so, go and change the count of CPUs in your
*.vbox file to one. (Yes, you could do it from Vagrantfile, but it may
not work. It did not in my case.)
For metrics collection I decided to use collectd daemon. It’ll be
backed up by my soon-to-be-born collectd-ganeti plugin.
Collectd will be installed on the host (Ganeti node), and this plugin
will gather usage information from KVM (and later Xen). This way there’s
no need to install collectd on every virtual machine Ganeti creates.
Next to collectd, I’m going to create a some kind of network daemon,
which will monitor and send metrics data to GWM. For now I created
something very pre-alpha – no—one should use it.
Following weeks are going to be very important to me. Not only will I
get my final exams results, but also there will take place university
admission. And Google seems to want job—interview with me.