Installing and Running OpenVZ VEs inside a Xen domU
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

Posted in HyperVM, OpenVZ, Virtualisation, Xen | Tagged , , , | 1 Comment
A warm welcome
0

A warm welcome

Hello all and welcome to ModernAdmin.com – home of Sean McRobbie’s various admin notes!

The purpose of this blog is to serve as notes for myself and others on how to do various odd administration tasks.

Most of these notes will be on the topics of Linux, Xen, OpenVZ and everything Virtualisation.

Hope you all find the site useful.

Posted in Uncategorized | Leave a comment