Comments on Some Tips On OpenVZ Deployment
Some Tips On OpenVZ Deployment I rely heavily on OpenVZ. In this article I would like to share some of my personal experiences in OpenVZ deployment. I assume that the readers already know how to install OpenVZ and the basics of OpenVZ. This article describes some tips on OpenVZ usage via the command line.
5 Comment(s)
Comments
Tony,
Thanks for the interesting article!
Not sure which version of vzctl you use, but since vzctl-3.0.11, released some time in Aug 2006, it supports calling VE by names, e.g.:
vzctl create 202 --ostemplate debian-4.0-i386-minimal --name mydns
vzctl start mydns
vzctl enter mydns
A generic way to obtain a VEID using its name is something like
vzlist -H -oveid $NAME
UBC parameters for the given container can be obtained from /proc/bc/$VEID/resources.
Hope that helps.
Also, regarding VE cloning you use -- you can achieve the same by packing the VE 2002 private area (/vz/private/2002) into a tarball and then using that tarball as a template, something similar to this:
tar czf /vz/template/cache/debian-4.0-amd64-mine.tar.gz -C /vz/private/2002
Next thing is to change the value of DEF_TEMPLATE in /etc/vz/vz.conf so you don't have to specify --ostemplate debian-4.0-amd64-mine each time you want to create a new VE based on your template.
Finally, a default config for new VE can be set using CONFIGFILE parameter in the same /etc/vz/vz.conf file.
Hope that helps.
thank you Kir for the great comments, it's a honour for me to receive them from the openvz developer himself.
When I started with openvz, alias was not supported so I made those shortcuts, which are not needed with newer version.
Just a quick note that the -C needs to be removed from the tar command for it to work.
Newbie question, Doesn't using su - admin-user causes that password to be passed in the clear?
Or is the connection encrypted continuously already given the key in authorized_keys?