Step-By-Step-Howto

Version 16 (schmelzs, 05/12/2011 04:37 pm)

1 1 schmelzs
h1. Step By Step HOWTO: Stateless Linux with OpenSLX
2 1 schmelzs
3 11 dvs
{{>toc}}
4 11 dvs
5 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.
6 1 schmelzs
7 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).
8 1 schmelzs
9 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.
10 1 schmelzs
11 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.
12 1 schmelzs
13 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 
14 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.
15 1 schmelzs
16 13 dvs
This type of Linux Desktop allows the familiar uses of versatile applications: Virtualization environments such as Virtual Box, QEMU/KVM or VMware(Player) allow you to boot further Operating Systems.
17 1 schmelzs
18 1 schmelzs
19 1 schmelzs
h2. Installation
20 1 schmelzs
21 13 dvs
The OpenSLX Package is actually like every other OpenSource Package, not finished, however is constantly being developed further since 1997. The current version is some pre 5.0. You can download it from the project homepage, packages.openslx.org, as RPM or Debian package. 
22 13 dvs
For OpenSuSE choose TGZ, for Ubuntu and alike the DPKGs:
23 1 schmelzs
24 1 schmelzs
<pre>
25 1 schmelzs
x60s:~ # wget
26 1 schmelzs
x60s:~ # rpm -i
27 1 schmelzs
</pre> 
28 1 schmelzs
29 16 schmelzs
For current bug fixes, new features and further supporting distributions, you can anonymously access the sources from git:
30 1 schmelzs
31 1 schmelzs
<pre>
32 15 schmelzs
x60s:~ # git clone git://openslx.org/openslx/core openslx
33 15 schmelzs
Cloning into openslx...
34 15 schmelzs
remote: Counting objects: 28302, done.
35 15 schmelzs
remote: Compressing objects: 100% (10987/10987), done.
36 15 schmelzs
remote: Total 28302 (delta 16074), reused 28253 (delta 16030)
37 15 schmelzs
Receiving objects: 100% (28302/28302), 66.68 MiB | 6.52 MiB/s, done.
38 15 schmelzs
Resolving deltas: 100% (16074/16074), done.
39 15 schmelzs
x60s:~ # cd openslx
40 15 schmelzs
x60s:~/openslx # make install
41 1 schmelzs
</pre>
42 1 schmelzs
43 10 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. For RedHat or derivates like Scientific Linux you might need to add the following RPMs: perl-Clone, perl-Config-General, perl-DBD-SQLite, (perl-DBD-mysql). 
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 12 dvs
h2. 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 1 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 2 schmelzs
113 1 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 2 schmelzs
115 1 schmelzs
<pre>
116 2 schmelzs
x60s:~ # slxsettings
117 1 schmelzs
paths fixed at installation time:
118 1 schmelzs
119 10 dvs
120 1 schmelzs
        base-path='/opt/openslx'
121 1 schmelzs
        config-path='/etc/opt/openslx'
122 1 schmelzs
current base settings (cmdline options):
123 1 schmelzs
        db-name='openslx'
124 1 schmelzs
        db-spec=''
125 1 schmelzs
        db-type='SQLite'
126 1 schmelzs
        debug-confess=''
127 1 schmelzs
        locale='de_DE.UTF8'
128 1 schmelzs
        locale-charmap='UTF-8'
129 1 schmelzs
        private-path='/var/opt/openslx'
130 1 schmelzs
        public-path='/'
131 1 schmelzs
        temp-path='/tmp'
132 1 schmelzs
        verbose-level=''
133 1 schmelzs
extended settings:
134 1 schmelzs
        db-passwd=<unset>
135 1 schmelzs
        db-user=<unset>
136 1 schmelzs
        default-shell='bash'
137 1 schmelzs
        default-timezone='Europe/Berlin'
138 13 dvs
139 1 schmelzs
        mirrors-preferred-top-level-domain='de'
140 1 schmelzs
        mirrors-to-try-count='20'
141 1 schmelzs
        mirrors-to-use-count='5'
142 1 schmelzs
        ossetup-max-try-count='5'
143 1 schmelzs
        pxe-theme=<unset>
144 1 schmelzs
        pxe-theme-menu-margin='9'
145 2 schmelzs
</pre>
146 1 schmelzs
147 2 schmelzs
slxsettings provides through an extensive help (slxsettings --man), which summaries all Perl based SLX commands:
148 1 schmelzs
149 2 schmelzs
<pre>
150 1 schmelzs
SLXSETTINGS(1)        User Contributed Perl Documentation       SLXSETTINGS(1)
151 1 schmelzs
152 1 schmelzs
NAME
153 6 schmelzs
       slxsettings - OpenSLX-script to show & change local settings
154 1 schmelzs
155 1 schmelzs
SYNOPSIS
156 1 schmelzs
       slxsettings [options] [action ...]
