Step-by-Step OpenQRM with LXC in Debian /Ubuntu

21
How to install OpenQRM 4.7 with LXC containers in Debian Squeeze/Lenny: Step by Step A new version of this tutorial for OpenQRM 4.8 (Released on March 31, 2011) is available here. To upgrade from OpenQRM v4.7 to v4.8, simply do the following as root: svn co https://openqrm.svn.sourceforge.net/svnroot /openqrm openqrm 1. cd openqrm/trunk/src 2. make && make update 3. OpenQRM 4.7 ( http://www.openqrm.com) was released on September 30, 2010 with LXC support. Wonderful product. Videos of this enterprise grade datacenter management framework is available at http://openqrm.com/?q=node/183 I hope that this information is useful to those who are interested. And thanks to Matt and OpenQRM developers for the hard work! DISCLAIMER: This is something that worked for me. I do not bear responsibility if something breaks down. You need at least a 100GB for this for basic setup. © zenny - Support the Human Ape Project if you like this tutorial. Click here to support. This tutorial cannot be copied or tweeted without this line. A) INSTALL DEBIAN SQUEEZE (ALSO APPLIES TO LENNY WITH BACKPORT KERNEL) How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/ 1 of 21 02/18/2013 09:53 AM

description

How to install OpenQRM 4.7 with LXC containers in Debian Squeeze/Lenny: Step by StepAdditional features in this release include remote VM console and support for ICING and automated VLAN management with OpenVSwitch. Enhanced high-availability using Pacemaker + Corosync is something very valueable for a mission-critical datacenter included in this release among others.Wonderful enterprise grade datacenter management framework! I hope that this information is useful to those who are interested. And thanks to Matt and OpenQRM developers for the hard work!

Transcript of Step-by-Step OpenQRM with LXC in Debian /Ubuntu

How to install OpenQRM 4.7 withLXC containers in DebianSqueeze/Lenny: Step by Step

A new version of this tutorial for OpenQRM 4.8 (Released onMarch 31, 2011) is available here.

To upgrade from OpenQRM v4.7 to v4.8, simply do the followingas root:

svn co https://openqrm.svn.sourceforge.net/svnroot/openqrm openqrm

1.

cd openqrm/trunk/src2.make && make update3.

OpenQRM 4.7 (http://www.openqrm.com) was released on September 30,2010 with LXC support. Wonderful product. Videos of this enterprisegrade datacenter management framework is available athttp://openqrm.com/?q=node/183 I hope that this information is useful tothose who are interested. And thanks to Matt and OpenQRM developersfor the hard work!

DISCLAIMER: This is something that worked for me. I do not bearresponsibility if something breaks down. You need at least a 100GB forthis for basic setup.

© zenny - Support the Human Ape Project if you like this tutorial. Clickhere to support. This tutorial cannot be copied or tweeted without thisline.

A) INSTALL DEBIAN SQUEEZE (ALSO APPLIES TO LENNY WITHBACKPORT KERNEL)

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

1 of 21 02/18/2013 09:53 AM

A1) Download Debian Squeeze netboot CD from http://debian.orgA2) It will first ask to set up root user password and ask to create a newuser. Give the root password twice and create a new user. It will also askto give the machine's domain and give whatever you like or your tld name.A3) Create 3 partitions. 512MB (1/2GB) for /boot, 2GB for Swap and restfor /. Format /boot as ext4 and / as LVM. (you can find more info on how tocreate LVM2 volume online or can just follow the installer guideline).A4) When it asks what to install, deselect everything including 'StandardAdminstration Utilities'. And also uncheck 'Graphical DesktopEnvironment'.A5) Once the setup is complete, just reboot.

B) CREATE A BRIDGE FOR LXC HOST

B1) First install bridge utilities.

Quote:

#aptitude install bridge-utils

B2) Make changes to the /etc/network/interfaces from:

Quote:

# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interfaceallow-hotplug eth0iface eth0 inet dhcp

to (for static IP):

