Installing OpenNebula 4.0 on a Dell XPS13 Ultrabook running Debian sid

by Mitch Halmu, Netside Corporation
May 2013

The Dell XPS13 L322X Ultrabook is a truly wonderful development machine. With a third generation dual core Intel i7 processor and fast SSD disk, you literally hold a Linux mini-server in the palm of your hands. This Ultrabook, originally imaged by Dell with Windows 8, is now configured with dual-boot Debian sid and CentOS 6.4 - the best of both Open Source Linux variants.

Cloud computing is all the rage these days, so after installing DevStack and the OpenStack Grizzly Debian packages, I decided to try out a competing product. For this cloud project, the latest OpenNebula release 4.0 Debian package was downloaded from the opennebula.org site (from http://downloads.opennebula.org/ select Debian-6.0.7-opennebula-4.0.0-1.tar.gz and source opennebula-4.0.0.tar.gz).

The Debian tarball contains the following files:

-rw-r--r-- 1 root root   56398 May  8 11:53 libopennebula-java_4.0.0-1_all.deb
-rw-r--r-- 1 root root  119738 May  8 11:53 libopennebula-java-doc_4.0.0-1_all.deb
-rw-r--r-- 1 root root  989702 May  8 11:53 opennebula_4.0.0-1_amd64.deb
-rw-r--r-- 1 root root    1499 May  8 11:49 opennebula_4.0.0-1.dsc
-rw-r--r-- 1 root root   12944 May  8 11:53 opennebula-common_4.0.0-1_all.deb
-rw-r--r-- 1 root root   13760 May  8 11:53 opennebula-node_4.0.0-1_all.deb
-rw-r--r-- 1 root root  433078 May  8 11:53 opennebula-ozones_4.0.0-1_all.deb
-rw-r--r-- 1 root root 1115450 May  8 11:53 opennebula-sunstone_4.0.0-1_all.deb
-rw-r--r-- 1 root root   90780 May  8 11:53 opennebula-tools_4.0.0-1_all.deb
-rw-r--r-- 1 root root   61846 May  8 11:53 ruby-opennebula_4.0.0-1_all.deb

Examine opennebula_4.0.0-1.dsc and install the build dependencies with apt-get, if you don't already have them: bash-completion, bison, debhelper (>= 7.0.50~), default-jdk, flex, javahelper (>= 0.32), libmysql++-dev, libsqlite3-dev, libssl-dev, libws-commons-util-java, libxml2-dev, libxmlrpc-c3-dev, libxmlrpc3-client-java, libxmlrpc3-common-java, libxslt1-dev, ruby, scons

Examine the running version of ruby and rubygems (should be version 1.8, not 1.9):

# ruby --version 
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
# gem --version
1.8.24

On this host, I had ruby and gem defaults at version 1.9, and had to redo the symbolic link in /usr/bin to point to the right command version. If you have ruby and gem at a later version, strange things will happen with the scripts.

Install the deb packages:

# for i in `ls *.deb`
> do
> dpkg -i $i
> done

All packages will install, except the following:

dpkg: dependency problems prevent configuration of opennebula:
 opennebula depends on libmysqlclient16 (>= 5.1.21-1); however:
  Package libmysqlclient16 is not installed.
 opennebula depends on libssl0.9.8 (>= 0.9.8m-1); however:
  Package libssl0.9.8 is not installed.
 opennebula depends on libxmlrpc-c3; however:
  Package libxmlrpc-c3 is not installed.

dpkg: error processing opennebula (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 opennebula
# apt-get install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 opennebula : Depends: libmysqlclient16 (>= 5.1.21-1) but it is not installable
              Depends: libssl0.9.8 (>= 0.9.8m-1) but it is not installable
              Depends: libxmlrpc-c3 but it is not installable
E: Unmet dependencies. Try using -f.
# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  opennebula
0 upgraded, 0 newly installed, 1 to remove and 120 not upgraded.
1 not fully installed or removed.
After this operation, 4,272 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 309115 files and directories currently installed.)
Removing opennebula ...
Processing triggers for man-db ...
# dpkg -l|grep opennebula 
ii  libopennebula-java                    4.0.0-1                            all          Java bindings for OpenNebula Cloud API (OCA)
ii  libopennebula-java-doc                4.0.0-1                            all          Java bindings for OpenNebula Cloud API (OCA) - documentation
rc  opennebula                            4.0.0-1                            amd64        controller which executes the OpenNebula cluster services
ii  opennebula-common                     4.0.0-1                            all          empty package to create OpenNebula users and directories
ii  opennebula-node                       4.0.0-1                            all          empty package to prepare a machine as OpenNebula Node
ii  opennebula-ozones                     4.0.0-1                            all          web interface to which executes the OpenNebula cluster services
ii  opennebula-sunstone                   4.0.0-1                            all          web interface to which executes the OpenNebula cluster services
ii  opennebula-tools                      4.0.0-1                            all          Command-line tools for OpenNebula Cloud
ii  ruby-opennebula                       4.0.0-1                            all          Ruby bindings for OpenNebula Cloud API (OCA)

We have higher versions of libmysqlclient18, libssl1.0.1e-2, libxmlrpc-c3-dev and libxmlrpc-core-c3 ver 1.66 which replaces the old package libxmlrpc-c3 ver 1.06. So the package opennebula_4.0.0-1_amd64.deb obtained from the vendor, meant for Debian 6.0 Squeeze, will not install normally in sid, but the rest of the suite will.

I want to keep the system orderly and have install locations as close to the Debian standard as possible, so we will keep the good packages and just add the missing files. At some later time, this package will be available from a Debian repository, and we will be able to then upgrade normally.

Examine the contents of the opennebula package with the following command:

# dpkg --contents opennebula_4.0.0-1_amd64.deb

Since we already know that we have all dependencies installed at a higher rev than required by the package, chances are slim that something will break, other than the compiled binaries that use shared libraries with a specific version. So we simply extract the package files into the root filesystem:

# dpkg-deb -x opennebula_4.0.0-1_amd64.deb /

Execute the following command to install the ruby gems:

# /usr/share/opennebula/install_gems
No LSB modules are available.
Distribution "debian" detected.
About to install these dependencies:
* make
* gcc
* g++
* libsqlite3-dev
* libcurl4-openssl-dev
* libmysqlclient-dev

Press enter to continue...

apt-get install make gcc g++ libsqlite3-dev libcurl4-openssl-dev libmysqlclient-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
g++ is already the newest version.
gcc is already the newest version.
make is already the newest version.
make set to manually installed.
libmysqlclient-dev is already the newest version.
libmysqlclient-dev set to manually installed.
libsqlite3-dev is already the newest version.
libcurl4-openssl-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
About to install the gems for these components:
* sunstone
* quota
* cloud
* ozones_server
* auth_ldap

Press enter to continue...

rake="/usr/bin/rake" gem install --no-ri --no-rdoc json rack sinatra thin sequel sqlite3 amazon-ec2 uuidtools curb mysql net-ldap
Fetching: json-1.8.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed json-1.8.0
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: tilt-1.4.1.gem (100%)
Fetching: rack-protection-1.5.0.gem (100%)
Fetching: sinatra-1.4.2.gem (100%)
Successfully installed tilt-1.4.1
Successfully installed rack-protection-1.5.0
Successfully installed sinatra-1.4.2
Fetching: eventmachine-1.0.3.gem (100%)
Building native extensions.  This could take a while...
Fetching: daemons-1.1.9.gem (100%)
Fetching: thin-1.5.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed eventmachine-1.0.3
Successfully installed daemons-1.1.9
Successfully installed thin-1.5.1
Fetching: sequel-3.47.0.gem (100%)
Successfully installed sequel-3.47.0
Fetching: sqlite3-1.3.7.gem (100%)
Building native extensions.  This could take a while...
Successfully installed sqlite3-1.3.7
Fetching: xml-simple-1.1.2.gem (100%)
Fetching: amazon-ec2-0.9.17.gem (100%)
Successfully installed xml-simple-1.1.2
Successfully installed amazon-ec2-0.9.17
Fetching: uuidtools-2.1.4.gem (100%)
Successfully installed uuidtools-2.1.4
Fetching: curb-0.8.3.gem (100%)
Building native extensions.  This could take a while...
Successfully installed curb-0.8.3
Fetching: mysql-2.9.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed mysql-2.9.1
Fetching: net-ldap-0.3.1.gem (100%)
Successfully installed net-ldap-0.3.1
16 gems installed

Now it's time to take a look at the source package. Extract opennebula-4.0.0.tar.gz in a work directory, cd to opennebula-4.0.0 then # cat README.md. By following all the instructions, you will be able to compile the package from source. This may come in handy should any of the files that were extracted manually from the opennebula_4.0.0-1_amd64.deb package for Squeeze give problems. Notice that this source package from C12G Labs is generic Linux - it does not contain a debian directory with Debian-specific patches and post-install scripts like you see in Debian source packages. Chances are that if you install everything from the generic package that was built manually, the paths, setup and file locations will be different than as installed with pre-built .deb packages.

The binaries from the Squeeze build need to be checked. Here is where old dependency versions become a problem:

# file /usr/bin/oned
/usr/bin/oned: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=afa4c3bb5368041897a81332b8199c7bc117aff9, stripped
# ldd /usr/bin/oned | grep "not found"
        libcrypto.so.0.9.8 => not found
        libmysqlclient.so.16 => not found
        libxmlrpc_client++.so.3 => not found
        libxmlrpc_server_abyss++.so.3 => not found
        libxmlrpc_server++.so.3 => not found
        libxmlrpc++.so.3 => not found
# file /usr/bin/mm_sched
/usr/bin/mm_sched: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=acf51698217b11b81cfa77c30af7f522e405ff2a, stripped
# ldd /usr/bin/mm_sched | grep "not found"
        libcrypto.so.0.9.8 => not found
        libmysqlclient.so.16 => not found
        libxmlrpc_server_abyss++.so.3 => not found
        libxmlrpc_server++.so.3 => not found
        libxmlrpc_client++.so.3 => not found
        libxmlrpc++.so.3 => not found

We built binary files oned and mm_sched from source with mysql support (# scons mysql=yes), so we can replace them. The new dynamic library versions are:

        libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fc3db051000)
        libmysqlclient.so.18 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 (0x00007f69da287000)
        libxmlrpc_server_abyss++.so.4 => /usr/lib/libxmlrpc_server_abyss++.so.4 (0x00007f69d9059000)
        libxmlrpc_server++.so.4 => /usr/lib/libxmlrpc_server++.so.4 (0x00007f69d8e4f000)
        libxmlrpc_client++.so.4 => /usr/lib/libxmlrpc_client++.so.4 (0x00007f69d9a41000)
        libxmlrpc++.so.4 => /usr/lib/libxmlrpc++.so.4 (0x00007f69d83ed000)

A quick hack would be to symbolically link the higher version shared libs to lower version names, but replacing the binaries with newly compiled ones is more robust.

The OpenNebula installation is now ready for configuration. Visit the OpenNebula 4.0 Guides site for comprehensive setup instructions.

A few hints for quick and dirty testing:

# chown oneadmin:cloud /var/lib/one
# mkdir /var/lib/one/.one; chmod 700 /var/lib/one/.one
# echo "oneadmin:password" > /var/lib/one/.one/one_auth
# chmod 600 /var/lib/one/.one/one_auth
# chown -R oneadmin:cloud /var/lib/one/.one
# chown oneadmin:cloud /var/log/one
# mkdir /var/tmp/one; chown oneadmin:cloud /var/tmp/one
# /etc/init.d/opennebula start
# oneuser list
  ID NAME            GROUP      AUTH           VMS            MEMORY         CPU
   0 oneadmin        oneadmin   core             -                 -           -
   1 serveradmin     oneadmin   server_c         -                 -           -

Examine the logs in /var/log/one and correct problems, if any.

The second component to start is the sunstone-server. Execute:

# /etc/init.d/opennebula-sunstone start
VNC proxy started
Error executing sunstone-server.
Check /var/log/one/sunstone.error and /var/log/one/sunstone.log for more information
Unfortunately, sunstone-server won't start. From the sunstone.error logs:

Requiring "OpenNebula" is deprecated. Use "opennebula".
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- OpenNebula/DocumentJSON (LoadError)
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/one/ruby/oneapps/stage/onechef.rb:22
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/share/opennebula/sunstone/routes/appstage.rb:19
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/share/opennebula/sunstone/sunstone-server.rb:241
        from /usr/share/opennebula/sunstone/sunstone-server.rb:240:in `each'
        from /usr/share/opennebula/sunstone/sunstone-server.rb:240

By a similar name, file /usr/lib/one/ruby/opennebula/document_json.rb exists. The sunstone-server and associated ruby scripts are part of the opennebula-sunstone_4.0.0-1_all.deb package which installed correctly.

So I'm thinking that someone changed the ruby filenames for whatever reason, but left in place the old name references. Linux is case sensitive. Do the following:

# cd /usr/lib/one/ruby/
# ln -s opennebula OpenNebula
# cd OpenNebula
# cp -p document_json.rb DocumentJSON.rb
# cp -p document_pool_json.rb DocumentPoolJSON.rb
# /etc/init.d/opennebula-sunstone start
VNC proxy started
sunstone-server started

Et voila! Problem solved. Check URL http://localhost:9869/ for the OpenNebula Sunstone login prompt.

OpenNebulaApps

There is another package you can download from opennebula.org called oneapps_3.8.3.deb and which installs as follows:

# dpkg --info oneapps_3.8.3.deb
 new debian package, version 2.0.
 size 396408 bytes: control archive=1406 bytes.
       0 bytes,     0 lines      conffiles            
     380 bytes,    13 lines      control              
    3362 bytes,   146 lines   *  postinst             #!/bin/bash
 Package: oneapps
 Version: 3.8.3
 License: Apache
 Vendor: C12G Labs
 Architecture: all
 Maintainer: C12G Labs 
 Installed-Size: 1080
 #Pre-Depends: 
 Section: default
 Priority: extra
 Homepage: http://opennebula.pro
 Description: 
  OpenNebula Apps is a group of tools for users and administrators of OpenNebula that simplifies and optimizes cloud application management.
# dpkg -i oneapps_3.8.3.deb
Selecting previously unselected package oneapps.
(Reading database ... 308725 files and directories currently installed.)
Unpacking oneapps (from oneapps_3.8.3.deb) ...
Setting up oneapps (3.8.3) ...
grep: /etc/one/sunstone-plugins.yaml: No such file or directory

OpenNebula Apps needs the folowing dependencies to run correctly:

  * OpenNebula

  * MongoDB. This database is needed for AppMarket. To install it
    you can follow the instructions at
        http://docs.mongodb.org/manual/installation/

  * ruby and rubygems installed. This should be already installed
    if you have already OpenNebula

  * bundler. Needed for both AppFlow and AppMarket. To install it
    you can issue:
        # gem install bundler

  * Required gems. To install the gems needed by AppFlow and
    AppMarket do this:
        # cd /usr/lib/one/ruby/oneapps/flow && bundle install
        # cd /usr/lib/one/ruby/oneapps/market && bundle install

# dpkg -l|grep mongodb
ii  mongodb                               1:2.4.3-1                          amd64        object/document-oriented database (metapackage)
ii  mongodb-clients                       1:2.4.1-2                          amd64        object/document-oriented database (client apps)
ii  mongodb-dev                           1:2.4.3-1                          amd64        object/document-oriented database (development)
ii  mongodb-server                        1:2.4.1-2                          amd64        object/document-oriented database (server package)
# gem install bundler
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
1 gem installed
Installing ri documentation for bundler-1.3.5...
Installing RDoc documentation for bundler-1.3.5...
# cd /usr/lib/one/ruby/oneapps/flow && bundle install
Fetching gem metadata from http://rubygems.org/..........
Fetching gem metadata from http://rubygems.org/..
Installing json (1.7.3) 
Installing rack (1.4.1) 
Installing rack-protection (1.2.0) 
Installing tilt (1.3.3) 
Installing sinatra (1.3.2) 
Installing xml-simple (1.1.1) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
# cd /usr/lib/one/ruby/oneapps/market && bundle install
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Installing bcrypt-ruby (3.0.1) 
Installing bson (1.6.2) 
Installing bson_ext (1.6.2) 
Installing diff-lcs (1.1.3) 
Installing haml (3.1.6) 
Installing i18n (0.6.0) 
Using json (1.7.3) 
Installing mime-types (1.18) 
Installing polyglot (0.3.3) 
Installing treetop (1.4.10) 
Installing mail (2.4.4) 
Installing mongo (1.6.2) 
Using rack (1.4.1) 
Using rack-protection (1.2.0) 
Installing rack-test (0.6.1) 
Installing redcarpet (2.1.1) 
Installing rspec-core (2.6.4) 
Installing rspec-expectations (2.6.0) 
Installing rspec-mocks (2.6.0) 
Installing rspec (2.6.0) 
Using tilt (1.3.3) 
Using sinatra (1.3.2) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

All files from the apps package that install in /usr/bin are ASCII text ruby scripts, so there are no binary compatibility issues to worry about. The OpenNebulaApps docs for AppStage, AppFlow and AppMarket can be found here.

The only thing is, the version of the OpenNebulaApps package currently available is 3.8. As the developer C12G Labs cautions:

"Although the OpenNebulaApps suite is now installed and configured as a separated component, it will be incorporated into the OpenNebula main distribution in one of the upcoming OpenNebula releases.

A new version of OpenNebulaApps to work on OpenNebula 4.0 will be available for download in few days."

This indicates that the latter part of the install procedure may change.

[PREV] Installing OpenStack on a Dell XPS13 Ultrabook running Debian Wheezy
[PREV] Installing Debian Wheezy on a Dell XPS13 Ultrabook

Cheers,

Mitch Halmu
NetSide Corporation
305-531-1995