157 1 schmelzs
158 1 schmelzs
       Script Actions
159 1 schmelzs
160 8 schmelzs
             set <option-name=value>    sets the option to the given value
161 8 schmelzs
             reset <option-name>        resets the given option to its default
162 1 schmelzs
163 1 schmelzs
       List of Known Option Names
164 1 schmelzs
165 8 schmelzs
             db-name=<string>           name of database
166 8 schmelzs
             db-spec=<string>           full DBI-specification of database
167 8 schmelzs
             db-type=<string>           type of database to connect to
168 1 schmelzs
             locale=<string>            locale to use for translations
169 1 schmelzs
             logfile=<string>           file to write logging output to
170 8 schmelzs
             private-path=<string>      path to private data
171 8 schmelzs
             public-path=<string>       path to public (client-accessible) data
172 8 schmelzs
             temp-path=<string>         path to temporary data
173 8 schmelzs
             verbose-level=<int>        level of logging verbosity (0-3)
174 1 schmelzs
175 1 schmelzs
       General Options
176 1 schmelzs
177 8 schmelzs
             --help                     brief help message
178 8 schmelzs
             --man                      full documentation
179 8 schmelzs
             --quiet                    do not print anything
180 8 schmelzs
             --version                  show version
181 1 schmelzs
       Actions
182 1 schmelzs
183 1 schmelzs
           set <openslx-option>=<value>
184 1 schmelzs
               sets the specified option to the given value
185 1 schmelzs
186 1 schmelzs
           reset <setting>
187 1 schmelzs
               removes the given setting from the local settings (resets it to
188 1 schmelzs
               its default value)
189 1 schmelzs
           ...
190 2 schmelzs
</pre>
191 1 schmelzs
192 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.
193 1 schmelzs
194 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:
195 1 schmelzs
196 2 schmelzs
<pre>
197 1 schmelzs
x60s:~ # slxsettings set public-path='/data/openslx'
198 1 schmelzs
setting public-path to '/data/openslx'
199 1 schmelzs
x60s:~ # slxsettings set mirrors-preferred-top-level-domain=de
200 1 schmelzs
setting mirrors-preferred-top-level-domain to 'de'
201 2 schmelzs
</pre>
202 1 schmelzs
203 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.
204 1 schmelzs
205 2 schmelzs
<pre>
206 1 schmelzs
x60s:~ # slxsettings set db-type=SQLite
207 1 schmelzs
setting db-type to 'SQLite'
208 2 schmelzs
</pre>
209 1 schmelzs
210 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 
211 1 schmelzs
or Stage1.
212 1 schmelzs
213 1 schmelzs
You will find the settings in /etc/opt/openslx/settings:
214 2 schmelzs
<pre>
215 1 schmelzs
SLX_DB_TYPE=SQLite
216 1 schmelzs
SLX_MIRRORS_PREFERRED_TOP_LEVEL_DOMAIN=de
217 1 schmelzs
SLX_PUBLIC_PATH=/data/openslx
218 1 schmelzs
219 2 schmelzs
</pre>
220 1 schmelzs
221 2 schmelzs
h2. Stage1 from Network Sources or reference machines
222 1 schmelzs
223 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":
224 1 schmelzs
225 2 schmelzs
<pre>
226 1 schmelzs
x60s:~ # slxos-setup list-supported
227 1 schmelzs
        gentoo-2007.X           (clone)
228 1 schmelzs
        suse-10.2               (clone,install)
229 1 schmelzs
        suse-10.2_x86_64        (clone,install)
230 1 schmelzs
        suse-10.3               (clone)
231 1 schmelzs
        suse-10.3_x86_64        (clone)
232 1 schmelzs
        suse-11.0               (clone,install)
233 1 schmelzs
        suse-11.0_x86_64        (clone,install)
234 1 schmelzs
        ubuntu-8.04             (clone,install)
235 1 schmelzs
        ubuntu-8.04_amd64       (clone,install)
236 2 schmelzs
</pre>
237 1 schmelzs
238 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 
239 1 schmelzs
distribution:
240 1 schmelzs
241 2 schmelzs
<pre>
242 1 schmelzs
x60s:~ # slxos-setup install suse-11.0
243 1 schmelzs
[ ... lots of yum output ... ]
244 1 schmelzs
Total download size: 69 k
245 1 schmelzs
Downloading Packages:
246 1 schmelzs
(1/2): nbd-2.8.7-14.i586. 100% |=========================|  45 kB    00:00
247 1 schmelzs
(2/2): squashfs-kmp-defau 100% |=========================|  24 kB    00:00
248 1 schmelzs
Running Transaction Test
249 1 schmelzs
Finished Transaction Test
250 1 schmelzs
Transaction Test Succeeded
251 1 schmelzs
Running Transaction
252 1 schmelzs
  Installing: squashfs-kmp-default         ######################### [1/2]
