1. Framework of the experiment environment: (1) Management node (opennebula node) OS: Ubuntu12.04-amd64IP
1. Framework of the experiment environment:
(1) Management node (opennebula node)
OS: Ubuntu 12.04-amd64 IP: 192.168.0.11
(2) computing nodes (VM deployment nodes)
OS: ubuntu 12.04-amd64 IP: 192.168.0.12
(3) This document also describes how to use the current node as a management node and a computing node!
2. ssh login without a password
Reference: openssh password-less access configuration between management nodes and computing nodes ssh mutual password-less login http://www.linuxidc.com/Linux/2012-06/62932.htm
3. Configure and install computing nodes (if you use the local machine, install these software on the local machine)
(1) Installation of virtualization-related software
- Sudo apt-Get install qemu-Kvm libvirt-Bin ubuntu-Vm-Builder bridge-Utils ruby
Modify/etc/libvirt/lib1_d. conf, find unix_sock_group, and change its value:
- Unix_sock_group= "Oneadmin"
Modify/etc/libvirt/qemu. conf and cancel the comment of the following line:
- Vnc_listen= "0.0.0.0"
Restart the libmongod Process
- Sudo service libvirt-Bin restart
Modify /Var/Run/Libvirt/Libvirt-Group of sock files
- Sudo chown:Oneadmin/Var/Run/Libvirt/Libvirt-Sock
4. opennebula-3.4 installation on Management Nodes
(1) Bridge installation and configuration
- Sudo apt-Get install bridge-Utils
Modify the interface file as follows:
- # The loopback network interface
- Auto lo
- Iface lo inet loopback
- # The primary network interface
- Auto eth0
- Iface eth0 inet manual
- Auto br0
- Iface br0 inet static
- Address 192.168.0.11
- Netmask 255.255.255.0
- Broadcast 192.168.0.254
- Gateway 192.168.0.1
- Bridge_ports eth0
- Bridge_fd 9
- Bridge_hello 2
- Bridge_maxage 12
- Bridge_stp off
Restart NIC:
- Sudo/Etc/Init.D/Networking restart
(2) opennebula installation and configuration
- Sudo mkdir-P/Var/Lib// * Create the opennebula installation directory */
- Sudo groupadd-G 10000 oneadmin/* Create oneadmin Group */
Create a oneadmin user.-d: Specifies the Home Directory of the user.-s: Specifies the shell used by the user after logon.-g: Specifies the group of the user.
- Sudo useradd-U 10000-M oneadmin-D/Var/Lib/One-S/Bin/Bash-G oneadmin
Set password for oneadmin user
- Sudo passwd oneadmin
Set the owner and user of the oneadmin user's home directory
- Sudo chown-R oneadmin:Oneadmin/Var/Lib/One
Test whether the oneadmin user can log on correctly.
- Su-L oneadmin
If yes, enter the exit command to exit!
The NFS server can be installed to specify the imgfile transmission mode through nfs.
- Sudo apt-Get install nfs-Kernel-Server
Modify the/etc/ioports file and add the following content (meaning: 192 .168 .0 .0 /Hosts within 24 can access the/var/lib/one directory according to the requirements in brackets, or *, indicating all ip addresses in this network segment ):
- /Var/Lib/One192.168.0.0/24(Rw,Sync,No_subtree_check,No_root_squash,Anonuid=10000,Anongid=10000)
Restart the NFS service
- Sudo/Etc/Init.D/Nfs-Kernel-Server start
Switch to the oneadmin user and install required software
- Su-L oneadmin
- Sudo apt-Get install libsqlite3-Dev libxmlrpc-C3-Dev g++Ruby libopenssl-Ruby libssl-Dev ruby-Dev
- Sudo apt-Get install libxml2-Dev libmysqlclient-Dev libmysql++-Dev libsqlite3-Ruby libexpat1-Dev
- Sudo apt-Get install rake rubygems libxml-Parser-Ruby1.8 lib1_t1-Dev genisoimage scons
- Sudo gem install nokogiri rake xmlparser
- Sudo apt-Get install mysql-Server
Configure the mysql database and run the following command:
- Mysql-U root-P
- CREATE USER'Oneadmin'@'Localhost'IDENTIFIED'Oneadmin';
- Create database opennebula;
- Grant all privileges on opennebula.*TO'Oneadmin'IDENTIFIED'Oneadmin';
- Quit;
Decompress opennebula and compile it:
- Cd~/Opennebula-3.1.4
- Scons sqlite=No mysql=Yes
Install opennebula:
- ./Install.Sh-U oneadmin-G oneadmin-D/Var/Lib/One
Set environment variables related to opennebula:
- Vim~/.Bash_profile
- Export ONE_LOCATION=/Var/Lib/One
- Export ONE_AUTH=$ONE_LOCATION/.One/One_auth
- Export ONE_XMLRPC=Http://192.168.0.12:2633/RPC2
- Export PATH=$ONE_LOCATION/Bin:/Usr/Local/Bin:/Var/Lib/Gems/1.8/Bin/:/Var/Lib/Gems/1.8/:$PATH
NOTE: If your environment is a local machine, that is, a management node and a computing node, change 192.168.0.12 to localhost.
- Source~/.Bash_profile
Create an opennebula user authorization file:
- Mkdir~/.One
- Echo"Oneadmin: " > ~/.One/One_auth
Modify the opennebula configuration file:
- /* Comment 58 rows */
- # DB= [Backend= "Sqlite" ]
- /* Modify lines 61-66 as follows */
- DB= [Backend= "Mysql",
- Server= "192.168.0.12",/* If the local computer is used as the computing node and the management node, change it to: localhost */
- Port=0,
- User= "Oneadmin",
- Passwd= "Oneadmin",
- Db_name= "Opennebula" ]
Start opennebula and test whether the installation is successful:
- One start
- Onevm list
If the following content is displayed, the installation is successful:
- ID USER GROUP NAMESTAT CPU MEM HOSTNAME TIME