Troubleshooting OpenStack the cool way: ini_comparer.py

If OpenStack is already complex enough, troubleshooting OpenStack issues can be a nightmare! If you agree, you might be interested on the ini_comparer script.

The source of most of the issues with OpenStack is usually on the configuration files, which have the “ini” format. This format is not particularly easy to handle by old school “sed” people like me and in addition, the standard configuration files are meant to be self-documented, which means tons of lines of comments and commented options.

Putting this together, we get huge configuration files, with very similar lines and it is a pain in the lower back to check word by word, character by character every single keyword in the file.

So, provided that we have another configuration file that works fine, we can use the ini_comparer python script to do that for us. It can work with a combination of local or remote files. For example, a file on the local machine and another one in a remote one, both files are in the local machine, or both are in remote machines.

As the comparison is made by accessing the machine trough ssh, we need to set the ssh keys for passwordless login to the remote machine first (in case we are using remote machines).

But a picture is better than thousand words, so here it is:

ini_comparer.py is the tool for comparing ini configuration files in a easy and visual way.

ini_comparer.py is the tool for comparing ini configuration files in a easy and visual way.

In this example, we are comparing the /etc/nova/nova.conf file in the controller and compute nodes of a BOMSI installation. We are executing it from the controller, so we add the ssh key to the compute1 node, execute the script, and … Ops!  Check out the “[neutron]” section (last two lines). The keyword “metadata_proxy_shared_secret” has a typo on the compute1 node! It would have taken us quite long to find out with our bare eyes, but luckily we have this script now 🙂

The script ini_comparer.py comes standard with every BOMSI distribution, on the “lib” folder.
For example: on the Ubuntu-Liberty folder.

The script is standalone, so you can use it in any environment, for example, for comparing a devstack installation with an autopilot one.

2 thoughts on “Troubleshooting OpenStack the cool way: ini_comparer.py

Comments are closed.