Quantcast
Channel: LowEndTalk
Viewing all articles
Browse latest Browse all 41885

vzctl - Create OpenVZ Container

$
0
0

Hi,

I've been using this to create my openvz containers and i was wondering if i'm doing something wrong/should i set some other options?

cid=101
ostemplate=ostemplatehere-4
diskspace=2G
ip_address=10.11.1.7 # i use nat/port forward
dedicated_ram=1024M
swap_ram=512M
vps_hostname=s3.ejl.im

vzctl create ${cid} --ostemplate ${ostemplate} --config basic
vzctl set ${cid} --diskspace ${diskspace} --save
vzctl set ${cid} --hostname ${vps_hostname} --save
vzctl set ${cid} --ipadd ${ip_address} --save
vzctl set ${cid} --nameserver 8.8.8.8 --nameserver 8.8.4.4 --save
vzctl set ${cid} --onboot yes --save

vzctl set ${cid} --vmguarpages ${dedicated_ram} --save
vzctl set ${cid} --oomguarpages ${dedicated_ram} --save
vzctl set ${cid} --privvmpages ${dedicated_ram} --save
vzctl set ${cid} --swap ${swap_ram} --save
vzctl set ${cid} --kmemsize $((109977602)):$((109977602)) --save

vzctl set ${cid} --devnodes net/tun:rw --save
vzctl set ${cid} --devices c:10:200:rw --save

vzctl start ${cid}

vzctl exec ${cid} mkdir -p /dev/net
vzctl exec ${cid} chmod 600 /dev/net/tun

I use some of these containers with java, so if anyone could suggest some tuning options i should use, please tell me.


Viewing all articles
Browse latest Browse all 41885

Trending Articles