Quote:

# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interface#allow-hotplug eth0

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

2 of 21 02/18/2013 09:53 AM

#iface eth0 inet dhcp

#Bridge setupauto br0iface br0 inet staticbridge_ports eth0bridge_fd 0address 192.168.10.251netmask 255.255.255.0gateway 192.168.10.254dns-nameservers 192.168.10.254

Change the address, netmask, gateway (find from 'route' command)and dns-nameservers as appropriate.

Then restart the network:

Quote:

#/etc/init.d/networking restart

C) INSTALL LXC

C1)

Quote:

#aptitude install lxc

C2)

Quote:

#mkdir /cgroup

C3) Add the following line in /etc/fstab using a text editor:

Quote:

cgroup /cgroup cgroup defaults 0 0

C4)

Quote:

#mount -a

C2)

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

3 of 21 02/18/2013 09:53 AM

Quote:

#lxc-checkconfig

You will see something like below:

Quote:

$ lxc-checkconfigKernel config /proc/config.gz not found, looking in other places...Found kernel config file /boot/config-2.6.32-5-686--- Namespaces ---Namespaces: enabledUtsname namespace: enabledIpc namespace: enabledPid namespace: enabledUser namespace: enabledNetwork namespace: enabledMultiple /dev/pts instances: enabled

--- Control groups ---Cgroup: enabledCgroup namespace: enabledCgroup device: enabledCgroup sched: enabledCgroup cpu account: enabledCgroup memory controller: missingCgroup cpuset: enabled

--- Misc ---Veth pair device: enabledMacvlan: enabledVlan: enabledFile capabilities: enabled

Note : Before booting a new kernel, you can check its configurationusage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

The only thing that you cannot do with the vanilla debian squeezekernel reporting 'Cgroup memory controller: missing' parameter is toallocate memory. One can recompile the kernel with memory controllerenabled in a debian way (shall explain in another tutorial if needed),but it hogs 2-3% of CPU resources.

D) INSTALL DEBOOTSTRAP TO TEST FIRST CONTAINER

D1) You need to install debootstrap for creating templates for thecontainers, so install it by executing:

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

4 of 21 02/18/2013 09:53 AM

Quote:

#aptitude install debootstrap

D2) create a workspace for vm0 container

Quote:

#mkdir -p /var/lib/lxc/vm0

D3) Now debootstrap the debian image for the vm0 container

Quote:

#/usr/lib/lxc/templates/lxc-debian -p /var/lib/lxc/vm0/

It will take a while to complete, and creates a vm0 with a rootpassword 'root' which we will change in D8 below.

D4) Open /var/lib/lxc/vm0/config file and add the following at the endof the file:

Quote:

lxc.utsname = vm0lxc.network.type = vethlxc.network.flags = uplxc.network.link = br0lxc.network.ipv4 = 192.168.7.110/24

Change the ipv4 address as per your network. You can add MAC ofyour network hardware also by adding a line 'lxc.network.hwaddr =00:11:22:33:44:55'

D5) Start vm0 by in daemon mode by executing:

Quote:

#lxc-start -n vm0 -d

D6) To check if it is running, execute:

Quote:

#lxc-info -n vm0 (ENTER)'vm0' is RUNNING

D7) To get into the vm0, execute:

Quote:

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

5 of 21 02/18/2013 09:53 AM

#lxc-console -n vm0

D8) change the root password of the vm0 container by executing:

Quote:

#passwd su

D9) Exit from the container by executing:

Quote:

#poweroff

command which will bring to the host root console.

E) INSTALL OPENQRM 4.7

E1) Download the source of OpenQRM 4.7:

Quote:

#wget http://sourceforge.net/projects/open...7.tgz/download

E2) Uncompress the archive:

Quote:

#tar -zxvf openqrm-4.7.tgz

E3) Move to openqrm source directory

Quote:

#cd openqrm-4.7

E4)

Quote:

#make

It will install all the necessary dependency if run as root. Else you haveto install each dependency manually.

