Project

General

Profile

Install procedure

Install dependencies

sudo yum install g++ xmlrpc-c xmlrpc-c-devel scons sqlite3 mysql libxml2 openssl ruby rubygems ruby-dev java-1.7.0-openjdk -y
sudo gem install nokogiri rake xmlparser

Install OpenNebula in self-contained mode

cd /opt/one-slots
wget http://sweet.ua.pt/~a23619/opennebula-3.8.3.tar.gz
tar -xvf opennebula-3.8.3.tar.gz
/opt/one-slots/opennebula-3.8.3/scons mysql=yes
./opt/one-slots/opennebula-3.8.3/install.sh -d /opt/one-slots/3.8.3
./opt/one-slots/3.8.3/share/install_gems
ln -s /opt/one-slots/3.8.3/ opennebula
ln -s /mnt/data/one-var/ /opt/opennebula_shared
ln -s /opt/opennebula_shared var
usermod -u 1001 oneadmin
groupmod -g 1001 oneadmin

Create SSH keys

cd
ssh-keygen
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh/
chmod 600 ~/.ssh/id_dsa.pub
chmod 600 ~/.ssh/id_dsa
chmod 600 ~/.ssh/authorized_keys
mkdir ~/.one
echo "oneadmin:anossapassword" > ~/.one/one_auth
chmod 600 ~/.one/one_auth

Create environment variables on bash_profile

vi /.bash_profile
export ONE_LOCATION=/opt/opennebula
export ONE_XMLRPC=http://localhost:2633/RPC2
export ONE_AUTH=
/.one/one_auth
export ONE_SHARE=$ONE_LOCATION/opennebula_shared
#SUNSTONE_CONF=$ONE_LOCATION/etc
#ONE_PUBLIC_SUNSTONE=$ONE_LOCATION/lib/sunstone/public
#ONE_PUBLIC_SELFSERVICE=$ONE_LOCATION/lib/ruby/cloud/occi/ui/public
#SELFSERVICE_CONF=$ONE_LOCATION/etc/occi-server.conf
export JAVA_HOME = /usr/lib/jvm/java-1.6.0-openjdk.x86_64/
source ~/.bash_profile

Configure Libvirt/KVM/QEMU - run as root

vi /etc/libvirt/libvirtd.conf
unix_sock_group = oneadmin
unix_sock_ro_perms = 0777
unix_sock_rw_perms = 0777
auth_unix_rw = "none"
service libvirtd restart
vi /opt/opennebula/etc/vmm_exec/vmm_exec_kvm.conf
EMULATOR = /usr/libexec/qemu-kvm

Configure NFS to share

sudo vi /etc/exports
/opt/opennebula 192.168.160.0/24(rw,sync,no_subtree_check,all_squash,anonuid=1001,anongid=1001)
/opt/opennebula_shared 192.168.160.0/24(rw,sync,no_subtree_check,all_squash,anonuid=1001,anongid=1001)
sudo exportfs -ar
sudo service nfs restart
sudo service rpcbind restart
sudo service nfslock restart

Configure firewall

sudo vi /etc/sysconfig/iptables
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:65536]
:OUTPUT ACCEPT [0:65536]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32769 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32769 -j ACCEPT
#noVNC ports
-A INPUT -m state --state NEW -m tcp -p tcp --dport 29876 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 29876 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 35776:46776 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 35776:46776 -j ACCEPT
#mySQL
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 3306 -j ACCEPT
#HTTP
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4567:4572 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 4567:4572 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:7000 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 5900:7000 -j ACCEPT

Configure MySQL

sudo /etc/init.d/mysqld start
sudo chkconfig mysqld on
/usr/bin/mysqladmin -u root password 'R00t.my5ql.11'
/usr/bin/mysqladmin -u oneadmin password 'oneadmin'
mysql -u root -p
GRANT ALL PRIVILEGES ON opennebula.* TO 'oneadmin' IDENTIFIED BY 'oneadmin';
CREATE USER 'oneadmin'@'localhost' IDENTIFIED BY 'oneadmin';
CREATE DATABASE opennebula;
QUIT

Configure ONE

vi /etc/opennebula/oned.conf
vi /etc/opennebula/sunstone-server.conf
one start
sunstone-server start

Configure Amazon EC2

wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.noarch.rpm
rpm -ivh ec2-ami-tools.noarch.rpm
http://sweet.ua.pt/~a23619/cert.pem
export EC2_HOME=~/ec2-api-tools-1.6.3.1
export EC2_KEYPAIR=aws_hpc
export EC2_URL=https://ec2.us-east-1.amazonaws.com
export EC2_PRIVATE_KEY=~/.ec2/pk.pem
export EC2_CERT=~/.ec2/cert.pem
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64/
vi /opt/opennebula/etc/vmm_ec2/vmm_ec2rc
EC2_PRIVATE_KEY="~/.ec2/pk.pem"
EC2_CERT="~/.ec2/cert.pem"i
EC2_HOME=~/ec2-api-tools-1.6.3.1
EC2_KEYPAIR=aws_hpc
EC2_URL=https://ec2.us-east-1.amazonaws.com
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk.x86_64/
vi /opt/opennebula/oned.conf
VM_MAD = [
name = "vmm_ec2",
executable = "one_vmm_ec2",
arguments = "-u https://ec2.us-east-1.amazonaws.com -k /home/oneadmin/.ec2/pk.pem -c /home/oneadmin/.ec2/cert.pem -h /home/oneadmin/ec2-api-tools-1.6.3.1 vmm_ec2/vmm_ec2.conf",
type = "xml" ]

Configure ONE Apps

sudo ln -s /opt/opennebula/etc/sunstone-plugins.yaml /etc/one/sunstone-plugins.yaml
sudo ln -s /opt/opennebula/etc/sunstone-server.conf /etc/one/sunstone-server.conf
sudo gem install bundler
sudo rpm -i http://sweet.ua.pt/~a23619/oneapps_3.8.3.rpm
cd /usr/lib/one/ruby/oneapps/flow
bundle install
cp /opt/opennebula/var/.one/sunstone_auth /opt/opennebula/var/.one/appflow_auth
oneacl create "* DOCUMENT/* CREATE"
cp /usr/lib/one/sunstone/public/images/* /opt/opennebula/lib/sunstone/public/images/
cp /usr/lib/one/sunstone/public/js/user-plugins/* /opt/opennebula/lib/sunstone/public/js/user-plugins/
cp /usr/lib/one/sunstone/public/js/opennebula.js /opt/opennebula/lib/sunstone/public/js
cp /usr/lib/one/sunstone/routes/* /opt/opennebula/lib/sunstone/routes/
cp -r /usr/lib/one/ruby/oneapps /opt/opennebula/lib/ruby/oneapps
ln -s /etc/one/appflow-server.conf /opt/opennebula/etc/appflow-server.conf
ln -s /etc/one/sunstone-appflow.conf /opt/opennebula/etc/sunstone-appflow.conf
ln -s /etc/one/sunstone-appmarket.conf /opt/opennebula/etc/sunstone-appmarket.conf