OpenVZ Forum


Home » General » Support » Existing Templates
Re: Existing Templates [message #730 is a reply to message #646] Sun, 08 January 2006 05:39 Go to previous messageGo to previous message
phpfreak is currently offline  phpfreak
Messages: 47
Registered: January 2006
Member
Here's how I found out how to create some easily customized templates.

1.) create a temporary ve and start it up:
vzctl create 1000 --ostemplate centos-4-i386-default
vzctl start 1000
vzctl enter 1000
(now type: su -)

2.) Now that you have your VE created, go ahead and make all of your customizations. Install whatever you want, custom compile anything, tweak out the various things you like, install custom firewall scripts etc. Then exit out.

exit
exit

3.) Shut down the VE
vzctl stop 1000

4.) Now, cd into the vz private directory on the host:

cd /vz/private/1000

5.) Next, tarball the root of the VE:

tar czpf /vz/template/cache/centos-4-i386-mycoolvz.tar.gz *

Now your template is ready to go. You can create a new copy of this VE anytime you want. Don't worry about the hostname, IP's or root passwords because you can reset those when you create a copy of your VE later on.

Here's a tip for you though, something I think works. If you don't name the template tarball such as 'centos-4-i386-xxx' and just name it 'myvz.tar.gz' when you create the VE you'll get a message that it could not find the distro type or something to that effect. That means that it won't use the template inside the centos directory to run the install-pre and install-post items and it wont obey the package lists in the spec files. In other words, it's an easy way to avoid having anything reinstalled on your VE that you uninstalled in your custom setup, when you go to recreate it.

Hope that info helps. I may be smoking crack, but it works well for me Smile



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Host: CentOS4, Guest: Debian, apt-get not working, strange problems
Next Topic: 061.1 Kernel RPM Error
Goto Forum:
  


Current Time: Sun Jul 21 18:12:01 GMT 2024

Total time taken to generate the page: 0.02336 seconds