253 1 schmelzs
  Installing: nbd                          ######################### [2/2]
254 1 schmelzs
255 1 schmelzs
Installed: nbd.i586 0:2.8.7-14 squashfs-kmp-default.i586 0:3.1_2.6.18.2_34-34
256 1 schmelzs
Complete!
257 1 schmelzs
Starting SuSEconfig, the SuSE Configuration Tool...
258 1 schmelzs
Running in full featured mode.
259 1 schmelzs
Reading /etc/sysconfig and updating the system...
260 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.perl...
261 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.permissions...
262 1 schmelzs
Finished.
263 1 schmelzs
Vendor-OS 'suse-11.0' installed succesfully.
264 1 schmelzs
Vendor-OS 'suse-11.0' has been added to DB (ID=1).
265 2 schmelzs
</pre>
266 1 schmelzs
267 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.
268 1 schmelzs
269 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.
270 1 schmelzs
271 2 schmelzs
<pre>
272 1 schmelzs
x60s:~ # slxos-setup clone 10.60.4.50:/ suse-11.0-mysystem
273 1 schmelzs
Cloning vendor-OS from '10.60.4.50:/' to '/space/stage1/suse-11.0-mysystem'...
274 1 schmelzs
Password: 
275 1 schmelzs
receiving file list ...
276 1 schmelzs
...
277 1 schmelzs
var/yp/
278 1 schmelzs
var/yp/nicknames
279 1 schmelzs
var/yp/binding/
280 1 schmelzs
281 1 schmelzs
sent 5765235 bytes  received 6044617832 bytes  5710602.23 bytes/sec
282 1 schmelzs
total size is 6025777602  speedup is 1.00
283 1 schmelzs
Vendor-OS 'suse-11.0-mysystem' has been cloned successfully.
284 1 schmelzs
Vendor-OS 'suse-11.0-mysystem' has been added to DB (ID=3).
285 2 schmelzs
</pre>
286 1 schmelzs
287 1 schmelzs
288 1 schmelzs
The subcommand "list-installed" shows you all existing Stage1-Systems:
289 2 schmelzs
290 2 schmelzs
<pre>
291 1 schmelzs
x60s:~ # slxos-setup list-installed
292 1 schmelzs
List of installed vendor-OSes:
293 1 schmelzs
        suse-11.0-mysystem
294 1 schmelzs
        suse-10.3
295 2 schmelzs
</pre>
296 1 schmelzs
297 12 dvs
h2. Plug-ins - Modular Extension of the Base Package
298 1 schmelzs
299 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 
300 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.
301 1 schmelzs
302 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:
303 2 schmelzs
304 2 schmelzs
<pre>
305 1 schmelzs
x60s:~ # slxos-plugin install suse-11.0 desktop manager=kdm
306 1 schmelzs
Plugin desktop has been installed into vendor-OS 'suse-11.0'.
307 1 schmelzs
x60s:~ # slxos-plugin install ubuntu-8.04-clone xserver
308 1 schmelzs
Plugin xserver has been installed into vendor-OS 'suse-11.0'.
309 2 schmelzs
</pre>
310 1 schmelzs
311 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.
312 1 schmelzs
313 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.
314 1 schmelzs
315 2 schmelzs
h2. System Export
316 1 schmelzs
317 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:
318 1 schmelzs
319 2 schmelzs
<pre>
320 1 schmelzs
x60s:~ # slxos-export list-installed
321 1 schmelzs
List of installed vendor-OSes:
322 1 schmelzs
        suse-10.3-mysystem
323 1 schmelzs
        suse-11.0
324 2 schmelzs
</pre>
325 1 schmelzs
326 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:
327 1 schmelzs
328 2 schmelzs
<pre>
329 1 schmelzs
x60s:~ # slxos-export export suse-11.0-x60 sqfs-nbd
330 1 schmelzs
invoking mksquashfs...
331 1 schmelzs
Parallel mksquashfs: Using 1 processor
332 1 schmelzs
Creating little endian 3.0 filesystem on /data/openslx/export/sqfs/suse-11.0-x60
333 1 schmelzs
    block size 65536.
334 1 schmelzs
[===========================================================] 294751/294751 100%
335 1 schmelzs
[ ... ]
336 1 schmelzs
Filesystem size 2325395.23 Kbytes (2270.89 Mbytes)
337 1 schmelzs
        41.13% of uncompressed filesystem size (5654449.42 Kbytes)
338 1 schmelzs
Inode table size 2888177 bytes (2820.49 Kbytes)
339 1 schmelzs
        30.34% of uncompressed inode table size (9518178 bytes)
340 1 schmelzs
Directory table size 2735640 bytes (2671.52 Kbytes)
341 1 schmelzs
        47.98% of uncompressed directory table size (5701677 bytes)
