Difference between revisions of "OpenSUSE template creation"

From OpenVZ Virtuozzo Containers Wiki
Jump to: navigation, search
m (More formatting fixes)
(Added instructions about /dev/console)
Line 9: Line 9:
 
=== Preparing the base system ===
 
=== Preparing the base system ===
  
Run <code>yast2</code> on your openSUSE 10.3 installation (this does not have to be your OpenVZ HN). Proceed with <code>Software->Installation into directory</code> option.  
+
Run <code>yast2</code> on your openSUSE 10.3 installation (this does not have to be your OpenVZ HN, you can prepare cache on one box and put it on your OpenVZ HN). Proceed with <code>Software->Installation into directory</code> option. It is assumed that this directory is current directory in following instructions (unless otherwise stated).
  
 
=== Create device nodes ===
 
=== Create device nodes ===
  
I suggest creating all required nodes directly in the <code><DIRINSTALL>/lib/udev/devices/</code>, in that case you don't have to disable udev in startup scripts.
+
I suggest creating all required nodes directly in the <code>lib/udev/devices/</code>, in that case you don't have to disable udev in startup scripts.
  
Change directory to <code><DIRINSTALL>/lib/udev/devices/</code> and execute the following commonds:
+
Execute the following commands to create device files:
 +
 
 +
<pre>
 +
mknod -m 666 lib/udev/devices/full c 1 7
 +
mknod -m 600 lib/udev/devices/initctl p
 +
mknod -m 666 lib/udev/devices/random c 1 8
 +
mknod -m 444 lib/udev/devices/urandom c 1 9
 +
</pre>
 +
 
 +
Replace console device with regular file (otherwise <code>vzctl stop</code> fails with timeout -- needs more investigation):
 
<pre>
 
<pre>
mknod -m 666 full c 1 7
+
rm lib/udev/devices/console ; touch lib/udev/devices/console
mknod -m 600 initctl p
 
mknod -m 666 random c 1 8
 
mknod -m 444 urandom c 1 9
 
 
</pre>
 
</pre>
  
Line 29: Line 35:
 
== Disable boot.klog ==
 
== Disable boot.klog ==
  
For some reason, <code>klogd</code> hangs when tries to retrieve kernel log. You need to disable it. Simply delete <code><DIRINSTALL>/etc/rc.d/boot.d/S08boot.klog</code>
+
For some reason, <code>klogd</code> hangs when tries to retrieve kernel log. You need to disable it. Simply delete <code>etc/rc.d/boot.d/S08boot.klog</code>
  
 
== Create OS template ==
 
== Create OS template ==
  
  
Create OS template cache by invoking the following command (from inside <code><DIRINSTALL></code>):
+
Create OS template cache by invoking the following command:
 
<code>
 
<code>
 
tar -czf /vz/template/cache/opensuse-10.3-i386-default.tar.gz ./
 
tar -czf /vz/template/cache/opensuse-10.3-i386-default.tar.gz ./

Revision as of 09:48, 12 January 2008

Instructions manually create a minimal openSUSE 10.3 template.

Prerequisites

You need running openSUSE 10.3 installation.

Creating template

Preparing the base system

Run yast2 on your openSUSE 10.3 installation (this does not have to be your OpenVZ HN, you can prepare cache on one box and put it on your OpenVZ HN). Proceed with Software->Installation into directory option. It is assumed that this directory is current directory in following instructions (unless otherwise stated).

Create device nodes

I suggest creating all required nodes directly in the lib/udev/devices/, in that case you don't have to disable udev in startup scripts.

Execute the following commands to create device files:

mknod -m 666 lib/udev/devices/full c 1 7
mknod -m 600 lib/udev/devices/initctl p
mknod -m 666 lib/udev/devices/random c 1 8
mknod -m 444 lib/udev/devices/urandom c 1 9

Replace console device with regular file (otherwise vzctl stop fails with timeout -- needs more investigation):

rm lib/udev/devices/console ; touch lib/udev/devices/console

Disable parallel startup of services

Set RUN_PARALLEL variable in <DIRINSTALL>/etc/sysconfig/boot to "no".

Disable boot.klog

For some reason, klogd hangs when tries to retrieve kernel log. You need to disable it. Simply delete etc/rc.d/boot.d/S08boot.klog

Create OS template

Create OS template cache by invoking the following command: tar -czf /vz/template/cache/opensuse-10.3-i386-default.tar.gz ./

Yellowpin.svg Note: For Debian-based host you should put the archive inside /var/lib/vz/template/cache