![]() |
|
|||||||
| Notices |
| Articles Linux Security Articles |
![]() |
|
|
Thread Tools |
|
#1
|
|||
|
|||
|
Taking it further: XEN and OpenVZ on CentOS 5.2 x86_64
By drendeah In a prior tutorial I showed you how to install XEN on CentOS 5.2 to isolate services. This is a good aproach when you have a dedicated server and you want to isolate your services. However, what will you do if you have a dedicated server and you rent Virtual Machines (VMs)? Your customers will face the same problem that you faced initially. They will end up running their services unseparated on the same VM. Not anymore, today I will explain a technique to overcome this limitation. We will further divide the VM into multiple Virtual Environments (VEs) using OpenVZ. OpenVZ is a virtualization technology / software that, unlike XEN, allows for resource sharing. You have the ability to allocate the same amount of cpu/memory to several VEs and they will use it as needed. This kind of virtualization is perfect for isolating services inside of a XEN VM. This way your customers can benefit from service isolation too. I will assume that you have properly installed CentOS with XEN and have successfully created a CentOS 5.2 x86_64 Xen VM. We will be doing the install from the console. Installing OpenVZ To install OpenVZ on a XEN VM you will need to log into the VM. Code:
wget http://download.openvz.org/kernel/branches/rhel5-2.6.18/028stab053.14/ovzkernel-xen-2.6.18-53.1.19.el5.028stab053.14.x86_64.rpm Now that we've downloaded the RPM, let's install it. Code:
rpm -ivh ovzkernel-xen-2.6.18-53.1.19.el5.028stab053.14.x86_64.rpm However, we will need some more supporting RPMs to install before we can actually use OpenVZ. Issue the following commands: Code:
wget http://download.openvz.org/utils/vzctl/current/vzctl-3.0.22-1.x86_64.rpm wget http://download.openvz.org/utils/vzctl/current/vzctl-lib-3.0.22-1.x86_64.rpm wget http://download.openvz.org/utils/vzquota/current/vzquota-3.0.11-1.x86_64.rpm Code:
rpm -ivh vzquota-3.0.11-1.x86_64.rpm vzctl-* We will download a CentOS 4 x86_64 minimal precreated template. Code:
wget http://download.openvz.org/template/precreated/centos-4-x86_64-minimal.tar.gz Code:
mv centos-4-x86_64-minimal.tar.gz /vz/template/cache/ Code:
net.ipv4.ip_forward = 1 net.ipv4.conf.default.proxy_arp = 0 net.ipv4.conf.all.rp_filter = 1 kernel.sysrq = 1 net.ipv4.conf.default.send_redirects = 1 net.ipv4.conf.all.send_redirects = 0 Code:
SELINUX=disabled Code:
reboot Code:
uname -r Code:
2.6.18-53.1.19.el5.028stab053.14xen Creating a OpenVZ Virtual Environment Now let's create our first OpenVZ VE inside the XEN VM. Code:
vzctl create 200 --ostemplate centos-4-x86_64-minimal --ipadd 10.10.10.1 --hostname testve1 Code:
vzlist -a To start the VE issue the following command. Code:
vzctl start 200 Code:
vzctl enter 200 Code:
entered into VE 200 [root@testve1 /]# This article was brought to you by LinuxSecurityForum.org, become a member by clicking here: Register |
| Sponsored Links |
![]() |
| Bookmarks |
| Tags |
| centos, further:, openvz, taking, x86_64 |
| Thread Tools | |
|
|