342 1 schmelzs
[ ... ]
343 1 schmelzs
vendor-OS '/data/openslx/stage1/suse-11.0-x60' successfully exported to '/data/openslx/export/sqfs/suse-11.0-x60'!
344 1 schmelzs
Export 'suse-11.0-x60:sqfs-nbd' has been added to DB (ID=1)...
345 1 schmelzs
################################################################################
346 1 schmelzs
Please make sure you start a corresponding nbd-server:
347 1 schmelzs
        nbd-server 5000 /data/openslx/export/sqfs/suse-11.0-x60 -r
348 1 schmelzs
################################################################################
349 1 schmelzs
system 'suse-11.0-x60:sqfs-nbd' has been successfully added to DB (ID=1)
350 2 schmelzs
</pre>
351 1 schmelzs
352 1 schmelzs
A classic NFS Rootfilesystem can be created through a similar call:
353 1 schmelzs
354 2 schmelzs
<pre>
355 1 schmelzs
x60s:~ # slxos-export export suse-11.0 nfs
356 1 schmelzs
building file list ...
357 1 schmelzs
...
358 2 schmelzs
... rsync output ...
359 1 schmelzs
...
360 1 schmelzs
sent 5642940230 bytes  received 5681918 bytes  9147566.23 bytes/sec
361 1 schmelzs
total size is 5624419842  speedup is 1.00
362 1 schmelzs
vendor-OS '/data/openslx/stage1/suse-11.0-x60' successfully exported to 
363 1 schmelzs
 '/data/export/nfs/suse-11.0'!
364 1 schmelzs
Export 'suse-11.0-nfs' has been added to DB (ID=1)...
365 1 schmelzs
################################################################################
366 1 schmelzs
Please make sure the following line is contained in /etc/exports
367 1 schmelzs
in order to activate the NFS-export of this vendor-OS:
368 1 schmelzs
        /data/export/nfs/suse-11.0  *(ro,no_root_squash,async,no_subtree_check)
369 1 schmelzs
################################################################################
370 1 schmelzs
system 'suse-11.0-nfs' has been successfully added to DB (ID=1)
371 2 schmelzs
</pre>
372 1 schmelzs
373 2 schmelzs
Afterwards you can ensure that everything has worked through calling "slxos-export list-exported".
374 1 schmelzs
375 1 schmelzs
376 12 dvs
h2. Quick Start
377 1 schmelzs
378 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. 
379 1 schmelzs
380 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.
381 1 schmelzs
382 2 schmelzs
Your ISC-DHCP-Server should be running and the following two entries for the domain from which you want to boot stateless:
383 1 schmelzs
384 2 schmelzs
<pre>
385 1 schmelzs
next-server 10.8.4.254;
386 14 dvs
filename "pxelinux.0";
387 2 schmelzs
</pre>
388 1 schmelzs
389 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.
390 1 schmelzs
391 1 schmelzs
392 12 dvs
h2. Database and the Boot Setup
393 1 schmelzs
394 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.
395 1 schmelzs
396 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:
397 1 schmelzs
398 2 schmelzs
<pre>
399 1 schmelzs
x60s:~ # slxconfig list-vendoros
400 1 schmelzs
List of the matching vendor-OSes:
401 1 schmelzs
        suse-10.3-mysystem
402 1 schmelzs
	suse-11.0
403 1 schmelzs
x60s:~ # slxconfig list-export
404 1 schmelzs
List of the matching exports:
405 1 schmelzs
        suse-10.3-mysystem        (nfs)
406 1 schmelzs
	suse-11.0:sqfs-nbd        (sqfs-nbd)
407 2 schmelzs
</pre>
408 1 schmelzs
409 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:
410 1 schmelzs
411 2 schmelzs
<pre>
412 1 schmelzs
x60s:~ # slxconfig list-systems
413 1 schmelzs
List of systems:
414 1 schmelzs
        <<<default>>>
415 1 schmelzs
        suse-10.3-mysystem:nfs
416 1 schmelzs
	suse-11.0:sqfs-nbd