E5) Install

Quote:

#make install

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

6 of 21 02/18/2013 09:53 AM

E6) Run

Quote:

#make start

It will take some time as it installs and configures several stuffs.

E6.1) It will first ask to setup the root password for the mysql server.Set one of your liking, but not a dictionary word.

E6.2) Again it willl ask the nagios admin password. Supply one butdifferent from the mysql root password.

E6.3) It will ask then to set up the workgroup for SAMBA. I just wentwith default 'WORKGROUP'.

E6.4) It will ask for postfix domain for SMTP, please specify the tlddomain you want to use or else go with 'localhost.localdomain'.

E6.5) It will ask the location of root for tftp and just go with default/srv/tftp.

E7) After successful installation, it outputs like:

Quote:

Initialization complete. Please configure your openQRM Server at:http://[server-ip-address]/openqrm/-> User: openqrm -> Password: openqrm

F) CREATE MYSQL DATABASE FOR OPENQRM

F1) You need to create a database for OpenQRM before you log intothe web interface of OpenQRM as reported in E7 above.

F2) So create a mysql database:

Quote:

#mysql -u root -p (ENTER)

Supply the password for the root set up in E6.2 above. And you willland at mysql prompt:

Quote:

mysql> create database openqrm;(ENTER)

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

7 of 21 02/18/2013 09:53 AM

F3) Grant privileges.

Quote:

mysql> grant all on openqrm.* identified by 'username@localhost'identified by 'secret';(ENTER)

Change the username and secret of your liking.

F4) Flush privileges

Quote:

mysql> flush privileges;[ENTER]mysql>exit[ENTER]

G) CONFIGURE OPENQRM4.7 WITH LXC

G1) Now open http://[your-server-ip-address]/openqrm/ in a browser. Apop-up menu asks you to enter the default admin username andpassword (openqrm : openqrm) which you supply as reported in E7above.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

8 of 21 02/18/2013 09:53 AM

G2) You will see OpenQRM configuration manager which will ask youwhich network card to use. Choose 'br0' and press 'next'.

G3) Then it will ask which database type you want. Select 'mysql' andpress 'next'.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

9 of 21 02/18/2013 09:53 AM

G4) Then it will ask to fill in the details of the database for openqrm.Use the same credentials that you created in Step F above.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

10 of 21 02/18/2013 09:53 AM

G5) After a while, you will see the OpenQRM dashboard.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

11 of 21 02/18/2013 09:53 AM

G6) First click on the 'Plugin Manager' You will see a list of plugins.Now activate the plugin one by one as follows in order:

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

12 of 21 02/18/2013 09:53 AM

G6.1) Activate the 'dhcpd' plugin by clicking on the green cross andthen start by pressing on the blue start icon. You can see some hints byhovering over the mouse, too.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

13 of 21 02/18/2013 09:53 AM

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

14 of 21 02/18/2013 09:53 AM

G6.2) Activate and start the 'tftpd' plugin as stated above in G6.1.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

15 of 21 02/18/2013 09:53 AM

G6.3) Activate and start the 'lvm-storage' plugin as stated above inG6.1.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

16 of 21 02/18/2013 09:53 AM

G6.4) Activate and start the 'lxc-storage' plugin as stated above inG6.1.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

17 of 21 02/18/2013 09:53 AM

You can activate and start whatever you need further.

G7) Now click on Components >> Create >> Storage, you will seeyour LVM Storage as resource.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

18 of 21 02/18/2013 09:53 AM

G8) Then create images.

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

19 of 21 02/18/2013 09:53 AM

For further usage of OpenQRM 4.7, I suggest you to visit

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

20 of 21 02/18/2013 09:53 AM

http://openqrm.com and read the documentation which is verycomprehensive and meticulous. Enjoy!

How to install OpenQRM 4.7 with LXC containers in Deb... http://thehumanape.com/tutorial/

21 of 21 02/18/2013 09:53 AM