online prescription solutions
online discount medstore
pills online
buy lorazepam without prescription
xanax for sale
buy xanax without prescription
buy ambien without prescription
ambien for sale
buy modafinil without prescription
buy phentermine without prescription
modafinil for sale
phentermine for sale
lorazepam for sale
buy lexotan without prescription
bromazepam for sale
xenical for sale
buy stilnox without prescription
valium for sale
buy prosom without prescription
buy mefenorex without prescription
buy sildenafil citrate without prescription
buy adipex-p without prescription
librium for sale
buy restoril without prescription
buy halazepam without prescription
cephalexin for sale
buy zoloft without prescription
buy renova without prescription
renova for sale
terbinafine for sale
dalmane for sale
buy lormetazepam without prescription
nobrium for sale
buy klonopin without prescription
priligy dapoxetine for sale
buy prednisone without prescription
buy aleram without prescription
buy flomax without prescription
imovane for sale
adipex-p for sale
buy niravam without prescription
seroquel for sale
carisoprodol for sale
buy deltasone without prescription
buy diazepam without prescription
zopiclone for sale
buy imitrex without prescription
testosterone anadoil for sale
buy provigil without prescription
sonata for sale
nimetazepam for sale
buy temazepam without prescription
buy xenical without prescription
buy famvir without prescription
buy seroquel without prescription
rivotril for sale
acyclovir for sale
loprazolam for sale
buy nimetazepam without prescription
buy prozac without prescription
mogadon for sale
viagra for sale
buy valium without prescription
lamisil for sale
camazepam for sale
zithromax for sale
buy clobazam without prescription
buy diflucan without prescription
modalert for sale
diflucan for sale
buy alertec without prescription
buy zyban without prescription
buy serax without prescription
buy medazepam without prescription
buy imovane without prescription
mefenorex for sale
lormetazepam for sale
prednisone for sale
ativan for sale
buy alprazolam without prescription
buy camazepam without prescription
buy nobrium without prescription
mazindol for sale
buy mazindol without prescription
buy mogadon without prescription
buy terbinafine without prescription
diazepam for sale
buy topamax without prescription
cialis for sale
buy tafil-xanor without prescription
buy librium without prescription
buy zithromax without prescription
retin-a for sale
buy lunesta without prescription
serax for sale
restoril for sale
stilnox for sale
lamotrigine for sale

[CentOS] OpenVZ – container based virtualization quick guide. Part 1 of 2


This quick guide will walk you through setting up OpenVZ on CentOS. I followed these steps on CentOS release 5.5 x64 version. If you want more detail on install via different methods and/or have different flavor of CentOS and run into an issue, you can follow instructions provided by OpenVZ site. Once you are done with this guide, you will have CentOS container running for you to play with.

For my purposes, I started with very basic installation of CentOS 5.5. I have done this on existing installations of CentOS without any issues as well. Ok so let’s start with getting the OpenVZ repository added to our system. This means that we will be going down “yum” path instead of “rpm” path. This is the quickest and easiest way to get OpenVZ installed.

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

Before we move on, let’s turn off selinux:

vi /etc/selinux/config
:0,$s/=enforcing/=disabled/g
:wq

Go ahead and reboot the box and check:

[root@tooncent ~]# getenforce
Disabled

Now since we have the OpenVZ repository added and selinux disabled, we can go ahead and move on with installation part:
yum install vzkernel.x86_64 #install kernel with openvz support

echo '
# ----------added for OpenVZ installation----------------
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq key
kernel.sysrq = 1
# We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
' >> /etc/sysctl.conf

Note: by executing above snippet, you will end up creating duplicate entries. It’s always a good idea to clean up duplicates to avoid confusion/mistakes later.

Following step is optional and mostly for clarity. Edit your grub.conf and change CentOS to say OpenVZ:

vi /etc/grub.conf

Change the first “title CentOS” to “title OpenVZ” (without the quotes). For example:

title CentOS (2.6.18-194.17.1.el5.028stab070.7)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.17.1.el5.028stab070.7 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-194.17.1.el5.028stab070.7.img

becomes:

title OpenVZ (2.6.18-194.17.1.el5.028stab070.7)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.17.1.el5.028stab070.7 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-194.17.1.el5.028stab070.7.img

Ok at this point we are ready to reboot and use the new kernel. Issue a “reboot”. Let’s install the utilities to manage OpenVZ:
yum install vzctl.x86_64 vzquota.x86_64

We need to start up vz manually once.

/etc/init.d/vz start

Alright! we got OpenVZ running. Now, let’s get a precreated template from OpenVZ site.

cd /vz/template/cache/
wget http://download.openvz.org/template/precreated/centos-5-x86_64.tar.gz

Ok now comes the fun part; let’s get our first container up and running:
Note: ostemplate name is the file you downloaded minus .tar.gz. centos-5-x86_64.tar.gz

[root@tooncent cache]# vzctl create 101 --ostemplate centos-5-x86_64
Creating container private area (centos-5-x86_64)
Performing postcreate actions
Container private area was created
[root@tooncent cache]#

Container files are created under /vz/private/101 < – 101 is the id you give it. You can put any numeric number above 100. Documentation says not to use anything below 101 since its a reserved range.

Let’s set a hostname so there is no confusion:

vzctl set 101 --hostname toontest.tooncent.com --save
Set hostname: toontest.tooncent.com
Saved parameters for CT 101

To start your new container:

[root@tooncent ~]# vzctl start 101
Starting container ...
Container is mounted
Setting CPU units: 1000
Set hostname: toontest.tooncent.com
Container start in progress...
[root@tooncent ~]#

To access your container:

vzctl enter 101

To exit the container, type: exit

To stop the container:

# vzctl stop 101
Stopping container ...
Container was stopped
Container is unmounted

Congratulations! You have successfully setup a container.


One Response to “ [CentOS] OpenVZ – container based virtualization quick guide. Part 1 of 2 ”

  1. March 29th, 2011 | 12:33 pm

    [...] and setup a internet facing container/vm. This part of the guide also assumes you have followed part 1 to setup the container already and have a working [...]

Leave a reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image