417 2 schmelzs
</pre>
418 1 schmelzs
419 1 schmelzs
now displays
420 1 schmelzs
421 2 schmelzs
<pre>
422 1 schmelzs
x60s:~ # slxconfig add-client slx-test01 mac=00:01:02:03:04:06
423 1 schmelzs
client 'slx-test01' has been successfully added to DB (ID=1)
424 1 schmelzs
x60s:~ # slxconfig add-client slx-test02 mac=00:11:22:33:44:55
425 1 schmelzs
client 'slx-test02' has been successfully added to DB (ID=2)
426 2 schmelzs
</pre>
427 1 schmelzs
428 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:
429 1 schmelzs
430 2 schmelzs
<pre>
431 1 schmelzs
x60s:~ # slxconfig change-system suse-11.0:sqfs-nbd country=de
432 2 schmelzs
</pre>
433 1 schmelzs
434 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.
435 1 schmelzs
436 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.
437 1 schmelzs
438 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:
439 2 schmelzs
* Kernel, -modules come from Stage1, the respective Vender-OS from which an export was created
440 2 schmelzs
* The base configuration, the InitRamFS setup, for the created InitRamFS will be generated from the database. Entries can be edited with slxconfig.
441 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.
442 1 schmelzs
443 1 schmelzs
444 2 schmelzs
h2. Communication with the Database
445 1 schmelzs
446 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.
447 1 schmelzs
448 3 schmelzs
In the last section you entered single clients into the database. You can see all set variables with:
449 1 schmelzs
450 3 schmelzs
<pre>
451 1 schmelzs
x60s:~ # slxconfig --verbose list-system name="<system>"
452 1 schmelzs
List of systems:
453 1 schmelzs
system 'suse-11.0-main:nfs':
454 1 schmelzs
    clients       = <<<default>>>
455 1 schmelzs
    comment       = -
456 1 schmelzs
    description   = -
457 1 schmelzs
    export_id     = 6 (suse-11.0-main:nfs)
458 1 schmelzs
    hidden        = -
459 1 schmelzs
    id            = 5
460 1 schmelzs
    kernel        = vmlinuz
461 1 schmelzs
    kernel_params = aufs vga=0x317 quiet
462 1 schmelzs
    label         = suse-11.0-main:nfs
463 1 schmelzs
  PLUGINS:
464 1 schmelzs
    30...Theme
465 1 schmelzs
    50...VMware
466 1 schmelzs
  ATTRIBUTES:
467 1 schmelzs
    country       = de
468 1 schmelzs
    ramfs_fsmods  = aufs
469 1 schmelzs
    ramfs_nicmods = forcedeth e1000 e100 tg3 r8169 pcnet32 b44 8139too
470 1 schmelzs
    slxgrp        = default
471 1 schmelzs
    start_cron    = yes
472 1 schmelzs
    start_dreshal = yes
473 1 schmelzs
    start_nfsv4   = yes
474 1 schmelzs
    start_ntp     = yes
475 1 schmelzs
    start_sshd    = yes
476 1 schmelzs
    start_x       = yes
477 1 schmelzs
    start_xdmcp   = kdm
478 1 schmelzs
    theme::name   = openslx
479 1 schmelzs
    vmware        = nfs://10.4.6.1/vol/vmwareImages/vmware
480 3 schmelzs
</pre>
481 1 schmelzs
482 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:
483 1 schmelzs
484 3 schmelzs
<pre>
485 1 schmelzs
x60s:~ # slxconfig change-system "<<<default>>>" start_xdmcp=gdm
486 1 schmelzs
system '<<<default>>>' has been successfully changed.
487 3 schmelzs
</pre>
488 1 schmelzs
489 3 schmelzs
This configuration ensures that all cloned SuSE-11.0 clients start with the Default-Splash with the resolution 1024x768:
490 3 schmelzs
491 3 schmelzs
<pre>
492 1 schmelzs
x60s:~ # slxconfig change-system suse-10.3-mysystem:sqfs-nbd \
493 1 schmelzs
kernel_params="vga=0x317 quiet"
494 3 schmelzs
</pre>
495 1 schmelzs
496 3 schmelzs
The following database entry is needed if the home directory of the user is not prepared the secure NFSv3 way:
497 1 schmelzs
% predicted to be in plug-in
498 3 schmelzs
499 3 schmelzs
<pre>
500 1 schmelzs
x60s:~ # slxconfig change-system suse-10.3-mysystem:sqfs-nbd automnt_dir=/home 
501 1 schmelzs
automnt_src="nfs://11.00.4.2/home"
502 3 schmelzs
</pre>
503 1 schmelzs
504 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:
505 1 schmelzs
506 3 schmelzs
<pre>
507 3 schmelzs
x60s:~ # slxconfig change-export suse-10.3-main::sqfs-nbd server_ip=10.30.4.4 port=5002
508 1 schmelzs
export 'suse-10.3-main::sqfs-nbd' has been successfully changed
509 1 schmelzs
x60s:~ # slxconfig list-export suse-10.3-main::sqfs-nbd
510 1 schmelzs
List of exports:
511 1 schmelzs
export 'suse-10.3-main::sqfs-nbd':
512 1 schmelzs
    comment      = -
513 1 schmelzs
    id           = 10
514 1 schmelzs
    port         = 5002
515 1 schmelzs
    server_ip    = 10.30.4.4
516 1 schmelzs
    type         = sqfs-nbd
517 1 schmelzs
    uri          = -
518 1 schmelzs
    vendor_os_id = 7 (suse-10.3-main)
