Step-By-Step-Howto

Version 9 (schmelzs, 02/18/2009 09:04 pm)

1 1 schmelzs
h1. Step By Step HOWTO: Stateless Linux with OpenSLX
2 1 schmelzs
3 1 schmelzs
The operation and administration of a larger number of computers is quite a lot of effort. This is also true for Linux installations. So that administration won't become the main task with your implementation and maintenance of a larger installation, there is a need for special technologies to get the problem under control. Apart from the classic method of Software Deployments and Patch Managements, Stateless approaches have the best chance to relieve the admin from boring routine tasks. On request, one installation can serve any number of Client-machines over the network. For this there is no need for any special preparation of the machines: PXE or Etherboot are sufficient to allow the machine to boot from the network. From this, additional freedom of design is achieved: Local installations don't need to loose ground, but can for example, during migration or mixed scenarios, offer an alternative to the Stateless operation.
4 1 schmelzs
5 1 schmelzs
OpenSLX deals with GPL-Software that allows installation and easy administration on hard drive free Linux Workstations. The project focuses of large installations with a similar deployment profile (So not necessarily machines with special hardware for production control etc.). This is currently implemented in Schools or Universities to have a highly flexible and stable pool environment for training courses, classes etc. On the established Stateless-Linux-Basis, another OS for training purposes, such as Windows or Linux, can effectively be distributed through virtualization technologies (currently VMplayer, later also VirtualBox or XEN).
6 1 schmelzs
7 1 schmelzs
The switch-over between different operation modes occurs at boot time, since no costly Image distribution (Imagecopy) occurs before or during the machine boot.
8 1 schmelzs
9 1 schmelzs
Plenty of good Linux distributions are available: For this reason OpenSLX doesn't choose the approach to offer its own package collection. Instead a script collection is available which many standard distributions prepare for the stateless operation. The OpenSLX package prepares a middleware for you that stays hidden from the user of a machine. So the appropriate "Look & Feel" of a distribution is maintained, the customization and changes occur in the background.
10 1 schmelzs
11 1 schmelzs
Users use their desktop to access all of their machines available equipment as usual: There are no special requirements since everything occurs locally and no costly, for example, Auto-mount chains need to happen. Playback of movies or use 
12 7 schmelzs
of 3D-applications is also no problem. Furthermore, only this way, can the extensive performance potential of today's desktop PCs be fully used and be given exclusively to the user.
13 1 schmelzs
14 1 schmelzs
This type of Linux Desktop allows the familiar uses of versatile applications: Virtualization environments such as Virtual Box or VMware(Player) allow you to boot further Operating Systems.
15 1 schmelzs
16 1 schmelzs
17 1 schmelzs
h2. Further Development
18 1 schmelzs
19 1 schmelzs
With technologies like UnionFS or AUFS, an existing base installation can easily be extended or cut back. This allows different user groups to be served separately. Furthermore it is possible to setup a central server that allocates ground installation/infrastructure, and further software is integrated into the system locally.
20 1 schmelzs
21 7 schmelzs
Completely different possibilities are offered through virtual workstations: Instead of installing the OS for a certain user directly, this occurs in a virtual environment, which places the container in the user's home directory. So, users can access any machine in the OpenSLX network and will find their familiar environment.
22 1 schmelzs
23 1 schmelzs
24 1 schmelzs
h2. Installation
25 1 schmelzs
26 1 schmelzs
The OpenSLX Package is actually like every other OpenSource Package, not finished, however is constantly being developed further since 1997. The current version is 4.9. You can download it from the project homepage, www.openslx.org, as RPM or Debian package. 
27 1 schmelzs
For OpenSuSE choose RPM:
28 1 schmelzs
29 1 schmelzs
<pre>
30 1 schmelzs
x60s:~ # wget
31 1 schmelzs
x60s:~ # rpm -i
32 1 schmelzs
</pre> 
33 1 schmelzs
34 1 schmelzs
For current bug fixes, new features and further supporting distributions, you can anonymously access the sources in the Subversion:
35 1 schmelzs
36 1 schmelzs
<pre>
37 1 schmelzs
x60s:~ # svn co http://svn.OpenSLX.org/svn/openslx/openslx
38 1 schmelzs
Ausgecheckt, Revision 2NNN.
39 1 schmelzs
x60s:~ # cd openslx/trunk
40 1 schmelzs
x60s:~/openslx/trunk # make install
41 1 schmelzs
</pre>
42 1 schmelzs
43 5 dvs
In many cases you need to add some additional Perl packages: For e.g. Ubuntu you should look for libclone-perl, libconfig-perl, libdbi-perl, libdbd-mysql-perl and libdbd-sqlite3-perl.
44 5 dvs
45 1 schmelzs
Irrespective of how you installed OpenSLX, OpenSLX will work with its original settings in the following directory structure:
46 1 schmelzs
47 1 schmelzs
<pre>
48 1 schmelzs
/etc/opt/openslx
49 1 schmelzs
/etc/opt/openslx/distro-info
50 1 schmelzs
/opt/openslx
51 1 schmelzs
/opt/openslx/lib
52 1 schmelzs
/opt/openslx/share
53 1 schmelzs
/opt/openslx/bin
54 1 schmelzs
/srv/openslx
55 1 schmelzs
/srv/openslx/export
56 1 schmelzs
/srv/openslx/tftpboot
57 1 schmelzs
/var/opt/openslx
58 1 schmelzs
/var/opt/openslx/config
59 1 schmelzs
/var/opt/openslx/db
60 1 schmelzs
/var/opt/openslx/stage1
61 1 schmelzs
</pre>
62 1 schmelzs
63 4 dvs
Only directories with the statistical SLX files are created, directories such as _/var/opt/openslx_ or _/srv/openslx_ are created at the setup of the Client environment. The command slxsetting allows you to specify:
64 1 schmelzs
65 1 schmelzs
<pre>
66 1 schmelzs
x60s:~ # slxsettings set private-path='/var/opt/openslx' set public-path='/'
67 1 schmelzs
setting private-path to '/var/opt/openslx'
68 1 schmelzs
setting public-path to '/'
69 1 schmelzs
</pre>
70 1 schmelzs
71 1 schmelzs
All global settings of the packages are placed beneath /etc/opt/openslx. All statistical files are placed in /opt/openslx, like scripts and the required Perl modules and Includes. All data that is generated during runtime is placed in /var/opt/openslx, if not changed through slxsettings. The directories are empty after installation. In config you can place files and configurations of later exported systems, db records the database of your Systems and Clients.
72 1 schmelzs
73 1 schmelzs
In a further step Exported systems are finally placed in stage1. While the amount of data in other directories can be disregarded, you should expect at least 5 - 50 GBytes of data depending on the type and number of OpenSLX-Installations (stage1).
74 1 schmelzs
75 1 schmelzs
If the specification of the directories isn't what you imagined, you can adjust these using the script slxsettings. This way you can for example specify that the Stage1 files aren't stored on your Server-Rootfilesystem but on a separately mounted partition instead.
76 1 schmelzs
77 1 schmelzs
See the current version of your OpenSLX-Toolsets through:
78 1 schmelzs
79 1 schmelzs
<pre>
80 1 schmelzs
x60s:~ # slxversion
81 4 dvs
5__.0.0revNNNN
82 1 schmelzs
</pre>
83 1 schmelzs
84 1 schmelzs
h2. Functionality
85 1 schmelzs
86 1 schmelzs
The task of the OpenSLX project is the setup of exportable systems; Distributions in a certain version, that can incorporate stateless clients over the network as Rootfilesystem. An SLX server can supply many of these systems.
87 1 schmelzs
88 1 schmelzs
For a good overview, the setup procedure of your stateless is separated into many clear stages:
89 2 schmelzs
* Stage0 identifies a running reference system on real or virtual hardware, of which a copy through Rsync is generated on the server. This stage simply plays a role for the clone mode.
90 2 schmelzs
* Stage1 identifies a executable client system, which is placed beneath /var/opt/openslx/stage1/<name>. With consistent hardware architecture you can access this directory through "slxos-setup shell <name>". The system is strictly setup and extended with particular local extensions. To this you could count the installation of special, not offered from the distribution, external software packages. There are two ways in which you could setup Stage1, through direct installation from the respective packet source or copy of an existing system (Clone, Stage0).
91 2 schmelzs
* Stage2 - from stage1, different Client-Rootfilesystems can be created. For this stage1 is duplicated, this means the omission of irrelevant files for the stateless operation, a new sub-directory in NFS-Export is created or for Network block devices a compressed SquashFS is applied. An appropriate Kernel is needed for this (usually directly from the distribution being used), at least one InitialRamFS fitting to the Kernel and one Client configuration. The Client configuration can contain an array of files that are extracted to the appropriate place in Stage3.
92 2 schmelzs
* Stage3 - During Stage0-2 administrative procedures occur on the SLX server, which you only need to do a few times. Stage3 occurs on every single client at every restart within the InitialRamFS. Here the individual machines are setup. This area is covered by the shell scripts init (SLX-Init), hwautocfg and servconfig. The latter places all the clients important configuration files in /mnt/etc. Local extensions (for all clients that use a certain InitRamFS) are possible by using preinit.local at the very beginning of SLX-Init, postinit.local towards the end of SLX-Init. postinit.local is created through ConfTGZ. This is a package of configuration files that are downloaded through, for example, TFTP and then extracted in Stage3. The template for this is in /var/opt/openslx/config/<system>. <system> is the name of the Vender OS linked through two colons and the type of the export.* In Stage4, SLX view, only some smaller configuration tasks occur. The client now has a complete Rootfilesystem, all programs and files, so now the keyboard configuration can occur. Also, in this stage, the graphical login is started to an appropriate earlier time.
93 1 schmelzs
94 2 schmelzs
Depending on the type of the clients, you may want to prepare one or more different system exports on a server. This can mean that a Stage1 system in many varieties, like NFS and at the same time NBD/SquashFS, should be delivered to the clients. On the other hand, very different Stage1's can be served with the same technology from different exports. This is, for example, useful for on-site tests, when you would like to offer the new system parallel with an existing system.
95 1 schmelzs
96 2 schmelzs
There are two options if you would like to export one and the same base system in different ranges: You either, from the start, put two different Stage1 versions into place which are maintained separately. Or you move the differences into a certain area which will later be additionally mounted in the environment, for example by using a Stacking file system.
97 1 schmelzs
98 1 schmelzs
99 2 schmelzs
h2. The SLX-Server
100 1 schmelzs
101 2 schmelzs
All the considerations made so far have an effect on space requirements. Depending on the range of the installed system, a Stage1 version needs 2 - 8 GBytes of disk space in the folder /var/opt/openslx/stage1. A Stage2-NFS-Export requires between 90 and 98% of this amount, a NBD/SquashFS-Export between 35 - 50%. Accordingly you should ensure /srv/openslx/export has enough disk space.
102 1 schmelzs
103 2 schmelzs
SLX-Clients operate stateless and have no local operating system installed. They obtain their joint Rootfilesystem from a central server, which should be configured with sufficient capacity. The largest load is carried by the Rootfilesystem export service, which generates the largest Filesystem output. For a setup consisting of 100 clients, you should have one to two Gigabit Interfaces and fast hard drives bound by RAID installed on your server. Since only the files in the area of the exports of the clients are incorporated, you can place /var/opt/openslx/stage1 on slower drives. The requirement of DHCP and TFTP do not even burden an average server with more than 1000 clients. While the server sits better on the backbone of your network, a 100Mbits interface is sufficient for the clients. Depending on the type of operation, in one day between 0.3 and 3 Gigabytes of data is transported per client. The installation of Network block devices with SquashFS can more than halve the amount of data compared to NFS.
104 1 schmelzs
105 2 schmelzs
An increase of the client connections to 1 Gigabit should be accompanied with improved IO of the server: A very fast RAID or placing the exports in RAM connected with Gigabit-Trunking accelerates the start and operation of the clients considerably. They are then generally noticeably faster as in classic operation from a local hard disk.
106 1 schmelzs
107 2 schmelzs
For smaller network of demonstration with few clients, an average equipped fileserver of normal Desktop PC should suffice.
108 1 schmelzs
109 2 schmelzs
h2. Program names und global Settings
110 1 schmelzs
111 2 schmelzs
The Configuration and Setup programs all have the prefix "slx", most of which are Perl scripts. Most tools deliver some short help with the Option "--help", the Manpage can be accessed through "--man".
112 1 schmelzs
113 2 schmelzs
You can set global settings after the installation using slxsettings, like directory structure. Calling slxsettings without parameters, a list of current settings is shown:
114 1 schmelzs
115 2 schmelzs
<pre>
116 1 schmelzs
x60s:~ # slxsettings
117 1 schmelzs
paths fixed at installation time:
118 6 schmelzs
119 1 schmelzs
        base-path='/opt/openslx'
