Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


vzctl - Create OpenVZ Container
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

vzctl - Create OpenVZ Container

pylodepylode Member
edited December 2012 in General

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.

Comments

Sign In or Register to comment.