519 1 schmelzs
520 1 schmelzs
x60s:~ # slxconfig change-system suse-11.0-clone::nfs \
521 1 schmelzs
  scratch="nfs://10.8.4.2/data/export/tmp"
522 3 schmelzs
</pre>
523 1 schmelzs
524 1 schmelzs
525 3 schmelzs
h2. System-Update and Extension
526 1 schmelzs
527 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:
528 1 schmelzs
529 3 schmelzs
<pre>
530 1 schmelzs
x60s:~ # slxos-setup update suse-11.0-kde
531 1 schmelzs
Setting up Update Process
532 1 schmelzs
Setting up repositories
533 1 schmelzs
base_non-oss              100% |=========================|  951 B    00:00
534 1 schmelzs
base                      100% |=========================|  951 B    00:00
535 1 schmelzs
base_update               100% |=========================| 1.2 kB    00:00
536 1 schmelzs
Reading repository metadata in from local files
537 1 schmelzs
primary.xml.gz            100% |=========================| 548 kB    00:00
538 1 schmelzs
################################################## 1340/1340
539 1 schmelzs
Resolving Dependencies
540 1 schmelzs
[ ... etliche weitere Ausgaben ... ]
541 1 schmelzs
Starting SuSEconfig, the SuSE Configuration Tool...
542 1 schmelzs
Running in full featured mode.
543 1 schmelzs
Reading /etc/sysconfig and updating the system...
544 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.perl...
545 1 schmelzs
Executing /sbin/conf.d/SuSEconfig.permissions...
546 1 schmelzs
Finished.
547 1 schmelzs
Vendor-OS 'suse-11.0-kde' updated succesfully.
548 1 schmelzs
549 1 schmelzs
The update of a clone system is performed on the reference machine in 
550 1 schmelzs
the so called Stage0. After this you call 
551 1 schmelzs
"slxos-setup clone 11.00.4.50:/ suse-10.3-mysystem":
552 1 schmelzs
553 1 schmelzs
Vendor-OS 'suse-10.3-mysystem' has been re-cloned successfully. 
554 1 schmelzs
No need to change vendor-OS 'suse-10.3-mysystem' in OpenSLX-database.
555 3 schmelzs
</pre>
556 1 schmelzs
557 1 schmelzs
558 3 schmelzs
<pre>
559 1 schmelzs
x60s:~ # slxos-setup clone 0.20.4.50:/ suse-10.3-mysystem
560 1 schmelzs
building file list ...
561 1 schmelzs
[ ... etliche weitere Ausgaben ... ]
562 1 schmelzs
sent 434920 bytes  received 121491994 bytes  375737.79 bytes/sec
563 1 schmelzs
total size is 8644862874  speedup is 70.90
564 1 schmelzs
Vendor-OS 'suse-10.3-mysystem' has been cloned successfully.
565 1 schmelzs
No need to change vendor-OS 'suse-10.3-mysystem' in OpenSLX-database.
566 3 schmelzs
</pre>
567 1 schmelzs
568 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.
569 1 schmelzs
570 1 schmelzs
571 3 schmelzs
h2. Cleanup
572 1 schmelzs
573 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:
574 1 schmelzs
575 3 schmelzs
<pre>
576 1 schmelzs
x60s:~ # slxconfig remove suse-11.0
577 1 schmelzs
removing vendor-OS folder '/data/openslx/stage1/suse-11.0'...
578 1 schmelzs
Vendor-OS 'suse-11.0' removed successfully.
579 1 schmelzs
Vendor-OS 'suse-11.0' has been removed from DB!
580 3 schmelzs
</pre>
581 1 schmelzs
582 3 schmelzs
The removal of systems from the ~/tftpboot area occurs with a recall of slxconfig-demuxer.
583 1 schmelzs
584 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.
585 1 schmelzs
586 1 schmelzs
% change!!
587 3 schmelzs
<pre>
588 1 schmelzs
x60s:~ # slxos-export remove suse-11.0 nbd
589 1 schmelzs
export '/srv/openslx/export/nbd-squash/suse-11.0' successfully removed!
590 1 schmelzs
Export 'suse-11.0' has been removed from DB.
591 3 schmelzs
</pre>
592 3 schmelzs
<pre>
593 1 schmelzs
594 1 schmelzs
x60s:~ # slxos-export remove suse-11.0
595 1 schmelzs
export '/srv/openslx/export/nfs/suse-11.0' successfully removed!
596 1 schmelzs
Export 'suse-11.0' has been removed from DB.
597 3 schmelzs
</pre>
598 1 schmelzs
599 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.
600 1 schmelzs
601 3 schmelzs
<pre>
602 1 schmelzs
x60s:~ # slxos-setup remove suse-11.0
603 1 schmelzs
Vendor-OS 'suse-11.0' removed succesfully.
604 1 schmelzs
Vendor-OS 'suse-11.0' has been removed from DB!
605 3 schmelzs
</pre>
606 1 schmelzs
607 1 schmelzs
608 3 schmelzs
h2. Boot Cycle
609 1 schmelzs
610 1 schmelzs
611 3 schmelzs
h3. PXE-Boot
612 1 schmelzs
613 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.
614 1 schmelzs
615 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.
616 1 schmelzs
617 1 schmelzs
618 3 schmelzs
h3. DHCP for the IP-Address assignment
619 1 schmelzs
620 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:
621 1 schmelzs
622 3 schmelzs
<pre>
623 1 schmelzs
ddns-update-style none;
624 1 schmelzs
subnet 10.8.4.0 netmask 255.255.255.0 {
625 1 schmelzs
  server-identifier 10.8.4.1;
626 1 schmelzs
  next-server 10.8.4.1;
627 14 dvs
  filename "pxelinux.0";
628 1 schmelzs
  option routers 10.8.4.254;
629 1 schmelzs
  range 10.8.4.101 10.8.4.200;
630 1 schmelzs
}
631 3 schmelzs
</pre>
632 1 schmelzs
633 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:
634 1 schmelzs
635 3 schmelzs
<pre>
636 1 schmelzs
DHCPD_INTERFACE="eth0"
637 1 schmelzs
DHCPD_RUN_CHROOTED="yes"
638 3 schmelzs
</pre>
639 1 schmelzs
640 1 schmelzs
641 3 schmelzs
h3. TFTP
642 1 schmelzs
643 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:
644 1 schmelzs
645 3 schmelzs
<pre>
646 1 schmelzs
tftpboot/client-config
647 1 schmelzs
tftpboot/client-config/suse-11.0-A
648 1 schmelzs
tftpboot/client-config/suse-11.0-A/01-<MAC>.tgz
649 1 schmelzs
tftpboot/client-config/suse-11.0-A/default.tgz
650 1 schmelzs
tftpboot/client-config/<system>/...
651 14 dvs
tftpboot
652 14 dvs
tftpboot/menu.c32
653 14 dvs
tftpboot/pxelinux.0
654 14 dvs
tftpboot/suse-11.0
655 14 dvs
tftpboot/suse-11.0/initramfs-1
656 14 dvs
tftpboot/suse-11.0/vmlinuz
657 14 dvs
tftpboot/<vendor-os>/...
658 14 dvs
tftpboot/...
659 3 schmelzs
</pre>
660 1 schmelzs
661 3 schmelzs
By default, the directory is located under /srv/openslx. Its location can be changed by using slxsettings --tftpboot-path=New-Dir.
662 1 schmelzs
663 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:
664 1 schmelzs
665 3 schmelzs
<pre>
666 1 schmelzs
service tftp
667 1 schmelzs
{
668 1 schmelzs
        socket_type             = dgram
669 1 schmelzs
        protocol                = udp
670 1 schmelzs
        wait                    = yes
671 1 schmelzs
        user                    = root
672 1 schmelzs
        server                  = /usr/sbin/in.tftpd
673 1 schmelzs
        server_args             = -s /tftpboot
674 1 schmelzs
        disable                 = yes
675 1 schmelzs
}
676 3 schmelzs
</pre>
677 1 schmelzs
678 14 dvs
The carried out settings for the directory need to match the settings of the OpenSLX package and DHCP server. The variable "filename" contains "pxelinux.0" (the prefix ist defined via the "server_args"), this file should be delivered to the requesting PXE-Clients.
679 1 schmelzs
680 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.
681 1 schmelzs
682 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:
683 1 schmelzs
684 3 schmelzs
<pre>
685 1 schmelzs
dirk@x60s:/tmp> tftp 10.8.4.254
686 1 schmelzs
tftp> get /tftpboot/pxe/pxelinux.0
687 1 schmelzs
tftp> quit
688 1 schmelzs
dirk@x60s:/tmp> ls -la pxelinux.0
689 1 schmelzs
-rw-r--r-- 1 dirk users 13320 2007-04-20 16:10 pxelinux.0
690 3 schmelzs
</pre>
691 1 schmelzs
692 3 schmelzs
h3. Syslinux
693 1 schmelzs
694 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.
695 1 schmelzs
696 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:
697 1 schmelzs
698 3 schmelzs
<pre>
699 1 schmelzs
NOESCAPE 0
700 1 schmelzs
PROMPT 0
701 1 schmelzs
TIMEOUT 10
702 1 schmelzs
DEFAULT menu.c32
703 1 schmelzs
IMPLICIT 1
704 1 schmelzs
ALLOWOPTIONS 1
705 1 schmelzs
MENU TITLE What would you like to do (Selection using cursor)?
706 1 schmelzs
MENU MASTER PASSWD secret
707 1 schmelzs
LABEL memtest
708 1 schmelzs
  KERNEL memtest.bin
