May
15
Posted on 15-05-2008
Filed Under (vps hosting) by bodhost

It is assumed that you have OpenVZ installed on your server.

How to get OpenVZ templates?

OpenVZ uses a OS(Operating System) template system, ie every single VPS created with OpenVZ can have its own Operating System template like Fedora Core, Debian,CentOS.
You can download OpenVZ Operating System templates from OpenVZ template website. Note that each OS templates has its own hardware version . Make sure that you are choosing the right OS template for your server hardware.

The templates has to be saved in /var/lib/vz/template/cache in compressed format (gzip, tar). You need not decompress them.

How to create a VPS with OpenVZ?

The syntax to create a VPS in OpenVZ is
vzctl create vpsid –ostemplate ostemplatename

Replace vpsid with a number (above 100) and
Replace ostemplatename with the name of the preferred OS template you want for that VPS.

for example
Quote:
vzctl create 105 –ostemplate centos-4-i386-default
This would create a VPS with VPS_ID 105, with centos-4-i386-default OS template

After the VPS is created, you will find its
File System at /var/lib/vz/root/vpsid (example /var/lib/vz/root/105), and
Private Area at /var/lib/vz/private/vpsid (example /var/lib/vz/private/105)

Adding ip address to a VPS and creating networking

The command syntax below to add networking to the existing VPS

Quote:
vzctl set –ipadd ipaddr –nameserver nameserverIP –hostname hostname –save
The –ipadd parameter assigns the IP address to the first venet interface in the guest OS, the –hostname assigns the VPS its hostname, and the –nameserver parameter provides the first nameserver.

Hpw to Assign fixed amount of RAM for the created VPS?

Here is an example of setting the VPS with a guaranteed 256 MB RAM and a maximum of 1GB RAM.
Quote:
vzctl set vpsid –vmguarpages 65536 –save
vzctl set vpsid –privvmpages 262144 –save
vmguarpages ->The memory that is ‘guaranteed’ to the VPS
privvmpages -> The ‘maximum’ amount of memory that will be granted to the VPS

Replace vpsid with with the VPS_ID. Example:
Quote:
vzctl set 105 –vmguarpages 65536 –save
vzctl set 105 –privvmpages 262144 –save
Start your VPS with the command
Quote:
vzctl start vpsid
As an example
Quote:
vzctl start 105

Comments Off    Read More   

Comments are closed.