OpenVZ Forum


Home » General » Support » Can I create a template from an updated VPS?
Can I create a template from an updated VPS? [message #2149] Wed, 22 March 2006 16:00 Go to next message
jdonalds is currently offline  jdonalds
Messages: 9
Registered: March 2006
Location: Michigan, US
Junior Member
If I build a VPS and then add packages to it, can I then tarball the /vz/private/xxx directory as a template?

Re: Can I create a template from an updated VPS? [message #2150 is a reply to message #2149] Wed, 22 March 2006 16:22 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Yes Smile

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: Can I create a template from an updated VPS? [message #2154 is a reply to message #2149] Thu, 23 March 2006 01:41 Go to previous messageGo to next message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
You can also update your template package list and then do a vzpkgcache -f template-name... which will dump your old .tar.gz cache template a build a new one from scratch using the updated package list.

For example, speaking about CentOS 4, I wanted to add mc, system-config-date, links, and yum to the default packages so I edited:

/vz/template/centos/4/i386/config/default.list

I added the desired packages to the bottom of the list. Then I ran:

vzpkgcache -f centos-4

It built a new /vz/template/cache/centos-4-i386-default.tar.gz template cache.

Since I hadn't previously removed the packages downloaded during previous vzpkgcache runs (stuff under /vz/template/centos/4), it only had to download the additional packages along with any required dependencies... from which it created a new template .tar.gz file.

Now when I create a new VPS, it includes the additional packages.

Of course, if you were talking about other things besides just packages (altered configs, log files, stuff under /home or in /etc/skel etc), then your way would be the way to go.

Just curious... what kinda stuff were you talking about?


--
TYL, Scott Dowdle
Belgrade, Montana, USA
Re: Can I create a template from an updated VPS? [message #2159 is a reply to message #2154] Thu, 23 March 2006 06:47 Go to previous message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Quote:

Of course, if you were talking about other things besides just packages (altered configs, log files, stuff under /home or in /etc/skel etc), then your way would be the way to go.


In that case, you can also stick to vzpkgcache, having three options:

1. Create and add your own RPMS to /vz/template/OSNAME/OSVERSION/ARCH/vz-addons/ directory (and run createrepo in it afterwards), then add those packages to some *.list file

2. Create your own yum repository and add it to /vz/template/OSNAME/OSVERSION/ARCH/config/yum.conf, then add those packages to some *.list file

2. Edit /vz/template/OSNAME/OSVERSION/ARCH/config/install-post (or install-pre, or update-post), adding some tweaks here. This is the way to go if you need to alter something left after installing RPMS, and you do not want to rebuild those RPMS.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Previous Topic: OpenVZ & Shorewall
Next Topic: Problems compiling kernel 2.6.16
Goto Forum:
  


Current Time: Sun Nov 17 11:14:37 GMT 2024

Total time taken to generate the page: 0.02956 seconds