120 1 schmelzs
        config-path='/etc/opt/openslx'
121 1 schmelzs
current base settings (cmdline options):
122 1 schmelzs
        db-name='openslx'
123 1 schmelzs
        db-spec=''
124 1 schmelzs
        db-type='SQLite'
125 1 schmelzs
        debug-confess=''
126 1 schmelzs
        locale='de_DE.UTF8'
127 1 schmelzs
        locale-charmap='UTF-8'
128 1 schmelzs
        private-path='/var/opt/openslx'
129 1 schmelzs
        public-path='/'
130 1 schmelzs
        temp-path='/tmp'
131 1 schmelzs
        verbose-level=''
132 1 schmelzs
extended settings:
133 1 schmelzs
        db-passwd=<unset>
134 1 schmelzs
        db-user=<unset>
135 1 schmelzs
        default-shell='bash'
136 1 schmelzs
        default-timezone='Europe/Berlin'
137 1 schmelzs
        mirrors-preferred-top-level-domain='de'
138 1 schmelzs
        mirrors-to-try-count='20'
139 1 schmelzs
        mirrors-to-use-count='5'
140 1 schmelzs
        ossetup-max-try-count='5'
141 1 schmelzs
        pxe-theme=<unset>
142 1 schmelzs
        pxe-theme-menu-margin='9'
143 2 schmelzs
</pre>
144 1 schmelzs
145 2 schmelzs
slxsettings provides through an extensive help (slxsettings --man), which summaries all Perl based SLX commands:
146 1 schmelzs
147 2 schmelzs
<pre>
148 1 schmelzs
SLXSETTINGS(1)        User Contributed Perl Documentation       SLXSETTINGS(1)
149 1 schmelzs
150 1 schmelzs
NAME
151 6 schmelzs
       slxsettings - OpenSLX-script to show & change local settings
152 1 schmelzs
153 1 schmelzs
SYNOPSIS
154 1 schmelzs
       slxsettings [options] [action ...]
155 1 schmelzs
156 1 schmelzs
       Script Actions
157 1 schmelzs
158 8 schmelzs
             set <option-name=value>    sets the option to the given value
159 8 schmelzs
             reset <option-name>        resets the given option to its default
160 1 schmelzs
161 1 schmelzs
       List of Known Option Names
162 1 schmelzs
163 8 schmelzs
             db-name=<string>           name of database
164 8 schmelzs
             db-spec=<string>           full DBI-specification of database
165 8 schmelzs
             db-type=<string>           type of database to connect to
166 1 schmelzs
             locale=<string>            locale to use for translations
167 1 schmelzs
             logfile=<string>           file to write logging output to
168 8 schmelzs
             private-path=<string>      path to private data
169 8 schmelzs
             public-path=<string>       path to public (client-accessible) data