709 3 schmelzs
</pre>
710 1 schmelzs
711 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.
712 1 schmelzs
713 3 schmelzs
<pre>
714 1 schmelzs
prompt 1
715 1 schmelzs
timeout 100
716 1 schmelzs
default dxs
717 1 schmelzs
label dxs
718 1 schmelzs
  kernel dxs
719 1 schmelzs
  append vga=normal initrd=initrd-dxs nfsserver=10.30.4.1:/nfsroot/ldc
720 1 schmelzs
  ipappend 1
721 1 schmelzs
label memtest
722 1 schmelzs
  kernel memtest.bin
723 3 schmelzs
</pre>
724 1 schmelzs
725 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:
726 1 schmelzs
727 3 schmelzs
<pre>
728 1 schmelzs
cp /boot/vmlinuz /nfsroot/ldc/boot/kernel-dxs
729 1 schmelzs
cp /boot/initrd(.img) /nfsroot/ldc/boot/initrd-dxs
730 3 schmelzs
</pre>
731 1 schmelzs
732 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":
733 1 schmelzs
734 3 schmelzs
<pre>
735 1 schmelzs
ip=11.00.40.2:11.00.40.71:11.00.40.254:255.255.255.0
736 3 schmelzs
</pre>
737 1 schmelzs
738 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.
739 1 schmelzs
740 1 schmelzs
Image: vmware-normalinitrd.png
741 1 schmelzs
742 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.
743 1 schmelzs
744 1 schmelzs
745 3 schmelzs
h3. Configuration of OpenSLX Clients
746 1 schmelzs
747 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:
748 1 schmelzs
749 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.
750 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.
751 3 schmelzs
# After this an extended configuration within Stage3, depending on the specified configuration start, is available.
752 3 schmelzs
# Then the Stage3 scripts read the loaded configuration and create the majority of the settings for Stage4.
753 1 schmelzs
754 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.
755 1 schmelzs
756 1 schmelzs
757 3 schmelzs
h3. The Kernel Command line
758 1 schmelzs
759 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.
760 1 schmelzs
761 3 schmelzs
* debug - without specifying a level, the debug level is set to 1
762 3 schmelzs
* debug=* - sets the debug level on the specified integer value. For a listing of all debug levels see appendix E.2
763 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.
764 3 schmelzs
* ldap=* - use LDAP for configuration (URI Syntax)
765 3 schmelzs
* file - use TFTP to acquired configuration files
766 3 schmelzs
* file=* - use TFTP take the specified TFTP Server and path (URI Syntax)
767 3 schmelzs
* ldsc - do not generate ld.so.cache and overtaken by existing3 from Stage2.
768 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.
769 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.
770 3 schmelzs
* ip=* - is populated through PXE-Linuxor Etherboot/gPXE.
771 3 schmelzs
* tmpfssize=* - size of the maximum temporary memory in RAM (tmpfs)
772 3 schmelzs
* vci=* - Vendor Code Identifier, only needed if DHCP is used.
773 3 schmelzs
774 3 schmelzs
h3. Central Configuration File machine-setup
775 3 schmelzs
776 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 
777 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.
778 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.
779 3 schmelzs
780 3 schmelzs
Currently there are three (four) configuration possibilities, even if they aren't all implemented:
781 3 schmelzs
Via TFTP (configuration plus extension - ConfTGZ)
782 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.
783 3 schmelzs
The files are obtained at the start of the Services-Configuration (servconfig), so could possibly be modified.
784 1 schmelzs
Files can be specified explicitly: 
785 1 schmelzs
"file=tftp://<server-ip>/pxe/client-config/<system-name>/01-00-11-43-7c-da-ff.tgz" 
786 1 schmelzs
or should be present under a certain schema.
787 1 schmelzs
788 1 schmelzs
For this reason, if problems arise, you should test the client first 
789 1 schmelzs
to see if the command line is populated with all options.
790 1 schmelzs
791 3 schmelzs
<pre>
792 1 schmelzs
apt-get  install libdbd-sqlite3-perl sqlite3
793 3 schmelzs
</pre>
794 1 schmelzs
795 3 schmelzs
h2. Problems
796 1 schmelzs
797 1 schmelzs
<pre>
798 1 schmelzs
slxconfig-demuxer  --verbose-level=2
799 1 schmelzs
800 1 schmelzs
slxos-setup remove suse-11.0-x86_64
801 1 schmelzs
removing vendor-OS folder '/var/opt/openslx/stage1/suse-11.0-x86_64'...
802 1 schmelzs
Vendor-OS 'suse-11.0-x86_64' removed successfully.
803 3 schmelzs
</pre>
804 10 dvs
805 10 dvs
h2. Further Development
806 10 dvs
807 10 dvs
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.
808 10 dvs
809 10 dvs
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.