|
|
|
|
Re: How to create a full template for centos [message #21230 is a reply to message #21115] |
Wed, 03 October 2007 15:37 |
|
dowdle
Messages: 261 Registered: December 2005 Location: Bozeman, Montana
|
Senior Member |
|
|
With the CentOS metadata package, you can create your own OS Template. You don't have to go with the stock stuff that it installs when you create it, just edit the following file and add the packages you want in the OS Template you create:
/vz/template/centos/{version}/{arch}/config/default.list
To change what goes in the minimal, you can edit:
/vz/template/centos/{version}/{arch}/config/minimal.list
Once you have the packages you want (and it'll figure out all of the dependencies), just use the vzpkgcache command to build your template.
That's how you build an OS Template with what you want in it.
Another way, it to create a VPS from the stock template or a pre-created template... and install and configure it just the way you like it... and then stop the VPS... and then tar.gz up the private dir (such that it doesn't contain any file references above it's own root)... and then copy that .tar.gz file to your /vz/template/cache directory... and bingo... you have a new OS template.
If you have local/LAN copies of the CentOS repos and want to make your OS template builds faster and use less bandwidth, you can edit the following file:
/vz/template/centos/{version}/{arch}/config/yum.conf
Just comment out the stock mirror or baseurl lines and put in your own. You can also add additional repos.
The most recent release by Steve (a community member) of the CentOS-5 metadata package will save your VPS from accidentally installing udev (and removing vzdev) which usually renders the VPS unusable... so make sure you find the latest metadata package he posted here in the forum. I don't have the URL handy but you can search for it. I don't think his package has been added to the OpenVZ project download section.
Any other questions?
--
TYL, Scott Dowdle
Belgrade, Montana, USA
|
|
|
|
Re: How to create a full template for centos [message #22561 is a reply to message #22554] |
Tue, 30 October 2007 21:44 |
|
dowdle
Messages: 261 Registered: December 2005 Location: Bozeman, Montana
|
Senior Member |
|
|
I have no idea what you need to install to have a working asterisk system because I've not installed that.
In this case, I don't think you need to edit the default.list because there may be so much work you have to do after that (any third-party packages or configs?) that you don't want to have to go through that each and every time you create a new VPS of the same type.
I'd recommend you start with a basic VPS OS Template, get a running VPS, add everything you need to the running VPS. Install any third-party stuff and configure as desired.
After you have gotten asterisk setup how you want it on the running VPS, if desired, remove any of the packages you don't need/want. Do you still need the compiler and all of the devel packages after you have your application going? Anyway, getting rid of the build stuff if you don't need it anymore will make your final OS Template smaller.
Then just shut down your VPS and pack it up like so:
vzctl stop {VEID}
cd /vz/private/{VEID}
tar -cvzf /vz/template/cache/{mynewtemplate}-i386.tar.gz
Now you can use your new OS Template to create new VPSes with all of that work intact but your hostname, ip address, nameserver stuff is stored in the {VEID}.conf so your OS Template created from the shutdown VPS is fairly independent. Just make sure to change or remove any passwords you don't want shared.
Does that sound like a plan?
--
TYL, Scott Dowdle
Belgrade, Montana, USA
|
|
|
|
|
|
|