Ruby problem Centos 7 pcsd and Opennebula

Good morning,

I am building a block LVM KVM cluster with 4 machines, but i am having a
strange problem which keeps me busy for days now, i am using a standard
Centos 7 server as frontend and Centos 7 nodes with opennebula and
opennebula-server installed.

software installed
opennebula-ruby-4.8.0-1.x86_64
opennebula-common-4.8.0-1.x86_64
opennebula-sunstone-4.8.0-1.x86_64

opennebula-4.8.0-1.x86_64
opennebula-server-4.8.0-1.x86_64

I also installed pcs-0.9.115-32.el7_0.1.x86_64 to use clvmd en dlm locks
on the opennebula nodes and frontend.

Now the problem i am facing i have installed pcsd (ruby) and opennebula
(ruby) on the same machine, when i install rack and sinatra via gems as
ordered by the install in the documentation the psc daemon binds only to
the localhost interface. If i uninstall sinatra and rack then the psc
daemon listens as ordered via the config file on all interfaces but
opennebula won’t start!

After installing sinatra via gems their are 2 versions of sinatra on the
system

/usr/lib/pcsd/vendor/bundle/ruby/gems/sinatra-1.4.4/lib/sinatra
/usr/local/share/gems/gems/sinatra-1.4.5/lib/sinatra

So i assume something is “overruling” BindAddress directive in the
config of pscd on centos 7 when i install the software needed to run
opennebula. I have tried setting the BindAddress directive in ssl.rb to
*, nil and :: but nothing fixes the problem also my knowledge of ruby is
to low to investigate further.

see below howto reproduce this problem
[root@cloudmanager rack-1.6.0]# !lsof
lsof -i | grep ruby
ruby 1368 root 9u IPv6 1474379 0t0 TCP localhost:efi-mg (LISTEN)
ruby 1368 root 10u IPv4 1474380 0t0 TCP localhost:efi-mg (LISTEN)
ruby 13803 oneadmin 10u IPv4 913310 0t0 TCP *:9869 (LISTEN)

[root@cloudmanager rack-1.6.0]# gem uninstall sinatra rack
Successfully uninstalled sinatra-1.4.5
Successfully uninstalled rack-1.6.0

[root@cloudmanager rack-1.6.0]# systemctl restart pcsd.service

[root@cloudmanager rack-1.6.0]# !lsof
lsof -i | grep ruby
ruby 4377 root 9u IPv4 1739444 0t0 TCP *:efi-mg (LISTEN)
ruby 13803 oneadmin 10u IPv4 913310 0t0 TCP *:9869 (LISTEN)

[root@cloudmanager tmp]# gem install sinatra
Successfully installed rack-1.6.0
Successfully installed sinatra-1.4.5

[root@cloudmanager tmp]# systemctl restart pcsd.service

[root@cloudmanager tmp]# !lsof
lsof -i | grep ruby
ruby 4551 root 9u IPv6 1740682 0t0 TCP localhost:efi-mg (LISTEN)
ruby 4551 root 10u IPv4 1740683 0t0 TCP localhost:efi-mg (LISTEN)
ruby 13803 oneadmin 10u IPv4 913310 0t0 TCP *:9869 (LISTEN)

Any tips how i can solve this problem?

Regards
Constan

I believe that Sunstone works fine with sinatra 1.4.4. You can try using install_gems to install all the required OpenNebula libraries and then manually install version 1.4.4 of the sinatra library. Something like this:

# ./install_gems
# gem uninstall sinatra
# gem install sinatra --version '1.4.4'

Hello jfontan,

thank you for your answer, I have tried your solution to see if it works but it doesn’t for me. The workaround I found which worked for me is adding the following line in the init script of opennebula-sunstone. Opennebula works and the pcsd daemon binds to all interfaces as directed.

echo -n "Starting Sunstone Server daemon: "
export GEM_HOME=/usr/lib/pcsd/vendor/bundle/ (line added)

Thanks for sharing your solution Sylconia.

I also faced this problem. To make it works with the opennebula-sunstone systemd service, I had to add Environment=GEM_HOME=/usr/lib/pcsd/vendor/bundle/ruby/ to /usr/lib/systemd/system/opennebula-sunstone.service.

I also had to uninstall sinatra and rack gems : gem uninstall sinatra rack

Tested on :
CentOS 7.1
OpenNebula 4.14
pcs 0.9.137-13.el7_1.4