ABHIONLINUX
Site useful for linux administration and web hosting

Showing posts with label VPS creation. Show all posts
Showing posts with label VPS creation. Show all posts

2009/07/30

VPS creation with OpenVZ

1. vzctl create vpsid –ostemplate ostemplatename
Eg: vzctl create 105 –ostemplate centos-4-i386-default
/var/lib/vz/root/vpsid

2. Adding ip address to a VPS and creating networking
vzctl set vpsid –ipadd ipaddr –nameserver nameserverIP –hostname hostname –save

3. Assign fixed amount of RAM for the created VPS?
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

4. vzctl start vpsid
vzctl destroy vpsid -- to destroy vps

Example:
vzctl create 106 --ostemplate ubuntu-9.04-i386-minimal
vzctl set 106 --onboot yes --save
vzctl set 106 --hostname singularityweb --save
vzctl set 106 --numiptent 128 --save
vzctl set 106 --diskspace 10485760:12582912 --save
vzctl set 106 --vmguarpages 33792:2147483647 --save
vzctl set 106 --oomguarpages 26112:2147483647 --save
vzctl set 106 --privvmpages 65536:69632 --save
vzctl set 106 --ipadd 64.191.79.134 --save