KVM Virtualization With Enomalism 2 On An Ubuntu 8.10 Server
Version 1.0
Author: Falko Timme
Enomalism ECP (Elastic Computing Platform) provides a web-based control panel that lets you design, deploy, and manage virtual machines on one or more host systems (in the case of multiple systems, we speak of a cluster or cloud). This article shows how you can use Enomalism (also know as Enomaly) to manage KVM guests on one Ubuntu 8.10 server.
I do not issue any guarantee that this will work for you!
1 Preliminary Note
I'm using an Ubuntu 8.10 server with the hostname server1.example.com and the IP address 192.168.0.100 here as my KVM host. The server is located in a private network with a DHCP server (on the router, IP 192.168.0.1). Enomalism usage might be different if you use it in a public network.
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
sudo su
Please check if your CPU supports hardware virtualization - if this is the case, the command
egrep '(vmx|svm)' --color=always /proc/cpuinfo
should display something, e.g. like this:
root@server1:~# egrep '(vmx|svm)' --color=always /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy 3dnowprefetch
root@server1:~#
If nothing is displayed, then your processor doesn't support hardware virtualization, and you must stop here.
2 Installing Enomalism 2
First we install some prerequisites (including KVM):
aptitude install ssh build-essential python-dev libxen3.1-dev kvm mysql-server mysql-client libmysqlclient15-dev python-libvirt python-mysqldb libvirt-bin python-setuptools qemu bridge-utils
You will be asked to provide a MySQL root password:
New password for the MySQL "root" user: <-- yourrootsqlpassword
Repeat password for the MySQL "root" user: <-- yourrootsqlpassword
Then we go to the /opt directory...
mkdir -p /opt
cd /opt
... and download the latest Enomalism .deb package from http://sourceforge.net/project/showfiles.php?group_id=164855&package_id=186866&release_id=667675, e.g. as follows:
wget http://dfn.dl.sourceforge.net/sourceforge/enomalism/enomalism2-2.2.3.deb
After the download has finished, we install Enomalism as follows:
dpkg -i enomalism2-2.2.3.deb
Now we must configure Enomalism. Run
cd enomalism2/
scripts/init-db.sh yourrootsqlpassword enomalism enomalismpassword
Replace yourrootsqlpassword with the MySQL root password that you've set at the beginning of this tutorial. enomalism is the name of the database user that Enomalism will use to connect to the MySQL database, and enomalismpassword is the database password for the user enomalism. Replace both with a username/passsword of your choice.
In the /opt/enomalism2 directory, there should be a file called server1.example.com.cfg. We copy that file to the /opt/enomalism2/config directory:
cp server1.example.com.cfg config/server1.example.com.cfg
Run
uuidgen
and write down the ID that the command generates (we need it in the next step where we modify /opt/enomalism2/config/server1.example.com.cfg):
root@server1:/opt/enomalism2# uuidgen
ad152057-eb8f-4f8b-9744-c33ca44522d0
root@server1:/opt/enomalism2#
Now we edit /opt/enomalism2/config/server1.example.com.cfg:
vi config/server1.example.com.cfg
Please adjust the following four values:
[...] sqlobject.dburi="mysql://enomalism:enomalismpassword@localhost:3306/enomalism2" [...] enomalism2.baseurl="http://192.168.0.100:8080/rest/" [...] enomalism2.ip_addr="192.168.0.100" [...] enomalism2.self="ad152057-eb8f-4f8b-9744-c33ca44522d0" [...] |
Make sure you use the correct database user and password for the MySQL database and the correct IP address for the next two settings. In the enomalism2.self line, you should use the ID generated by uuidgen.
You will also find the settings enomalism2.drivestorage='file' and enomalism2.storagetarget='file:///xen/' in that file. Currently, Enomalism doesn't support LVM, so you should not change these settings!
Next edit /etc/libvirt/qemu.conf...
vi /etc/libvirt/qemu.conf
... and uncomment the line vnc_listen = "0.0.0.0":
[...] vnc_listen = "0.0.0.0" [...] |
(Otherwise you won't be able to connect to the KVM guests via VNC from a remote machine!)
Restart libvirt-bin afterwards:
/etc/init.d/libvirt-bin restart
Now we can start Enomalism (you should still be in the /opt/enomalism2 directory):
scripts/enomalism2.sh start
To make Enomalism start automatically whenever you boot the system, you can add the following line to /etc/rc.local:
vi /etc/rc.local
[...] cd /opt/enomalism2 && scripts/enomalism2.sh start [...] |
Now open a browser and go to http://192.168.0.100:8080. This should finish the Enomalism installation:
Click on the Click here to use Enomalism2! link: