Ok, as time goes by… I want to learn about advanced topics from OpenNebula. I’m going to start working with Opennebula Zones (ozones) which will allow me to create a Virtual Data Center. As I have only one machine in my lab (I accept hardware donations to increase my lab potential š ) I will have only one zone to play but that’s better than nothing.
If you are interested in OpenNebula Zones and Virtual Data Centers please read:
- http://opennebula.org/documentation:rel4.0:ozones
- http://opennebula.org/documentation:rel4.0:ozonescfgĀ (I’ve used this doc to prepare this post)
Disclaimer: the following configuration steps will help you to to run the ozones-server in a development environment, if you want to use ozones-server in a production environment please check first how to protect your Apache server conveniently (e.g disable unneeded modules)
Ok. These are the steps I’ve followed:
// Download the OpenNebula rpm packagesĀ #yum localinstall opennebula-common-4.0.0-1.x86_64.rpm #yum localinstall opennebula-ruby-4.0.0-1.x86_64.rpmĀ #yum localinstall opennebula-ozones-4.0.0-1.x86_64.rpm // Install the Apache package #yum install httpd // Configure the service so it's started at boot #chkconfig httpd on // Let's add an iptables rules so http traffic is allowed #iptables -I INPUT -m tcp -p tcp --dport 80 -m state --state=NEW,ESTABLISHED,RELATED -j ACCEPT #service iptables save // Edit your /etc/httpd/conf/httpd.conf and change some default parameters like your // ServerName, ServerSignature Off... The rewrite and the http proxy modules are enabled // by default // Let's create a configuration file e.g /etc/httpd/conf.d/ozones.conf where // reverse proxy directives are configured. Add this lines to the file: ProxyPass /ozones/ http://localhost:6121/ ProxyPassReverse /ozones/ http://localhost:6121/ ProxyRequests Off // Start your Apache server #service httpd start // If you have SELinux enabled we must allow Apache to start network connections: #setsebool -P httpd_can_network_connect 1 // Now let's prepare some things to start the ozones server // Add a user:password line into a file e.g ozonesadmin:ozonepassword and set permissions for // oneadmin user. #echo ozonesadmin:ozonepassword > /var/lib/one/.one/ozones_auth #chown oneadmin:oneadmin /var/lib/one/.one/ozones_auth // OK!!! NOW USE THE ONEADMIN ACCOUNT #su oneadmin // The first time you start the ozones-server you must set at leat the OZONES_AUTH env variable // so the database is created with the right credentials. I'm using the default sqlite database // If you want to change the port and ip address for the server or the database server edit the // /etc/one/ozones-server.conf file $export OZONES_AUTH=/var/lib/one/.one/ozones_auth $export OZONES_URL="http://localhost:6121" // Let's start and check if the ozones server is listening $ /usr/bin/ozones-server start $ netstat -ntap | grep 6121 tcp 0 0 127.0.0.1:6121 0.0.0.0:* LISTEN 20203/ruby
Great. If the apache proxy module works fine and the ozones-server is running we will be able to log into the ozones gui.
I’ve configured a proxy directive so http://myservername/ozones/ is sent to http://localhost:6121 where ozones-server is listening by default, if you use http://myservername/ozones it won’t work (css, javascript… will be missing). Remember that your user and password are configured in the authentication file you’ve created (in my case is located in /var/lib/one/.one/ozones_auth).
Finally some screenshots:
In a few days, I’ll play with the zones configuration.
Enjoy!