170 8 schmelzs
             temp-path=<string>         path to temporary data
171 8 schmelzs
             verbose-level=<int>        level of logging verbosity (0-3)
172 1 schmelzs
173 1 schmelzs
       General Options
174 1 schmelzs
175 8 schmelzs
             --help                     brief help message
176 8 schmelzs
             --man                      full documentation
177 8 schmelzs
             --quiet                    do not print anything
178 8 schmelzs
             --version                  show version
179 1 schmelzs
       Actions
180 1 schmelzs
181 1 schmelzs
           set <openslx-option>=<value>
182 1 schmelzs
               sets the specified option to the given value
183 1 schmelzs
184 1 schmelzs
           reset <setting>
185 1 schmelzs
               removes the given setting from the local settings (resets it to
186 1 schmelzs
               its default value)
187 1 schmelzs
           ...
188 2 schmelzs
</pre>
189 1 schmelzs
190 8 schmelzs
Thus the Debug expenditure can be controlled by the option --verbose-level=0-3 with all SLX commands. Changes of the values can be made with set, reset allows for resetting on the default value, if available, or deletes the entry.
191 1 schmelzs
192 2 schmelzs
For most SLX environments the default values should be ok. If however you have for example mounted a large empty partition under /data/openslx and would like to use this for OpenSLX, you can adjust the Stage1-Installationen on these:
193 1 schmelzs
194 2 schmelzs
<pre>
195 1 schmelzs
x60s:~ # slxsettings set public-path='/data/openslx'
196 1 schmelzs
setting public-path to '/data/openslx'
197 1 schmelzs
x60s:~ # slxsettings set mirrors-preferred-top-level-domain=de
198 1 schmelzs
setting mirrors-preferred-top-level-domain to 'de'
199 2 schmelzs
</pre>
200 1 schmelzs
201 2 schmelzs
The second example shows an important setting for the search of mirrors of the sources of installation of the different distributions. OpenSLX tries to determine the Domain with the installation, however fails in networks with private Domain names. Likewise you can change the type of database which administers with OpenSLX exported systems and your clients. The standard type is "SQLite", depending upon installed Perl components you may alternatively also use MySQL.
202 1 schmelzs
203 2 schmelzs
<pre>
204 1 schmelzs
x60s:~ # slxsettings set db-type=SQLite
205 1 schmelzs
setting db-type to 'SQLite'
206 2 schmelzs
</pre>
207 1 schmelzs
208 2 schmelzs
Once you have decided on the type of database, you cannot easily change it in the running system. After base installation, you must devote to a database at Stage0 
209 1 schmelzs
or Stage1.
210 1 schmelzs
211 1 schmelzs
You will find the settings in /etc/opt/openslx/settings:
212 2 schmelzs
<pre>
213 1 schmelzs
SLX_DB_TYPE=SQLite
214 1 schmelzs
SLX_MIRRORS_PREFERRED_TOP_LEVEL_DOMAIN=de
215 1 schmelzs
SLX_PUBLIC_PATH=/data/openslx
216 1 schmelzs
217 2 schmelzs
</pre>
218 1 schmelzs
219 2 schmelzs
h2. Stage1 from Network Sources or reference machines
220 1 schmelzs
221 2 schmelzs
Depending on the Linux Distribution, there are one or two ways to setup Stage1: either you install a fresh system from the package sources or you clone an already setup machine, which is running under your Linux distribution. Both are taken care of by the command slxos-setup, which is made up of "slxos-setup command <parameter>". Information is listed by the subcommand "list-supported":
222 1 schmelzs
223 2 schmelzs
<pre>
224 1 schmelzs
x60s:~ # slxos-setup list-supported
225 1 schmelzs
        gentoo-2007.X           (clone)
226 1 schmelzs
        suse-10.2               (clone,install)
227 1 schmelzs
        suse-10.2_x86_64        (clone,install)
228 1 schmelzs
        suse-10.3               (clone)
229 1 schmelzs
        suse-10.3_x86_64        (clone)
230 1 schmelzs
        suse-11.0               (clone,install)
231 1 schmelzs
        suse-11.0_x86_64        (clone,install)
232 1 schmelzs
        ubuntu-8.04             (clone,install)
233 1 schmelzs
        ubuntu-8.04_amd64       (clone,install)
234 2 schmelzs
</pre>
235 1 schmelzs
236 2 schmelzs
So far not all listed distributions from SLX-Stage3 are supported. New installations are performed by slxos-setup with the subcommand "install", followed by the 
237 1 schmelzs
distribution:
238 1 schmelzs
239 2 schmelzs
<pre>
240 1 schmelzs
x60s:~ # slxos-setup install suse-11.0
241 1 schmelzs
[ ... lots of yum output ... ]
242 1 schmelzs
Total download size: 69 k
243 1 schmelzs
Downloading Packages:
244 1 schmelzs
(1/2): nbd-2.8.7-14.i586. 100% |=========================|  45 kB    00:00
245 1 schmelzs
(2/2): squashfs-kmp-defau 100% |=========================|  24 kB    00:00
246 1 schmelzs
Running Transaction Test
247 1 schmelzs
Finished Transaction Test
248 1 schmelzs
Transaction Test Succeeded
249 1 schmelzs
Running Transaction
250 1 schmelzs
  Installing: squashfs-kmp-default         ######################### [1/2]
251 1 schmelzs
  Installing: nbd                          ######################### [2/2]
252 1 schmelzs
253 1 schmelzs
Installed: nbd.i586 0:2.8.7-14 squashfs-kmp-default.i586 0:3.1_2.6.18.2_34-34
254 1 schmelzs
Complete!
255 1 schmelzs
Starting SuSEconfig, the SuSE Configuration Tool...
256 1 schmelzs
Running in full featured mode.
257 1 schmelzs
Reading /etc/sysconfig and updating the system...
258 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.perl...
259 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.permissions...
260 1 schmelzs
Finished.
261 1 schmelzs
Vendor-OS 'suse-11.0' installed succesfully.
262 1 schmelzs
Vendor-OS 'suse-11.0' has been added to DB (ID=1).
263 2 schmelzs
</pre>
264 1 schmelzs
265 2 schmelzs
Depending on bandwidth and load of your network you can plan a coffee or lunch break till this step is finished. All of the installed distributions can be refreshed with "slxos-setup update <distro>", which is considerably faster than the primary installation.
266 1 schmelzs
267 2 schmelzs
If you already have an established system, since, for example, you may want to turn Fat-Clients into OpenSLX-Clients, Clone setup may be a good option. The slxos-setup subcommand "clone" requires the outgoing source. To be able to identify a classic cloned system of a classic RPM installation, give the child an individual name. Everything you enter after the distribution name and version, for example "-mysystem", become part of the name. The actual clone operation occurs in the background with the command Rsync, so that at the start you are prompted for the root password of the reference machine. On an Ubuntu Reference system you must ensure that "root" can login through SSH.
268 1 schmelzs
269 2 schmelzs
<pre>
270 1 schmelzs
x60s:~ # slxos-setup clone 10.60.4.50:/ suse-11.0-mysystem
271 1 schmelzs
Cloning vendor-OS from '10.60.4.50:/' to '/space/stage1/suse-11.0-mysystem'...
272 1 schmelzs
Password: 
273 1 schmelzs
receiving file list ...
274 1 schmelzs
...
275 1 schmelzs
var/yp/
276 1 schmelzs
var/yp/nicknames
277 1 schmelzs
var/yp/binding/
278 1 schmelzs
279 1 schmelzs
sent 5765235 bytes  received 6044617832 bytes  5710602.23 bytes/sec
280 1 schmelzs
total size is 6025777602  speedup is 1.00
281 1 schmelzs
Vendor-OS 'suse-11.0-mysystem' has been cloned successfully.
282 1 schmelzs
Vendor-OS 'suse-11.0-mysystem' has been added to DB (ID=3).
283 2 schmelzs
</pre>
284 1 schmelzs
285 1 schmelzs
286 1 schmelzs
The subcommand "list-installed" shows you all existing Stage1-Systems:
287 2 schmelzs
288 2 schmelzs
<pre>
289 1 schmelzs
x60s:~ # slxos-setup list-installed
290 1 schmelzs
List of installed vendor-OSes:
291 1 schmelzs
        suse-11.0-mysystem
