3. Installing FAI

3.1. Requirements

The following items are required for an installation via FAI.

A computer
The computer must have a network interface card [3]. Unless a diskless installation should be performed a local hard disk is also needed. No floppy disk, CD-ROM, keyboard or graphics adapter is needed.
DHCP server
The clients need one of these daemons to obtain boot information.
TFTP server
The TFTP daemon is used for transferring the kernel to the clients. It's only needed when booting from network card with a boot PROM.
NFS-Root
It is a directory which contains the whole file system for the install clients during installation. It must be exported via NFS, so the install clients can mount it. It will be created during the setup of the FAI package and is also called nfsroot.
Debian mirror
Access to a Debian mirror is needed. A local mirror of all Debian packages or an apt-proxy(8) is recommended if you install several computers.
Configuration space
This directory tree, which contains the configuration data, is mounted via NFS by default. But you can also get this directory from a revision control system like CVS, subversion or Git.

The NFS server will be enabled automatically when installing the fai-server package.

3.2. How to create a local Debian mirror

The script mkdebmirror [4] can be used for creating your own local Debian mirror. This script uses the script debmirror(1). A partial Debian mirror only for i386 architecture for Debian 5.0 (aka lenny) without the source packages needs about 22GB of disk space. Accessing the mirror via HTTP will be the default way in most cases. To see more output from the script call mkdebmirror -v. A root account is not necessary to create and maintain the Debian mirror.

You can use the command fai-mirror(1) for creating a partial mirror that only contains the software packages that are used in the classes in your configuration space. A partial mirror containing all package for the simple examples from the package fai-doc will only need about 440MB of disk space.

To use HTTP access to the local Debian mirror, install a web server and create a symlink to the local directory where your mirror is located:

faiserver# apt-get install apache2
faiserver# ln -s /files/scratch/debmirror /var/www/debmirror

Create a file sources.list(5) in /etc/fai/apt which gives access to your Debian mirror. An example can be found in /usr/share/doc/fai-doc/examples/etc. Also add the IP-address of the HTTP server to the variable $NFSROOT_ETC_HOSTS in make-fai-nfsroot.conf when the install clients have no DNS access.

3.3. Setting up FAI

To setup a FAI install server you need at least the packages fai-server and fai-doc. The package fai-quickstart contains dependencies on all required packages for an install server. Do not install the package fai-nfsroot on a normal system. This package can only be installed inside the nfsroot.

If you would like to install all packages that are useful for a FAI install server, use the following command

# aptitude install fai-quickstart
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done

The following NEW packages will be installed:
  apt-move{a} dhcp3-server{a} fai-doc{a} fai-quickstart fai-server{a}
  genisoimage{a} inetutils-inetd{a} nfs-kernel-server{a}
  openssh-server{a} syslinux-common{a} tftpd-hpa{a}
0 packages upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 2593kB of archives. After unpacking 8561kB will be used.
Do you want to continue? [Y/n/?]

The configuration for the FAI package (not the configuration data for the install clients) is defined in fai.conf. Definitions that are only used for creating the nfsroot are located in make-fai-nfsroot.conf. Edit these files before calling fai-setup. These are important variables in make-fai-nfsroot.conf:

FAI_DEBOOTSTRAP
For building the nfsroot there's the command called debootstrap(8). It needs the location of a Debian mirror and the name of the distribution (etch, lenny, sid) for which the basic Debian system should be built.
NFSROOT_ETC_HOSTS
If you use HTTP or FTP access to the Debain mirror, add its IP-address and the name to this variable. For a Beowulf master node, add the name and IP-address of both networks to it. This variable is not needed when the clients have access to a DNS server.

These are important variables in fai.conf:

FAI_CONFIG_SRC

This variables described how to access the configuration space on the install clients. It's an Universal Resource Identifier (URI). Currently supported methods are:

  • nfs://host/path/to/exported/config The config space is mounted from host via NFS.
  • cvs[+ssh]://user@host/path/to/cvsroot module[=tag] The config space is received from a cvs checkout.
  • svn://user@host/svnpath The config space checked out from a subversion repository. Also supported are svn+file, svn+http, svn+ssh, svn+https and checkouts without a user name.
  • git://host/path The config space checked out from a git repository, host can be empty. Also supported is git+http.

If $FAI_CONFIG_SRC is undefined in fai.conf, then the default is to use an NFS mount from the fai install server onto the install client. It's the same as nfs://`hostname`/$FAI_CONFIGDIR with the host name determined on the install server. Remember that this directory must be exported to all install clients, so that all files can be read by root.

FAI_DEBMIRROR
If you have NFS access to your local Debian mirror, specify the remote file system. It will be mounted to $MNTPOINT, which must also be defined. It's not needed if you use access via FTP or HTTP.

A list of variables used by FAI can be found at http://faiwiki.informatik.uni-koeln.de/index.php/Variables.

The content of /etc/fai/apt/sources.list and $FAI_DEBMIRROR are used by the install server and also by the clients. If your install server has multiple network cards and different host names for each card (as for a Beowulf server), use the install server name which is known by the install clients.

FAI uses debootstrap(8) and apt-get(8) to create the nfsroot file system in /srv/fai/nfsroot. It needs about 380 of free disk space. After editing fai.conf and make-fai-nfsroot.conf call fai-setup.

