1

Installing and Running OpenVZ VEs inside a Xen domU

One of my more favourite virtualisation topics. OpenVZ in combination with Xen.

Since it is possible to split a Xen DomU into further OpenVZ containers I will get straight down to the nitty gritty of how to do so!

Stay with me…

First of all, Install wget and nano if not already installed:

yum -y install nano wget

Insert the following using: nano /etc/modprobe.conf

alias eth0 xennet
alias scsi_hostadapter xenblk

Insert the following to disable selinux: nano /etc/sysconfig/selinux

SELINUX=disabled

The following values should be set. On our systems, the top two were edited and the bottom rest inserted: nano /etc/sysctl.conf

net.ipv4.ip_forward = 1
kernel.sysrq = 1

net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Now install some required packages:

yum -y install mkinitrd ed rsync

Download kernel:

wget http://download.openvz.org/kernel/branches/rhel5-2.6.18/028stab060.8/ovzkernel-xen-2.6.18-92.1.18.el5.028stab060.8.x86_64.rpm

Download the following utils:

wget http://download.openvz.org/utils/vzctl/current/vzctl-3.0.23-1.x86_64.rpm
wget http://download.openvz.org/utils/vzctl/current/vzctl-lib-3.0.23-1.x86_64.rpm
wget http://download.openvz.org/utils/vzquota/current/vzquota-3.0.12-1.x86_64.rpm

Install the above:

rpm -ivh ovzkernel-xen-2.6.18-92.1.18.el5.028stab060.8.x86_64.rpm
rpm -ivh vzquota-* vzctl-*

Download an OS template:

wget http://www.modernadmin.com/downloads/ostemplates/openvz/centos-5.3-x86_64-modernadmin.tar.gz -O /vz/template/cache/centos-5.3-x86_64-modernadmin.tar.gz

You may also need to copy the following from /boot to your Xen dom0:

/boot/initrd-2.6.18-92.1.18.el5.028stab060.8xen.img
/boot/vmlinuz-2.6.18-92.1.18.el5.028stab060.8xen

Reboot! You should now be able to create an OpenVZ VE!

vzctl create 777 --ostemplate centos-5.3-x86_64-modernadmin --ipadd 78.129.140.250 --hostname template.modernadmin.com

This entry was posted in HyperVM, OpenVZ, Virtualisation, Xen and tagged , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Trackback

  1. [...] on from the previous tutorial, Installing and Running OpenVZ VEs inside a Xen domU, lets demonstrate how to install HyperVM on this Xen [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>