Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

OpenSUSE template creation

1,341 bytes added, 13:58, 27 January 2011
m
Reverted edits by Boris (Talk) to last revision by Kir
=== Preparing the base system ===
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 ===
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. Execute the following commands to create device files: <pre>mknod -m 666 lib/udev/devices/full c 1 7mknod -m 600 lib/udev/devices/initctl pmknod -m 666 lib/udev/devices/random c 1 8mknod -m 444 lib/udev/devices/urandom c 1 9</pre> === Fix console redirect === Open <code>etc/init.d/halt</code> script and replace the following lines:<pre># Redirect our mesages to default consoletest -n "$REDIRECT" && exec 0<> $REDIRECT 1>&0 2>&0</pre>with this one (note <code>|| true</code> at the end):<pre># Redirect our mesages to default consoletest -n "$REDIRECT" && exec 0<> $REDIRECT 1>&0 2>&0 || true</pre> The reason is that this redirect fails with permission denied in OpenVZ environment if <code>$REDIRECT</code> is console device (<code>/dev/console</code>). As a result, script terminates with error (because of <code>set +e</code> at the beginning) and the box is not stopped properly. As an option, you can replace console device with regular file:
Change directory to <code>\<DIRINSTALL\>/lib/udev/devices/</code> and execute the following commonds:
<pre>
mknod -m 666 full c 1 7rm lib/udev/devices/console ; touch lib/udev/devices/console</pre> === Make df working ===mknod -m 600 initctl p<pre>mknod rm -m 666 random c 1 8f etc/mtabmknod ln -m 444 urandom c 1 9s /proc/mounts etc/mtab
</pre>
== Disable parallel startup of services ==
Set <code>RUN_PARALLEL</code> variable in <code>\<DIRINSTALL\>/etc/sysconfig/boot</code> to "no".
== 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/S08bootS*boot.klog</code>
== Create OS template ==
Create OS template cache by invoking the following command (from inside <code>\<DIRINSTALL\></code):<code> tar --numeric-owner -czf /vz/template/cache/opensuse-10.3-i386-default.tar.gz ./ {{Note|For Debian-based host you should put the archive inside <code>/var/lib/vz/template/cache</code>}}  == startproc troubleshooting ==
For Debian-based host you should put the archive inside It was noted that <code>startproc</var/libcode> under recent OpenVZ kernels sometimes fails with errors like <code>startproc: cannot stat /vzproc/template1128/cacheexe: Permission denied</code>. See http://openvz.org/pipermail/devel/2008-January/010278.html and follow-ups for workaround.
[[Category: HOWTO]]
[[Category: Templates]]