faiserver[~]# fai-setup -v
Using configuration files from /etc/fai
Creating FAI nfsroot in /srv/fai/nfsroot/live/filesystem.dir.
By default it needs more than 380 MBytes disk space.
This may take a long time.
Creating base system using debootstrap version 1.0.10lenny1
Calling debootstrap lenny /srv/fai/nfsroot/live/filesystem.dir http://cdn.debian.net/debian
.
Creating base.tgz
.
Upgrading /srv/fai/nfsroot/live/filesystem.dir
.
nfs-common fai-nfsroot module-init-tools ssh rdate lshw portmap rsync lftp less dump reiserfsprogs e2fsprogs usbutils hwinfo psmisc pciutils hdparm smartmontools parted mdadm lvm2 dnsutils ntpdate dosfstools jove xfsprogs xfsdump procinfo dialog discover console-tools console-common iproute udev subversion liblinux-lvm-perl cfengine2 libapt-pkg-perl grub lilo read-edid linux-image-486 aufs-modules-2.6-486
install_packages: reading config files from directory /etc/fai
install_packages: read config file NFSROOT
.
.
`/etc/fai/NFSROOT' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/NFSROOT'
`/etc/fai/apt' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/apt'
`/etc/fai/apt/sources.list' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/apt/sources.list'
`/etc/fai/fai.conf' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/fai.conf'
`/etc/fai/live.conf' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/live.conf'
`/etc/fai/make-fai-nfsroot.conf' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/make-fai-nfsroot.conf'
`/etc/fai/menu.lst' -> `/srv/fai/nfsroot/live/filesystem.dir/etc/fai/menu.lst'
Shadow passwords are now on.
Removing `local diversion of /usr/sbin/update-initramfs to /usr/sbin/update-initramfs.distrib'
update-initramfs: Generating /boot/initrd.img-2.6.26-2-486
W: mdadm: unchecked configuration file: /etc/mdadm/mdadm.conf
W: mdadm: please read /usr/share/doc/mdadm/README.upgrading-2.5.3.gz .
W: mkconf: MD subsystem is not loaded, thus I cannot scan for arrays.
W: mdadm: failed to auto-generate temporary mdadm.conf file.
W: mdadm: no configuration file available.
`/srv/fai/nfsroot/live/filesystem.dir/boot/vmlinuz-2.6.26-2-486' -> `/srv/tftp/fai/vmlinuz-2.6.26-2-486'
`/srv/fai/nfsroot/live/filesystem.dir/boot/initrd.img-2.6.26-2-486' -> `/srv/tftp/fai/initrd.img-2.6.26-2-486'
DHCP environment prepared. If you want to use it, you have to enable the dhcpd and the tftp-hpa daemon.
Removing `local diversion of /sbin/discover-modprobe to /sbin/discover-modprobe.distrib'
make-fai-nfsroot finished properly.    <=== *
No diversion `any diversion of /sbin/discover-modprobe', none removed
Log file written to /var/log/fai/make-fai-nfsroot.log
Re-exporting directories for NFS kernel daemon....

   You have no FAI configuration space yet. Copy the simple examples with:
   cp -a /usr/share/doc/fai-doc/examples/simple/* /srv/fai/config
   Then change the configuration files to meet your local needs.
Please don't forget to fill out the FAI questionnaire after you've finished your project with FAI.

FAI setup finished.                    <=== *
Log file written to /var/log/fai/fai-setup.log

A complete example of fai-setup.log is available on the FAI web page. It's important that you find both lines that are marked with an asterisk in your output. Otherwise something went wrong. If you'll get a lot of blank lines, it's likely that you are using konsole, the X terminal emulation for KDE which has a bug. Try again using xterm.

The warning messages from dpkg about dependency problems can be ignored. If you have problems running fai-setup, they usually stem from make-fai-nfsroot(8). Adding -v gives you a more verbose output which may help you pinpoint the error. The output is written to /var/log/fai/make-fai-nfsroot.log. It may help to enter the chroot environment manually using this command.

faiserver# chroot /srv/fai/nfsroot/live/filesystem.dir

The setup routine adds some lines to /etc/exports to export the nfsroot and the configuration space to all hosts that belong to the netgroup faiclients. If you already export a parent directory of these directories, you may comment out these lines, since the kernel NFS server has problems exporting a directory and one of its subdirectories with different options.

All install clients must belong to this netgroup, in order to mount these directories successfully. Netgroups are defined in the file /etc/netgroup or in the corresponding NIS map. An example can be found in /usr/share/doc/fai-doc/examples/etc/netgroup. For more information, read the manual pages netgroup(5) and the NIS HOWTO. After changing the netgroups, the NFS server has to reload its configuration. Use the following command:

faiserver# /etc/init.d/nfs-kernel-server reload

The setup also creates the account fai (defined by $LOGUSER) if not already available. So you can add a user before calling fai-setup(8) using the command adduser(8) and use this as your local account for saving log files. The log files of all install clients are saved to the home directory of this account. If you boot from network card, you should change the primary group of this account, so this account has write permissions to /srv/tftp/fai in order to change the symbolic links to the kernel image which is booted by a client.

After that, FAI is installed successfully on your server, but has no configuration for the install clients. Start with the examples from /usr/share/doc/fai-doc/examples/simple/ using the copy command above and read [config]. Before you can set up a DHCP daemon, you should collect some network information of all your install clients. This is described in section [mac].

When you make changes to fai.conf, make-fai-nfsroot.conf the nfsroot has to be rebuilt by calling make-fai-nfsroot(8). If you only like to install a new kernel to the nfsroot add the flags -k or -K to make-fai-nfsroot. This will not recreate your nfsroot, but only updates your kernel and kernel modules inside the nfsroot or add additional packages into the nfsroot.

3.4. Troubleshooting the setup

The setup of FAI adds the fai account, exports file systems and calls make-fai-nfsroot(8). If you call make-fai-nfsroot -v you will see more messages. When using a local Debian mirror, it's important that the install server can mount this directory via NFS. If this mount fails, check /etc/exports and /etc/netgroup.



[3] If you install from USB stick or CD you do not need a network card

[4] You can find the script in /usr/share/doc/fai-doc/examples/utils/