292 1 schmelzs
        suse-10.3
293 2 schmelzs
</pre>
294 1 schmelzs
295 2 schmelzs
h2. Plug-ins - the modular Extension of the base package
296 1 schmelzs
297 2 schmelzs
The general Software Architecture of OpenSLX aims to extend the base functionality of the system by implementing special extensions (OS-Plugins). The previous steps were sufficient for a bootable base system, however not a comfortable graphical desktop. This task is taken over by the plug-ins "xserver" and "desktop". The first takes care of 
298 2 schmelzs
the automatic setup of Xorg and the integration of proprietary OpenGL drivers from NVidia or ATI/AMD. The second deals with the setup of display managers and the graphical default session.
299 1 schmelzs
300 2 schmelzs
Installation of the plug-ins and their configuration, if you wish to change their default settings, is taken care by the command slxos-plugin:
301 2 schmelzs
302 2 schmelzs
<pre>
303 1 schmelzs
x60s:~ # slxos-plugin install suse-11.0 desktop manager=kdm
304 1 schmelzs
Plugin desktop has been installed into vendor-OS 'suse-11.0'.
305 1 schmelzs
x60s:~ # slxos-plugin install ubuntu-8.04-clone xserver
306 1 schmelzs
Plugin xserver has been installed into vendor-OS 'suse-11.0'.
307 2 schmelzs
</pre>
308 1 schmelzs
309 2 schmelzs
For a later post installation of plug-ins: Without a following export and call to the OpenSLX Demuxers, which are explained later, the selected plug-in won't be available on the booting SLX-Clients.
310 1 schmelzs
311 2 schmelzs
Stage3-Attribute, that like the desktop plug-in includes settings for later running clients, writes slxos-plugin into the database. There you can customize these anytime for single clients, whole groups or vendor OS.
312 1 schmelzs
313 2 schmelzs
h2. System Export
314 1 schmelzs
315 2 schmelzs
The previous operations have not yet covered the allocation of a Rootfilesystem to booting clients. This occurs in the next step with slxos-export, which realises the transition from Stage1-Installations into Stage2-Exports. The parameter "list-installed" should, when called with slxos-export, give the identical result as with slxos-setup:
316 1 schmelzs
317 2 schmelzs
<pre>
318 1 schmelzs
x60s:~ # slxos-export list-installed
319 1 schmelzs
List of installed vendor-OSes:
320 1 schmelzs
        suse-10.3-mysystem
321 1 schmelzs
        suse-11.0
322 2 schmelzs
</pre>
323 1 schmelzs
324 2 schmelzs
From this system you can now create an Export, currently supported are "nfs" and "nbd-squash". Further types will be added in future development. The subcommand "export", you create a new export, for example:
325 1 schmelzs
326 2 schmelzs
<pre>
327 1 schmelzs
x60s:~ # slxos-export export suse-11.0-x60 sqfs-nbd
328 1 schmelzs
invoking mksquashfs...
329 1 schmelzs
Parallel mksquashfs: Using 1 processor
330 1 schmelzs
Creating little endian 3.0 filesystem on /data/openslx/export/sqfs/suse-11.0-x60
331 1 schmelzs
    block size 65536.
332 1 schmelzs
[===========================================================] 294751/294751 100%
333 1 schmelzs
[ ... ]
334 1 schmelzs
Filesystem size 2325395.23 Kbytes (2270.89 Mbytes)
335 1 schmelzs
        41.13% of uncompressed filesystem size (5654449.42 Kbytes)
336 1 schmelzs
Inode table size 2888177 bytes (2820.49 Kbytes)
337 1 schmelzs
        30.34% of uncompressed inode table size (9518178 bytes)
338 1 schmelzs
Directory table size 2735640 bytes (2671.52 Kbytes)
339 1 schmelzs
        47.98% of uncompressed directory table size (5701677 bytes)
340 1 schmelzs
[ ... ]
341 1 schmelzs
vendor-OS '/data/openslx/stage1/suse-11.0-x60' successfully exported to '/data/openslx/export/sqfs/suse-11.0-x60'!
342 1 schmelzs
Export 'suse-11.0-x60:sqfs-nbd' has been added to DB (ID=1)...
343 1 schmelzs
################################################################################
344 1 schmelzs
Please make sure you start a corresponding nbd-server:
345 1 schmelzs
        nbd-server 5000 /data/openslx/export/sqfs/suse-11.0-x60 -r
346 1 schmelzs
################################################################################
347 1 schmelzs
system 'suse-11.0-x60:sqfs-nbd' has been successfully added to DB (ID=1)
348 2 schmelzs
</pre>
349 1 schmelzs
350 1 schmelzs
A classic NFS Rootfilesystem can be created through a similar call:
351 1 schmelzs
352 2 schmelzs
<pre>
353 1 schmelzs
x60s:~ # slxos-export export suse-11.0 nfs
354 1 schmelzs
building file list ...
355 1 schmelzs
...
356 2 schmelzs
... rsync output ...
357 1 schmelzs
...
358 1 schmelzs
sent 5642940230 bytes  received 5681918 bytes  9147566.23 bytes/sec
359 1 schmelzs
total size is 5624419842  speedup is 1.00
360 1 schmelzs
vendor-OS '/data/openslx/stage1/suse-11.0-x60' successfully exported to 
361 1 schmelzs
 '/data/export/nfs/suse-11.0'!
362 1 schmelzs
Export 'suse-11.0-nfs' has been added to DB (ID=1)...
363 1 schmelzs
################################################################################
364 1 schmelzs
Please make sure the following line is contained in /etc/exports
365 1 schmelzs
in order to activate the NFS-export of this vendor-OS:
366 1 schmelzs
        /data/export/nfs/suse-11.0  *(ro,no_root_squash,async,no_subtree_check)
367 1 schmelzs
################################################################################
368 1 schmelzs
system 'suse-11.0-nfs' has been successfully added to DB (ID=1)
369 2 schmelzs
</pre>
370 1 schmelzs
371 2 schmelzs
Afterwards you can ensure that everything has worked through calling "slxos-export list-exported".
372 1 schmelzs
373 1 schmelzs
374 2 schmelzs
h2. Quick start
375 1 schmelzs
376 2 schmelzs
Up to this point you prepared the Rootfilesystem (either classic NFS or NBD with SquashFS) and the database filled with some base data. Missing now is the preparation of the respective Kernels with the appropriate InitialRamFS and one matching client configuration. This task is taken care by the command slxconfig-demuxer, which doesn't require any further parameters. 
377 1 schmelzs
378 2 schmelzs
It works directly with the entries in the database. With the base data you already have a valid configuration for each requesting client. For more specific settings, the tool slxconfig can be used, which will be explained in the next section.
379 1 schmelzs
380 2 schmelzs
Your ISC-DHCP-Server should be running and the following two entries for the domain from which you want to boot stateless:
381 1 schmelzs
382 2 schmelzs
<pre>
383 1 schmelzs
next-server 10.8.4.254;
384 1 schmelzs
filename "pxe/pxelinux.0";
385 2 schmelzs
</pre>
386 1 schmelzs
387 2 schmelzs
The second entry depends on the specified TFTP root directory. How to proceed: When DHCP is running, enter the appropriate values. Now you should have prepared everything needed to test the first clients. If you have not yet turned on the PXE-Bootability, do this on your clients now. They should now be assigned an IP Address at start-up and then download the Kernel and InitRamFS.
388 1 schmelzs
389 1 schmelzs
390 2 schmelzs
h2. The Database and the Boot Setup
391 1 schmelzs
392 2 schmelzs
As soon as you want to manage multiple systems or give clients varying settings, the configuration through the database comes into play. To communicate with the database, which is located by slxox-* under /var/opt/openslx/db or where ever you specified, use the command slxconfig. It can occur that not every type of database is supported on every server. This will be determined at the end of the call slxos-setup. Then you can edit this using slxsettings.
393 1 schmelzs
394 2 schmelzs
This plans to be extended to a web interface in future versions. Entries in the database up until now were entered automatically and show:
395 1 schmelzs
396 2 schmelzs
<pre>
397 1 schmelzs
x60s:~ # slxconfig list-vendoros
398 1 schmelzs
List of the matching vendor-OSes:
399 1 schmelzs
        suse-10.3-mysystem
