Skip to main content

calamari initialize on ubuntu 14.04: ImportError: No module named _io

After installing calamari on Ubuntu 14.04 trusty I run initialize script but got the following error:

#calamari-ctl initialize
Traceback (most recent call last):
File "/usr/bin/calamari-ctl", line 9, in 
load_entry_point('calamari-cthulhu==0.1', 'console_scripts', 'calamari-ctl')()
File "/opt/calamari/venv/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/opt/calamari/venv/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 2279, in load_entry_point
return ep.load()
File "/opt/calamari/venv/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/pkg_resources.py", line 1989, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/opt/calamari/venv/local/lib/python2.7/site-packages/calamari_cthulhu-0.1-py2.7.egg/cthulhu/calamari_ctl.py", line 6, in 
import tempfile
File "/usr/lib/python2.7/tempfile.py", line 32, in 
import io as _io
File "/usr/lib/python2.7/io.py", line 51, in 
import _io
ImportError: No module named _io

To fix:

# mv /opt/calamari/venv/local/bin/python /opt/calamari/venv/local/bin/pythonOLD
# cp /usr/bin/python2.7 /opt/calamari/venv/local/bin/python

And then:

# calamari-ctl initialize
[INFO] Loading configuration..
[INFO] Starting/enabling salt...
[INFO] Starting/enabling postgres...
[INFO] Initializing database...
[INFO] Initializing web interface...
[INFO] You will now be prompted for login details for the administrative user account. This is the account you will use to log into the web interface once setup is complete.
Username (leave blank to use 'root'):
Email address: user@domain
Password:
Password (again):
Superuser created successfully.
[INFO] Starting/enabling services...
[INFO] Restarting services...
[INFO] Complete.

Verify error: Command ‘openssl’ returned non-zero exit status 4

After migrating the neutron-server and the keystone service from one machine to another I got the following error when running commands like neutron net-list:

2014-11-11 12:45:27.013 23123 WARNING keystoneclient.middleware.auth_token [-] Verify error: Command 'openssl' returned non-zero exit status 4
2014-11-11 12:45:27.013 23123 WARNING keystoneclient.middleware.auth_token [-] Authorization failed for token
2014-11-11 12:45:27.014 23123 INFO keystoneclient.middleware.auth_token [-] Invalid user token - rejecting request

 

To solve the error I had to remove the existing certificates:

rm /var/lib/neutron/keystone-signing/*

After that the certificates where generated again and the command was run succesfully.

Rename interfaces on Ubuntu 14.04

On my virtual machines I use many network interfaces, each one connected to a different vlan. I usually rename the interfaces on the guest machine with a meaningful name referring to its vlan, like eth40 for the interface that is connected to vlan 40. Until now I used to use ifrename package on my debian guests, but on Ubuntu 14.04 this packakge is not very long distributed.

To achive this I used an udev rule. Simply create the file /etc/udev/rules.d/70-persistent-net.rules with the following content, one line for each interface you want to rename:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b2:b3:31:58:96:59", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth40"

 

 

Now, change your /etc/network/interfaces file accordingly, reboot the guest and your interfaces should have changed.

OpenStack: ssh timeout with GRE tunnels

I configured my OpenStack installation and all went Ok. I used the Open vSwitch plugin with GRE tunnels and although I had ping connectivity, when I try to connect to instances through ssh I got a time out. The problem seemed to be in the tunnel MTU size. I had to lower the mtu size on instances to prevent packet fragmentation over GRE tunnel.

Edit /etc/neutron/dhcp_agent.ini file, add this line:

# Override the default dnsmasq settings with this file
dnsmasq_config_file = /etc/neutron/dnsmasq/dnsmasq-neutron.conf

 

Create file  /etc/neutron/dnsmasq/dnsmasq-neutron.conf and add these values:

dhcp-option-force=26,1400

 

Finally restart neutron server

# service neutron-server restart

 

References:

http://docs.openstack.org/admin-guide-cloud/content/openvswitch_plugin.html