OpenVZ Forum


Home » General » Support » How to create our own templates?
How to create our own templates? [message #43] Thu, 08 September 2005 15:15 Go to next message
acerbaturix is currently offline  acerbaturix
Messages: 1
Registered: September 2005
Junior Member
Hello,

I was looking for information about how to create my own OS Template, and I don't found anything.

It is possible or we are limited to only the "official" OS Templates?

Thanks for your time.
Re: How to create our own templates? [message #44 is a reply to message #43] Thu, 08 September 2005 15:42 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

There is still no documentation on how to create OS templates, and it's me whom to blame Rolling Eyes I will write one soon, sure!

Still, it's not very complicated task, and I will describe it here in very short form. First you need to read OS template cache preparation to learn the terms used below, and some background info about templates. Any questions - please ask.

In order to have a OS template, you need to create its metadata first. Metadata is basically a list of packages to be installed, a list of (yum) repositories that have those packages, a few scripts to be executed on various stages of template cache creation. Also you need to have a few packages of your own, to provide things which are not needed inside a VPS (e.g. kernel).

Currently, the only distributions supported by packaging tools (vzpkg) are RPM-based distros, e.g. Red Hat, Fedora, CentOS, and probably SuSE and Mandriva (nobody tried last two distros yet). Actually, OpenVZ supports any distros, e.g. Debian, Gentoo etc., it is not RPM-specific, but tools currently exists only for RPM.

I will continue tomorrow or this night. Please let me know if this is what you need (e.g. if you want to create Debian template I can't currently help you).


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png

[Updated on: Wed, 14 September 2005 11:45]

Report message to a moderator

Re: How to create our own templates? [message #69 is a reply to message #44] Mon, 12 September 2005 08:00 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Kir, please, create a bug in bugzilla to add a separate document in "Documentation" tab.


http://static.openvz.org/userbars/openvz-developer.png
Re: How to create our own templates? [message #72 is a reply to message #69] Mon, 12 September 2005 09:17 Go to previous messageGo to next message
dim is currently offline  dim
Messages: 344
Registered: August 2005
Senior Member
This bug is already there, no need to add new one - http://bugzilla.openvirtuozzo.org/show_bug.cgi?id=7

http://static.openvz.org/openvz_userbar_en.gif
Re: How to create our own templates? [message #74 is a reply to message #69] Mon, 12 September 2005 10:26 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

IMHO this should be described in user's guide. well, separate article won't hurt.

The problem is I'm currently changing template tools, some of the changes will be incompatible (addition of "architecture" to templates, using different versions of privately-provided RPM binaries and libs) and will require changes in docs. Thus I want to incorporate all these changes and deliver newer template tools and templates, then document all that.

PS barmaley@ was able to create FC1 distro without any docs in half a day. same for dim@, only the distro was centos4.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: How to create our own templates? [message #3386 is a reply to message #43] Thu, 25 May 2006 16:06 Go to previous messageGo to next message
medved is currently offline  medved
Messages: 1
Registered: May 2006
Junior Member
Can You give me information how to create Red Hat based templates
(RH 7.2, RH 9, RHEL3).
Re: How to create our own templates? [message #3388 is a reply to message #3386] Thu, 25 May 2006 17:19 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Basically, our template tools are using yum with --installroot argument and separate configuration file with yum repos specified for the given distro.

You can just copy over the whole physical server with RH7.3 installed, tar it, put into /vz/template/cache directory and use.

Additional tricks are:

1. removing getty lines from /etc/inittab

2. adding - (minus, dash) signs before file names in /etc/sysctl.conf (for better I/O performance).

3. linking /etc/mtab to /proc/mounts for df etc. to work:
rm /etc/mtab
ln -s /proc/mounts /etc/mtab


4. Setting
PROMPT=no

in /etc/sysconfig/init (on distros which have that).

5. removing some cron jobs from /etc/cron.daily

And so on. Strictly speaking they are not required for you newly created template to work -- but highly recommended.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: How to create our own templates? [message #3391 is a reply to message #3388] Fri, 26 May 2006 03:13 Go to previous messageGo to next message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
kir wrote on Thu, 25 May 2006 13:19


You can just copy over the whole physical server with RH7.3 installed, tar it, put into /vz/template/cache directory and use.




I thought a 7.3 install would not work because it uses a different kernal. I thought all ve's need to run the same base kernal?


Re: How to create our own templates? [message #3394 is a reply to message #3391] Fri, 26 May 2006 06:24 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

VEs do not run a kernel -- they use the host system's kernel. So it does not matter what kernel you have in a VE and if you have it at all.

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: How to create our own templates? [message #3397 is a reply to message #3391] Fri, 26 May 2006 06:42 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

2.6 kernel is pretty good backward compatible with 2.4. You can safely run Redhat7.3 on OpenVZ, the only thing you should care about is NX bit support. If your processor supports NX bit, then you will need to add 'noexec=off' to kernel commandline (and reboot). You can simply add this parameter by default if don't know whether CPU supports it or not (cat /proc/cpuinfo, line "flags: ... nx... ").


http://static.openvz.org/userbars/openvz-developer.png
Re: How to create our own templates? [message #3416 is a reply to message #3397] Fri, 26 May 2006 14:54 Go to previous message
vmvmvm is currently offline  vmvmvm
Messages: 51
Registered: January 2006
Member
dev wrote on Fri, 26 May 2006 02:42

You can safely run Redhat7.3 on OpenVZ



Awesome! Does anyone have a 7.3 template? Would make my life so much better. Right now I have to run 7.3 in Microsoft's crappy "Virtual PC" product when I need access to a 7.3 machine.

If anyone has a 7.3 template I would love to have a copy of it (I'm afraid I still don't quite understand the process of building my own template - though I'm going to try again tonight!)

Previous Topic: Using OpenVZ Templates in Virtouzzo?
Next Topic: *SOLVED* need help installing Oracle 10g -- heap error
Goto Forum:
  


Current Time: Fri Dec 27 00:46:49 GMT 2024

Total time taken to generate the page: 0.03409 seconds