400 1 schmelzs
	suse-11.0
401 1 schmelzs
x60s:~ # slxconfig list-export
402 1 schmelzs
List of the matching exports:
403 1 schmelzs
        suse-10.3-mysystem        (nfs)
404 1 schmelzs
	suse-11.0:sqfs-nbd        (sqfs-nbd)
405 2 schmelzs
</pre>
406 1 schmelzs
407 2 schmelzs
For the installation Vendor-OS, called SLX-Stage1 and the exports created from this. Generally one entry will be created for one system in the database:
408 1 schmelzs
409 2 schmelzs
<pre>
410 1 schmelzs
x60s:~ # slxconfig list-systems
411 1 schmelzs
List of systems:
412 1 schmelzs
        <<<default>>>
413 1 schmelzs
        suse-10.3-mysystem:nfs
414 1 schmelzs
	suse-11.0:sqfs-nbd
415 2 schmelzs
</pre>
416 1 schmelzs
417 1 schmelzs
now displays
418 1 schmelzs
419 2 schmelzs
<pre>
420 1 schmelzs
x60s:~ # slxconfig add-client slx-test01 mac=00:01:02:03:04:06
421 1 schmelzs
client 'slx-test01' has been successfully added to DB (ID=1)
422 1 schmelzs
x60s:~ # slxconfig add-client slx-test02 mac=00:11:22:33:44:55
423 1 schmelzs
client 'slx-test02' has been successfully added to DB (ID=2)
424 2 schmelzs
</pre>
425 1 schmelzs
426 2 schmelzs
So that your Administrator can also login on the clients, you should determine a joint root password. For German users it makes sense to change the default language:
427 1 schmelzs
428 2 schmelzs
<pre>
429 1 schmelzs
x60s:~ # slxconfig change-system suse-11.0:sqfs-nbd country=de
430 2 schmelzs
</pre>
431 1 schmelzs
432 2 schmelzs
If everything works then you can remove this again. One alternative would be to distribute an "Authorized"-SSH-Key to the clients using ConfTGZ, to be able to access a fixed machine without problems. Debugging is often not possible without access to the client itself.
433 1 schmelzs
434 2 schmelzs
You complete the last step by calling slxconfig-demuxer. This command does not require any further subcommands or parameters, since it obtains all of its information from the database. All the necessary operations to complete the Stage2 phase are done in this step.
435 1 schmelzs
436 2 schmelzs
The slxconfig-demuxer completely rebuilds the directory <public-path>/tftpboot and <public-path>/tftpboot/client-config. And changes that you may have made in these folders will be lost. There are multiple sources of the demuxers:
437 2 schmelzs
* Kernel, -modules come from Stage1, the respective Vender-OS from which an export was created
438 2 schmelzs
* The base configuration, the InitRamFS setup, for the created InitRamFS will be generated from the database. Entries can be edited with slxconfig.
439 2 schmelzs
* The package of the configuration data (ConfTGZ) comes from /var/opt/openslx/config/<system-name>. The system name is automatically entered into the database by slxos-export.
440 1 schmelzs
441 1 schmelzs
442 2 schmelzs
h2. Communication with the Database
443 1 schmelzs
444 3 schmelzs
The tool slxconfig provides the user interface to the database. With this you can display all settings and make changes. "slxconfig list-system" shows you all activated, ready for potential clients, SLX systems.
445 1 schmelzs
446 3 schmelzs
In the last section you entered single clients into the database. You can see all set variables with:
447 1 schmelzs
448 3 schmelzs
<pre>
449 1 schmelzs
x60s:~ # slxconfig --verbose list-system name="<system>"
450 1 schmelzs
List of systems:
451 1 schmelzs
system 'suse-11.0-main:nfs':
452 1 schmelzs
    clients       = <<<default>>>
453 1 schmelzs
    comment       = -
454 1 schmelzs
    description   = -
455 1 schmelzs
    export_id     = 6 (suse-11.0-main:nfs)
456 1 schmelzs
    hidden        = -
457 1 schmelzs
    id            = 5
458 1 schmelzs
    kernel        = vmlinuz
459 1 schmelzs
    kernel_params = aufs vga=0x317 quiet
460 1 schmelzs
    label         = suse-11.0-main:nfs
461 1 schmelzs
  PLUGINS:
462 1 schmelzs
    30...Theme
463 1 schmelzs
    50...VMware
464 1 schmelzs
  ATTRIBUTES:
465 1 schmelzs
    country       = de
466 1 schmelzs
    ramfs_fsmods  = aufs
467 1 schmelzs
    ramfs_nicmods = forcedeth e1000 e100 tg3 r8169 pcnet32 b44 8139too
468 1 schmelzs
    slxgrp        = default
469 1 schmelzs
    start_cron    = yes
470 1 schmelzs
    start_dreshal = yes
471 1 schmelzs
    start_nfsv4   = yes
472 1 schmelzs
    start_ntp     = yes
473 1 schmelzs
    start_sshd    = yes
474 1 schmelzs
    start_x       = yes
475 1 schmelzs
    start_xdmcp   = kdm
476 1 schmelzs
    theme::name   = openslx
477 1 schmelzs
    vmware        = nfs://10.4.6.1/vol/vmwareImages/vmware
478 3 schmelzs
</pre>
479 1 schmelzs
480 3 schmelzs
Most of the settings aren't assigned a value for the setup of the machine so they are assigned "<<<default>>>". You can change the parameter of the system and default system:
481 1 schmelzs
482 3 schmelzs
<pre>
483 1 schmelzs
x60s:~ # slxconfig change-system "<<<default>>>" start_xdmcp=gdm
484 1 schmelzs
system '<<<default>>>' has been successfully changed.
485 3 schmelzs
</pre>
486 1 schmelzs
487 3 schmelzs
This configuration ensures that all cloned SuSE-11.0 clients start with the Default-Splash with the resolution 1024x768:
488 3 schmelzs
489 3 schmelzs
<pre>
490 1 schmelzs
x60s:~ # slxconfig change-system suse-10.3-mysystem:sqfs-nbd \
491 1 schmelzs
kernel_params="vga=0x317 quiet"
492 3 schmelzs
</pre>
493 1 schmelzs
494 3 schmelzs
The following database entry is needed if the home directory of the user is not prepared the secure NFSv3 way:
495 1 schmelzs
% predicted to be in plug-in
496 3 schmelzs
497 3 schmelzs
<pre>
498 1 schmelzs
x60s:~ # slxconfig change-system suse-10.3-mysystem:sqfs-nbd automnt_dir=/home 
499 1 schmelzs
automnt_src="nfs://11.00.4.2/home"
500 3 schmelzs
</pre>
501 1 schmelzs
502 3 schmelzs
In many scenarios you may use different servers for DHCP, TFPT and the fileserver for the Client-Rootfilesystem. Should your export server differ from the DHCP-Server, you must inform your database:
503 1 schmelzs
504 3 schmelzs
<pre>
505 3 schmelzs
x60s:~ # slxconfig change-export suse-10.3-main::sqfs-nbd server_ip=10.30.4.4 port=5002
506 1 schmelzs
export 'suse-10.3-main::sqfs-nbd' has been successfully changed
507 1 schmelzs
x60s:~ # slxconfig list-export suse-10.3-main::sqfs-nbd
508 1 schmelzs
List of exports:
509 1 schmelzs
export 'suse-10.3-main::sqfs-nbd':
510 1 schmelzs
    comment      = -
