Linux > Virtualization

How to Provision a OpenVZ Server

(1/1)

nidhinjo:
 Stage 1 :  Server Setup
------------------------------

1 . Add the openVZ repository to  yum.
 

--- Code: ---     1. cd /etc/yum.repos.d
     2. http://download.openvz.org/openvz.repo
     3. rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ
--- End code ---

2. Search  Available kernels


--- Code: ---yum  search vzkernel
--- End code ---

3 Install  kernel 


--- Code: ---yum  install  vzkernel
--- End code ---

         * it will  install  necessary packages for Openvz virtualization includes  vzctl ,vzquota etc
         

--- Code: ---rmp -qa | grep  vzk*
--- End code ---

     * verification command

4.Configure bootloader


--- Code: ---     1 . /etc/grub.conf
     2 . edit   title  of   vzkernel  as OpenvZ 
--- End code ---

5. Set Kernel  parameters and disable  SElinux


--- Code: ---vi  /etc/sysctl.conf
--- End code ---

  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

         

--- Code: ---vi  /etc/sysconfig/selinux

--- End code ---

 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.0

8. Start OpenVz


--- Code: ---/sbin/service vz start
--- End code ---

Stage 2 : Templates
--------------------------

1. Download OS templates to  /vz/template/cache/

     Check http://wiki.openvz.org/Download/template/precreated

Stage 3 :  Setup VMs
---------------------------
 
 1. Create virtual  machines   ( CID --> Container ID )
       

--- Code: ---vzctl create  CID  --ostemplate   template  --config-basic   
          vzctl set  CID  --onboot yes --save
--- End code ---

  ---> To  start Vms on boot

 2. Configure VM
        a. add ip       


--- Code: --- vzctl set  CID --ipadd ip --save
--- End code ---

         b. No of sockets
           


--- Code: --- vzctl set CID  --numothersock  150 --save
--- End code ---

         c. Set name server for  N/w access
             

--- Code: ---vzctl set CID  --nameserver  IP --save
--- End code ---

         d. Start  VM
             

--- Code: ---vzctl start  CID
--- End code ---

--------------------- :) --------------------------------------

Navigation

[0] Message Index

Go to full version