How to configure a Private Cloud using Open Nebula

A Private Cloud has two components. One is the Frontend node and and the other acts as the Cluster Node.Frontend Node: This node acts the Cloud Manager and has Open Nebula installed on it.Cluster Node: The cluster node acts as the Cloud Host running multiple Virtual machines over a Hypervisor. The VMs are created using Virtual Box.Commands to setup Frontend NodeVerify that the Front end can ping the Host. Use wired connectivity such as Ethernet cable or LAN to configure them in same network.Please follow these steps to create user account (oneadmin) for managing open nebula:sudo mkdir -p /srv/cloud
sudo groupadd -g 1001 cloud
sudo useradd -u 1001 -g cloud -m oneadmin -d /srv/cloud/one -s /bin/bash
sudo passwd oneadmin
sudo chown -R oneadmin:cloud /srv/cloud
su -l oneadminNote: From admin account you can fire these commands to add one admin in sudo group list so that it can install software without permission problemssudo adduser oneadmin sudoNow you have created a user account for one admin. Please note that your main directory of working will be always /srv/cloud/one. Now we will share this directory with NFS clients which are hosts. This is to ensure that they can access the services and files from
server which is front end. The steps are as follows:sudo apt-get install nfs-kernel-server (install the nfs server)sudo gedit /etc/exports (append to this file the below given information)/export,fsid=0,insecure,no_subtree_check,async)Note: will be replaced by your network address of LAN or network.Please refer this guide if facing any issues regarding formats which changes frequently. /etc/init.d/nfs-kernel-server restart (restart the nfs server services)Install Open ssh for secure communication between Cloud front end and Host.Install open ssh serversudo apt-get install openssh-serversudo cp /etc/ssh/sshd_config ~ //(Make a copy of sshd config file as we are going to edit the original file so in case of problems with your changes you can always revert back)sudo gedit /etc/ssh/sshd_config (edit the configuration file now)Change the “PermitRootLogin” directive to “no”Change the “StrictHostKeyChecking” directive “no” //(if you don’t find it by this name you will find a similar name in the file
below PermitRootLogin.)sudo /etc/init.d/ssh restart (restart the sshd server with the changed configuration)
** oneadmin@ubuntu:~$ssh-keygen -t rsa (Create RSA keys and put at remote host so that SSH does not ask for password everytime while doing ssh)oneadmin@ubuntu:~$ scp ~/.ssh/ oneadmin@ (Please note this is a single command and is to place the key at remote host via scp)Now to complete this process we need to login to remote host:user@remotebox: mkdir .ssh (create a directory .ssh)user@remotebox:~cd .sshuser@remotebox:~/.ssh $ cat >> authorized_keys2user@remotebox:~/.ssh $ cat >> authorized_keysuser@remotebox:~/.ssh$ rm id_rsa_localbox.pubCheck after these commands oneadmin will be able to ssh the remote host without password. Try thisoneadmin@ubuntu: ssh oneadmin@
a. where oneadmin is name of user account at host and is IP address of the remote host.You will get logged in to remote host, if the above steps went successfully.Now install the dependencies needed for running open nebulasudo apt-get install libsqlite3-dev libxmlrpc-c3-dev g++ ruby libopenssl-ruby libssl-dev ruby-devsudo apt-get install libxml2-dev libmysqlclient-dev libmysql++-dev libsqlite3-ruby libexpat1-devsudo apt-get install rake rubygems libxml-parser-ruby1.8 libxsltl-dev genisoimage sconsInstall MySQL for database for opennebulasudo apt-get install mysql-servermysql -u root –pCREATE USER ‘oneadmin’@‘localhost’ IDENTIFIED BY ‘oneadmin’;CREATE DATABASE opennebula;GRANT ALL PRIVILEGES ON opennebula.* TO ‘oneadmin’ IDENTIFIED BY ‘oneadmin’;Quit;Note: Please write these commands on terminal sometimes special character copying may cause syntax errors.Now finally install open nebula softwareSu –l oneadminDownload latest Open nebula tarball from tar xzf opennebula-3.0.0.tar.gzcd opennebula-3.0.0scons sqlite=no mysql=yes (build opennebula with my sql support)./ -u oneadmin -g cloud -d /srv/cloud/oneSet up the environment variable. Add them to ~/.bash-profilesudo gedit ~/.bash_profile (append the text to this file)export ONE_LOCATION = /srv/cloud/oneexport ONE_AUTH=$ONE_LOCATION/.one/one_authexport ONE_XMLRPC=http://localhost:2633/RPC2export PATH=$ONE_LOCATION/bin:/usr/local/bin:/var/lib/gems/1.8/bin:$PATH (Note: it is a single command)- Source ~/.bash_profile to initialize those variablemkdir ~/.oneecho “oneadmin:passwd” >~/.one/one_auth- Configure ~/etc/oned.conf .Uncomment the following linesSudo gedit ~/etc/oned.confDB = [backend = “mysql”,Server = “local host”,Port =0,User = “oneadmin”,passwd = “oneadmin”,db_name = “opennebula”]- Run opennebulaOne startIf it starts successfully you are done installing opennebula on front end.- Note: If you find the error opennebula is not installed in your system try installing from apt-get repository using the command

News Reporter

Leave a Reply

Your email address will not be published. Required fields are marked *