511 1 schmelzs
    id           = 10
512 1 schmelzs
    port         = 5002
513 1 schmelzs
    server_ip    = 10.30.4.4
514 1 schmelzs
    type         = sqfs-nbd
515 1 schmelzs
    uri          = -
516 1 schmelzs
    vendor_os_id = 7 (suse-10.3-main)
517 1 schmelzs
518 1 schmelzs
x60s:~ # slxconfig change-system suse-11.0-clone::nfs \
519 1 schmelzs
  scratch="nfs://10.8.4.2/data/export/tmp"
520 3 schmelzs
</pre>
521 1 schmelzs
522 1 schmelzs
523 3 schmelzs
h2. System-Update and Extension
524 1 schmelzs
525 3 schmelzs
With Stage1-Installations installed directly from the package source, you perform updates on the server. This is triggered by the "update" parameter in slxos-setup:
526 1 schmelzs
527 3 schmelzs
<pre>
528 1 schmelzs
x60s:~ # slxos-setup update suse-11.0-kde
529 1 schmelzs
Setting up Update Process
530 1 schmelzs
Setting up repositories
531 1 schmelzs
base_non-oss              100% |=========================|  951 B    00:00
532 1 schmelzs
base                      100% |=========================|  951 B    00:00
533 1 schmelzs
base_update               100% |=========================| 1.2 kB    00:00
534 1 schmelzs
Reading repository metadata in from local files
535 1 schmelzs
primary.xml.gz            100% |=========================| 548 kB    00:00
536 1 schmelzs
################################################## 1340/1340
537 1 schmelzs
Resolving Dependencies
538 1 schmelzs
[ ... etliche weitere Ausgaben ... ]
539 1 schmelzs
Starting SuSEconfig, the SuSE Configuration Tool...
540 1 schmelzs
Running in full featured mode.
541 1 schmelzs
Reading /etc/sysconfig and updating the system...
542 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.perl...
543 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.permissions...
544 1 schmelzs
Finished.
545 1 schmelzs
Vendor-OS 'suse-11.0-kde' updated succesfully.
546 1 schmelzs
547 1 schmelzs
The update of a clone system is performed on the reference machine in 
548 1 schmelzs
the so called Stage0. After this you call 
549 1 schmelzs
"slxos-setup clone 11.00.4.50:/ suse-10.3-mysystem":
550 1 schmelzs
551 1 schmelzs
Vendor-OS 'suse-10.3-mysystem' has been re-cloned successfully. 
552 1 schmelzs
No need to change vendor-OS 'suse-10.3-mysystem' in OpenSLX-database.
553 3 schmelzs
</pre>
554 1 schmelzs
555 1 schmelzs
556 3 schmelzs
<pre>
557 1 schmelzs
x60s:~ # slxos-setup clone 0.20.4.50:/ suse-10.3-mysystem
558 1 schmelzs
building file list ...
559 1 schmelzs
[ ... etliche weitere Ausgaben ... ]
560 1 schmelzs
sent 434920 bytes  received 121491994 bytes  375737.79 bytes/sec
561 1 schmelzs
total size is 8644862874  speedup is 70.90
562 1 schmelzs
Vendor-OS 'suse-10.3-mysystem' has been cloned successfully.
563 1 schmelzs
No need to change vendor-OS 'suse-10.3-mysystem' in OpenSLX-database.
564 3 schmelzs
</pre>
565 1 schmelzs
566 3 schmelzs
You will then be informed that slxos-setup was completed successfully. There are no special update parameters for System Clone since the update occurs externally to the server on the reference machine and is only then copied to the server.
567 1 schmelzs
568 1 schmelzs
569 3 schmelzs
h2. Cleanup
570 1 schmelzs
571 3 schmelzs
At some stage you may want to remove older systems or test versions. The tools slxos-setup and slxos-export have a delete operation for this. For this you work in reverse order. slxconfig deals with the database and doesn't delete anything in the file system:
572 1 schmelzs
573 3 schmelzs
<pre>
574 1 schmelzs
x60s:~ # slxconfig remove suse-11.0
575 1 schmelzs
removing vendor-OS folder '/data/openslx/stage1/suse-11.0'...
576 1 schmelzs
Vendor-OS 'suse-11.0' removed successfully.
577 1 schmelzs
Vendor-OS 'suse-11.0' has been removed from DB!
578 3 schmelzs
</pre>
579 1 schmelzs
580 3 schmelzs
The removal of systems from the ~/tftpboot area occurs with a recall of slxconfig-demuxer.
581 1 schmelzs
582 3 schmelzs
In the next step you remove exports (parts of Stage2), which do not use an insignificant amount of disk space. This process also removes the associated database entry.
583 1 schmelzs
584 1 schmelzs
% change!!
585 3 schmelzs
<pre>
586 1 schmelzs
x60s:~ # slxos-export remove suse-11.0 nbd
587 1 schmelzs
export '/srv/openslx/export/nbd-squash/suse-11.0' successfully removed!
588 1 schmelzs
Export 'suse-11.0' has been removed from DB.
589 3 schmelzs
</pre>
590 3 schmelzs
<pre>
591 1 schmelzs
592 1 schmelzs
x60s:~ # slxos-export remove suse-11.0
593 1 schmelzs
export '/srv/openslx/export/nfs/suse-11.0' successfully removed!
594 1 schmelzs
Export 'suse-11.0' has been removed from DB.
595 3 schmelzs
</pre>
596 1 schmelzs
597 3 schmelzs
In the last step we remove the installed base system (Stage1) from the disk of your server. This also removes the database entry.
598 1 schmelzs
599 3 schmelzs
<pre>
600 1 schmelzs
x60s:~ # slxos-setup remove suse-11.0
601 1 schmelzs
Vendor-OS 'suse-11.0' removed succesfully.
602 1 schmelzs
Vendor-OS 'suse-11.0' has been removed from DB!
603 3 schmelzs
</pre>
604 1 schmelzs
605 1 schmelzs
606 3 schmelzs
h2. Boot Cycle
607 1 schmelzs
608 1 schmelzs
609 3 schmelzs
h3. PXE-Boot
610 1 schmelzs
611 3 schmelzs
Your PCs can now do what, for a long time, was a given on a "proper" Unix Workstation: Intels Pre boot eXtension Environment (PXE) gives the option of booting hard drive-less machines over a network. The network booting machine acquires an IP Address via DHCP as well as the information of where it can load a PXE-Image via TFTP. This then gives the machine more boot functionality. At this point a whole class of network software is added. Well known are the wide range of netbased operating system installations, whether Linux or Windows.
612 1 schmelzs
613 3 schmelzs
The PXE Boot menus for you clients are prepared by the slxconfig-demuxer automatically in the directory ~/tftpboot/pxe/pxelinux.cfg. If you would like to customize the look of your menu or change the default password for access to the appropriate kernel command line, you must edit the file /etc/opt/openslx/PXE-template.
614 1 schmelzs
615 1 schmelzs
616 3 schmelzs
h3. DHCP for the IP-Address assignment
617 1 schmelzs
618 3 schmelzs
If there was not already a DHCP server in your network, you will now need to setup one. In most cases it is sufficient to adjust two files to get a DHCP server running. The entries for your clients are found in /etc/dhcpd.conf. For initial test the following entries are enough:
619 1 schmelzs
620 3 schmelzs
<pre>
621 1 schmelzs
ddns-update-style none;
622 1 schmelzs
subnet 10.8.4.0 netmask 255.255.255.0 {
623 1 schmelzs
  server-identifier 10.8.4.1;
624 1 schmelzs
  next-server 10.8.4.1;
625 1 schmelzs
  filename "pxe/pxelinux.0";
626 1 schmelzs
  option routers 10.8.4.254;
627 1 schmelzs
  range 10.8.4.101 10.8.4.200;
628 1 schmelzs
}
629 3 schmelzs
</pre>
630 1 schmelzs
631 3 schmelzs
After this you determine in /etc/sysconfig/dhcpd that the DHCP server is listening on the correct interface and, for security, is running in a chroot environment:
632 1 schmelzs
633 3 schmelzs
<pre>
634 1 schmelzs
DHCPD_INTERFACE="eth0"
635 1 schmelzs
DHCPD_RUN_CHROOTED="yes"
636 3 schmelzs
</pre>
637 1 schmelzs
638 1 schmelzs
639 3 schmelzs
h3. TFTP
640 1 schmelzs
641 3 schmelzs
The start procedure of a client upto and including Stage3, is strongly associated with TFTP. The initial data (PXE-Linux and the menu system) and the client configuration are acquired using this protocol. The directory structure for a typical SLX-Installation looks like this:
642 1 schmelzs
643 3 schmelzs
<pre>
644 1 schmelzs
tftpboot/client-config
645 1 schmelzs
tftpboot/client-config/suse-11.0-A
646 1 schmelzs
tftpboot/client-config/suse-11.0-A/01-<MAC>.tgz
647 1 schmelzs
tftpboot/client-config/suse-11.0-A/default.tgz
648 1 schmelzs
tftpboot/client-config/<system>/...
649 1 schmelzs
tftpboot/pxe
650 1 schmelzs
tftpboot/pxe/menu.c32
651 1 schmelzs
tftpboot/pxe/pxelinux.0
652 1 schmelzs
tftpboot/pxe/suse-11.0
653 1 schmelzs
tftpboot/pxe/suse-11.0/initramfs-1
654 1 schmelzs
tftpboot/pxe/suse-11.0/vmlinuz
655 1 schmelzs
tftpboot/pxe/<vendor-os>/...
656 1 schmelzs
tftpboot/pxe/...
657 3 schmelzs
</pre>
658 1 schmelzs
659 3 schmelzs
By default, the directory is located under /srv/openslx. Its location can be changed by using slxsettings --tftpboot-path=New-Dir.
660 1 schmelzs
661 3 schmelzs
The file in.tftp is included with most distributions as TFTP server. This is activated using xinetd. For this you edit the file /etc/xinetd.d/tftp depending on the distribution:
662 1 schmelzs
663 3 schmelzs
<pre>
664 1 schmelzs
service tftp
665 1 schmelzs
{
666 1 schmelzs
        socket_type             = dgram
667 1 schmelzs
        protocol                = udp
668 1 schmelzs
        wait                    = yes
669 1 schmelzs
        user                    = root
670 1 schmelzs
        server                  = /usr/sbin/in.tftpd
671 1 schmelzs
        server_args             = -s /tftpboot
672 1 schmelzs
        disable                 = yes
673 1 schmelzs
}
674 3 schmelzs
</pre>
675 1 schmelzs
676 3 schmelzs
The carried out settings for the directory need to match the settings of the OpenSLX package and DHCP server. The variable "filename" contains "/tftpboot/pxe/pxelinux.0", this file should be delivered to the requesting PXE-Clients.
677 1 schmelzs
678 3 schmelzs
The entry "-s /tftpboot" means, that at the start of the in.tftpd, under the entered path, clients can download files from the server. So that the client knows where to search, the DHCP server informs them with the variable "filename". PXE itself is not in the position to load a large kernel which may be a few megabytes straight away. So, it is given a special Boot-Loader from the Syslinux package from Peter Anwin, pxelinux.0.
679 1 schmelzs
680 3 schmelzs
This tool takes over all further steps and can also build a boot menu and provide further boot options. After the establishment you restart xinetd, you then use the small command tftp from any machine in your network or directly from the server to check if the file pxelinux.0 can be loaded from the location your clients are expecting:
681 1 schmelzs
682 3 schmelzs
<pre>
683 1 schmelzs
dirk@x60s:/tmp> tftp 10.8.4.254
684 1 schmelzs
tftp> get /tftpboot/pxe/pxelinux.0
685 1 schmelzs
tftp> quit
686 1 schmelzs
dirk@x60s:/tmp> ls -la pxelinux.0
687 1 schmelzs
-rw-r--r-- 1 dirk users 13320 2007-04-20 16:10 pxelinux.0
688 3 schmelzs
</pre>
689 1 schmelzs
690 3 schmelzs
h3. Syslinux
691 1 schmelzs
692 3 schmelzs
In the last section we discussed a program to produce boot menus and to load the kernal and InitialRamFS through TFTP: pxelinux.0 is a component of the Syslinux package. The central program pxelinux.0 and menu-help program are available in the OpenSLX package.
693 1 schmelzs
694 3 schmelzs
There are some specific parameters for PXElinux. pxelinux.0 expects its configuration file in respect to some locations under pxelinux.cfg. If no special machine specific configuration files are found, it loads a file named default. Machine specific files have the format 01-<MAC-des-Clients>. The format of specific and default files is identical, their content may of course not differ. In your system settings you will find the template:
695 1 schmelzs
696 3 schmelzs
<pre>
697 1 schmelzs
NOESCAPE 0
698 1 schmelzs
PROMPT 0
699 1 schmelzs
TIMEOUT 10
700 1 schmelzs
DEFAULT menu.c32
701 1 schmelzs
IMPLICIT 1
702 1 schmelzs
ALLOWOPTIONS 1
703 1 schmelzs
MENU TITLE What would you like to do (Selection using cursor)?
704 1 schmelzs
MENU MASTER PASSWD secret
705 1 schmelzs
LABEL memtest
706 1 schmelzs
  KERNEL memtest.bin
