Stage 1 : Server Setup
------------------------------
1 . Add the openVZ repository to yum.
1. cd /etc/yum.repos.d
2. http://download.openvz.org/openvz.repo
3. rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
2. Search Available kernels
yum search vzkernel
3 Install kernel
yum install vzkernel
* it will install necessary packages for Openvz virtualization includes vzctl ,vzquota etc
rmp -qa | grep vzk*
* verification command
4.Configure bootloader
1 . /etc/grub.conf
2 . edit title of vzkernel as OpenvZ
5. Set Kernel parameters and disable SElinux
vi /etc/sysctl.conf
and set below parameter
Quote
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0 Quote
# 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
vi /etc/sysconfig/selinux
Once done with the above set the SELinux
SELINUX=disabled
6. Now rebooting to OpenVZ kernel
7.Check whether Eth0 detected or not, if no refer below link for the fix.
http://in.myloth.com/forum/index.php?topic=17.08. Start OpenVz
/sbin/service vz start
Stage 2 : Templates--------------------------
1. Download OS templates to /vz/template/cache/
Check
http://wiki.openvz.org/Download/template/precreatedStage 3 : Setup VMs---------------------------
1. Create virtual machines ( CID --> Container ID )
vzctl create CID --ostemplate template --config-basic
vzctl set CID --onboot yes --save
---> To start Vms on boot
2. Configure VM
a. add ip
vzctl set CID --ipadd ip --save
b. No of sockets
vzctl set CID --numothersock 150 --save
c. Set name server for N/w access
vzctl set CID --nameserver IP --save
d. Start VM
vzctl start CID
---------------------
--------------------------------------