LinuxHelps.com

A blog for Linux Lovers.

Posted by sibu on September 20, 2009

VPS creation commands.

VPS Creation

# vzctl create VEID –ostemplate osname
# vzctl set VEID –ipadd a.b.c.d –save
# vzctl start VEID

Here VEID is the numeric ID for the VPS;
osname is the name of the OS template for the VE,
and a.b.c.d is the IP address to be assigned to the VE.

Example:

# vzctl create 101 –ostemplate fedora-core-5-minimal
# vzctl set 101 –ipadd 10.1.2.5 –save
# vzctl start 101

VE should be up and running now; you can see its processes

# vzctl exec VEID ps ax

To provide VEID password


# vzctl exec VEID passwd ‘username’

To enter VE give the following command:

# vzctl enter VEID
entered into VPS VEID
[ve]#

Adding ip address to a VPS and creating networking

The command syntax below to add networking to the existing VPS

# vzctl set VEID –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.


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

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:

vzctl set 105 –vmguarpages 65536 –save
vzctl set 105 –privvmpages 262144 –save

Start your VPS with the command

vzctl start vpsid

Example : vzctl start 105

Add A Comment