707 3 schmelzs
</pre>
708 1 schmelzs
709 9 schmelzs
It is best to use the small test tool memtest for the first test of a PXE-Boot over the network. It is a small binary program which performs intensive memory tests in infinite test runs. So that you don't always need to get a CD with the current version, you can easily provide it through the network for all PXE compatible machines. The tool can be found, for example, on a magazine DVD or the first installation CD of SuSE and should be copied into the same directory as pxelinux.0. If it is in a different location, you must ensure that the TFTP server has access to this location. You can also specify the full path like "kernel /tftpboot/tools/memtest.bin". The termination of memtest can be chosen arbitrarily, but may not be "*.0". If everything worked well, you can then experiment using a Linux Kernel and an appropriate Ramdisk in the next step.
710 1 schmelzs
711 3 schmelzs
<pre>
712 1 schmelzs
prompt 1
713 1 schmelzs
timeout 100
714 1 schmelzs
default dxs
715 1 schmelzs
label dxs
716 1 schmelzs
  kernel dxs
717 1 schmelzs
  append vga=normal initrd=initrd-dxs nfsserver=10.30.4.1:/nfsroot/ldc
718 1 schmelzs
  ipappend 1
719 1 schmelzs
label memtest
720 1 schmelzs
  kernel memtest.bin
