Re: Existing Templates [message #730 is a reply to message #646] |
Sun, 08 January 2006 05:39 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to previous message](/theme/ovz3/images/down.png) |
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](images/smiley_icons/icon_smile.gif)
Eric Rosebrock
http://www.serverpowered.com
http://www.hybodus.com
http://www.linuxforum.com
http://www.phpfreaks.com
|
|
|