OpenVZ Intallation Part 2

Oke yesterday we have installed OpenVZ Kernel.

then now we will do for create the vm/conatiner in OpenVZ.
*vm/container = OS Guest


Oke lets go :

[#] Download OpenVZ Template

~ wget http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz
Then we now use command to create vm/container.and then setup of VPS.

~ vzctl create 101 --ostemplate centos-6-x86_64 --configbasic
The 101 must be a uniqe ID - each virtual machine must have its own unique ID. You can use the last part of the virtual machine's IP address for it. For example, if the virtual machine's IP address is 192.168.0.101, you use 101 as the ID.

and if you want the vm is started at boot, use this :

~ vzctl set 101 --onboot yes --save

Oke the next is we can setup the Hostname and IP :

~ vzctl set 101 --hostname test.localhost.com --save
~ vzctl set 101 --ipadd 192.168.1.10 --save

*192.168.0.101 = Static IP

Now Set Number of Sockets to 120 and assign the namserver :

~ vzctl set 101 --numothersock 120 --save
~ vzctl set 101 --nameserver 8.8.8.8 --nameserver 8.8.4.4 --nameserver 145.253.2.75 --save

*8.8.8.8 - 8.8.4.4 is google nameserver

Then setup the connection of for container :

~ iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE
*this rules is that the conection from eth0 spread to all OS.

Oke after this step the configuration is finished.
if you will see the configuration :

~ cat /etc/vz/conf/101.conf
Then Now Is command to starting Our vm/container

and start the VM/Container

~ vzctl start 101
and set the root password

~ vzctl exec 101 passwd
and you can connect from your putty ;)

Then will Give some Command :

~ vzctl enter 101 => for Login to Our VM/container
~ exit => exit from VM/container
~ vzctl stop => stop the 101 VM/container
~ vzctl restart 101 => restart the VM/Container
~ vzctl destroy 101 => Delete the VM/container
~ vzlist -a => for seem the all VM/container ,IP and configuration.


oke good bye and keep learning :)
Title : OpenVZ Intallation Part 2
Description : Oke yesterday we have installed OpenVZ Kernel. then now we will do for create the vm/conatiner in OpenVZ. *vm/container = OS Guest Oke l...

0 Response to "OpenVZ Intallation Part 2"

Post a Comment