721 3 schmelzs
</pre>
722 1 schmelzs
723 9 schmelzs
Most of the parameters are self explanatory: Prompt ensures that PXElinux with the prompt "boot:" waits for 100 seconds (timeout 100). If in this time no input was given, by default "label dxs" will be started. The setting assumes the kernel called kernel-dxs and a matching Ramdisk called initrd-dxs is located in the directory /nfsroot/ldc/boot. This can easily be achieved with:
724 1 schmelzs
725 3 schmelzs
<pre>
726 1 schmelzs
cp /boot/vmlinuz /nfsroot/ldc/boot/kernel-dxs
727 1 schmelzs
cp /boot/initrd(.img) /nfsroot/ldc/boot/initrd-dxs
728 3 schmelzs
</pre>
729 1 schmelzs
730 9 schmelzs
"ipappend 1" ensures that PXE writes the configuration in the Kernel-Commandline which is acquired through DHCP. This contains the additional parameter "ip":
731 1 schmelzs
732 3 schmelzs
<pre>
733 1 schmelzs
ip=11.00.40.2:11.00.40.71:11.00.40.254:255.255.255.0
734 3 schmelzs
</pre>
735 1 schmelzs
736 9 schmelzs
You can view the content of this special row with the command "cat /proc/cmdline". After the configuration has been completed, you will see a lot more with a restart of the Test-Clients. Now the client almost looks like usual: A boot loader takes care of the Kernel as well as the Initial Ramdisk and ensures they start. The Kernel extracts itself, as is familiar with Knoppix or a hard drive installation. The Mini-Linux-Environment of the Initial-Ramdisk is carried out. However the process breaks with a failed mount of the Root-filesystem.
737 1 schmelzs
738 1 schmelzs
Image: vmware-normalinitrd.png
739 1 schmelzs
740 3 schmelzs
This is because the Kernel and Ramdisk come from a classic installation and are prepared for a start from a hard drive. At this point the Admin has come quite far and has enough of an understanding of the basic concepts to try out a Diskless Linux project.
741 1 schmelzs
742 1 schmelzs
743 3 schmelzs
h3. Configuration of OpenSLX Clients
744 1 schmelzs
745 3 schmelzs
OpenSLX clients cannot store their configuration as is the case with classic Linux-Workstations. This is why machines are prepared in multiple steps:
746 1 schmelzs
747 3 schmelzs
# You aquire you Base-IP-configuration when booting through PXE or Etherboot/gPXE if in the PXE file the Parameter IPAPPEND 1 is set. Otherwise the the machine will call a new DHCP-Client in Stage3.
748 3 schmelzs
# If the Kernel started in the Stage3-Init, the main script will read the configuration data from the previous stages Kernel command line and the InitRamFS delivered machine setup file.
749 3 schmelzs
# After this an extended configuration within Stage3, depending on the specified configuration start, is available.
750 3 schmelzs
# Then the Stage3 scripts read the loaded configuration and create the majority of the settings for Stage4.
751 1 schmelzs
752 3 schmelzs
All primary configuration steps occur during the run of InitialRamFS. The central configuration file is machine-setup. It is populated and extended during the setup of InitialRamFS in Stage2 initialization and during Stage3. In Stage4 it can be accessed in the directory /etc.
753 1 schmelzs
754 1 schmelzs
755 3 schmelzs
h3. The Kernel Command line
756 1 schmelzs
757 3 schmelzs
The slxconfig-demuxer prepares the Kernel Command line alongside the InitialRamFS and Client configuration. It consists of necessary and optional entries which are delivered by PXElinux or Etherboot. The IP configuration can and InitialRamFS must count towards this. However there is a problem, the Kernel command line with Intel platforms is limited to 256 characters, so must take this into account for this entry.
758 1 schmelzs
759 3 schmelzs
* debug - without specifying a level, the debug level is set to 1
760 3 schmelzs
* debug=* - sets the debug level on the specified integer value. For a listing of all debug levels see appendix E.2
761 3 schmelzs
* nodhcp - no renewed DHCP for configuration in InitRamFS. Setting for cases where the standard IP and DNS data are assigned in other ways (ConfTGZ and PXE-IP-Info). This entry is not in the Kernel command line by default.
762 3 schmelzs
* ldap=* - use LDAP for configuration (URI Syntax)
763 3 schmelzs
* file - use TFTP to acquired configuration files
764 3 schmelzs
* file=* - use TFTP take the specified TFTP Server and path (URI Syntax)
765 3 schmelzs
* ldsc - do not generate ld.so.cache and overtaken by existing3 from Stage2.
766 3 schmelzs
* rootfs=* - Type of Root file system of the Client. In question are currently NFS, (D)NBD with SquashFS. The URI Format is expected, for example "rootfs=nfs://server/pfad" or "rootfs=nbd://server:port/Filesystem". If the root filesystem is made up of many components, "ldsc" will automatically be activated. Instead of a constant server IP, you can use the variable "@@@serverip@@@" when DHCP- und Root file system servers are identical. In Stage3 it will be replaced with the DHCP acquired value for the DHCP server.
767 3 schmelzs
* dcsize=* - only needed with defined "rootfs=dnbd://...", defines the size of the cache file for DNBD. Since the cache file is stored in RAM, it should be chosen according to available RAM.
768 3 schmelzs
* ip=* - is populated through PXE-Linuxor Etherboot/gPXE.
769 3 schmelzs
* tmpfssize=* - size of the maximum temporary memory in RAM (tmpfs)
770 3 schmelzs
* vci=* - Vendor Code Identifier, only needed if DHCP is used.
771 3 schmelzs
772 3 schmelzs
h3. Central Configuration File machine-setup
773 3 schmelzs
774 3 schmelzs
The central Configuration File of a OpenSLX client is machine-setup. In the current version it can be found in /var/opt/openslx/config/default/initramfs/machine-setup. For a given installation it should already be populated with reasonable settings, since it is entered into the created InitRamFS as Initial-Configuration4. The configuration methods in the attached explanation, append their results to this file. So for example, the DHCP configuration could possibly overwrite the variable for Hostname, DNS-Server, ... etc. In some cases a variable can be defined more than once. In this case only the last one defined is valid, so the file is read from the bottom up if you are looking for a particular assignment.Instead of a constant Server IP for the differing sources or services, you can use the variable "@@@serverip@@@" in machine-setup. It will be 
775 3 schmelzs
replaced with the address acquired from DHCP in Stage3. With this you can spare yourself statistical entries if the same IP address is valid for most or even all SLX-Services.
776 3 schmelzs
Even though in most environments, OpenSLX Clients are kept quite consistent, it could be of interest or necessary to specify settings for individual clients separately. This becomes more important in larger networks with groups of clients. All of the following configuration types are accessed in Stage3 of the client start.
777 3 schmelzs
778 3 schmelzs
Currently there are three (four) configuration possibilities, even if they aren't all implemented:
779 3 schmelzs
Via TFTP (configuration plus extension - ConfTGZ)
780 3 schmelzs
file get - is a component of the current version 4. Extension to database generated machine-setup, like user authentication, home directory and admin specific scripts (summarized as TGZ) is obtained by the client (MAC sei 00:11:43:7c:da:ff) one after the other in the Form 01-00-11-43-7c-da-ff.tgz and default.tgz.
781 3 schmelzs
The files are obtained at the start of the Services-Configuration (servconfig), so could possibly be modified.
782 1 schmelzs
Files can be specified explicitly: 
783 1 schmelzs
"file=tftp://<server-ip>/pxe/client-config/<system-name>/01-00-11-43-7c-da-ff.tgz" 
784 1 schmelzs
or should be present under a certain schema.
785 1 schmelzs
786 1 schmelzs
For this reason, if problems arise, you should test the client first 
787 1 schmelzs
to see if the command line is populated with all options.
788 1 schmelzs
789 3 schmelzs
<pre>
790 1 schmelzs
apt-get  install libdbd-sqlite3-perl sqlite3
791 3 schmelzs
</pre>
792 1 schmelzs
793 3 schmelzs
h2. Problems
794 1 schmelzs
795 3 schmelzs
<pre>
796 1 schmelzs
slxconfig-demuxer  --verbose-level=2
797 1 schmelzs
798 1 schmelzs
slxos-setup remove suse-11.0-x86_64
799 1 schmelzs
removing vendor-OS folder '/var/opt/openslx/stage1/suse-11.0-x86_64'...
800 1 schmelzs
Vendor-OS 'suse-11.0-x86_64' removed successfully.
801 3 schmelzs
</pre>