[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ next ]


FAI Guide (Fully Automatic Installation)
Chapter 2 - Installing FAI


2.1 Requirements

The following items are required for an installation via FAI.

A computer:

The computer must have a network interface card. Unless a diskless installation should be performed a local hard disk is also needed. No floppy disk, CD-ROM, keyboard or graphic card is needed.

DHCP or BOOTP server:

The clients need one of these daemons to obtain boot information. But you can also put all this information onto the boot floppy.

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.

Client root:

It is a mountable directory which contains the whole filesystem for the install clients during installation. 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.

Install kernel:

A kernel image that supports the network card and mounts its root filesystem via NFS. The Debian package fai-kernels provides a default kernel for fai.

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.

The TFTP daemon and an NFS server will be enabled automatically when installing the FAI package. All clients must have a network card which is recognized by the install kernel.


2.2 How to create a local Debian mirror

The script mkdebmirror [3] can be used for creating your own local Debian mirror. This script uses the script debmirror(1) and rsync(1). A partial Debian mirror only for i386 architecture for Debian 3.1 (aka sarge) without the source packages needs about 9.0GB of disk space. Accessing the mirror via NFS will be the normal and fastest way in most cases. To see more output from the script call mkdebmirror --debug. 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 partitial mirror containing all package for the simplex examples from the package fai-doc will only need about 300MB 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:

     # apt-get install apache2
     # 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/examples/etc. Also add the IP-address of the HTTP server to the variable NFSROOT_ETC_HOSTS in /etc/fai/make-fai-nfsroot.conf when the install clients have no DNS access.


2.3 Setting up FAI

To setup a FAI install server you need at least the packages fai-server, fai-doc, fai-kernels. The package fai-quickstart contains dependencies on all required packages for an install server. Do not install the package fai-nfsroot on a normals 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 automatically installed:
       dhcp3-common dhcp3-server fai-client fai-doc fai-kernels fai-server 
       tftp-hpa tftpd-hpa 
     The following packages have been kept back:
       kernel-headers-2.6-686 
     The following NEW packages will be installed:
       dhcp3-common dhcp3-server fai-client fai-doc fai-kernels fai-quickstart 
       fai-server tftp-hpa tftpd-hpa 
     0 packages upgraded, 9 newly installed, 0 to remove and 1 not upgraded.
     Need to get 13.0MB of archives. After unpacking 17.9MB will be used.
     Do you want to continue? [Y/n/?]

The suggested packages for FAI are: ssh, debmirror, mknbi, apt-move, mkinitrd-cd, grub.

The configuration for the FAI package (not the configuration data for the install clients) is defined in /etc/fai/fai.conf. Definitions that are only used for creating the nfsroot are located in /etc/fai/make-fai-nfsroot.conf. Edit these files before calling fai-setup. These are important variables in /etc/fai/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 (woody, sarge, 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.

FAI_SOURCES_LIST

Now OPSOLETE and unsupported. Use the file /etc/fai/apt/sources.list instead.

KERNELPACKAGE

You must specify the software package - built with make-kpkg(8) - which includes the default kernel for booting the install clients. The Debian package fai-kernels contains the default install kernels which supports both the DHCP and BOOTP protocols.

NFSROOT_PACKAGES

This variable contains a list of additional software packages which will be added to the nfsroot.

FAI_BOOT

which of DHCP and/or BOOTP the server should create setups for (when make-fai-nfsroot is run). The default is to create the setup for both protocols.

These are important variables in /etc/fai/fai.conf:

FAI_LOCATION

This is the host name and the remote directory of the configuration space, which will be mounted via NFS. Its default value is /srv/fai/config but some like to use /home/fai/config or /var/fai/config. 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 filesystem. It will be mounted to $MNTPOINT, which must also be defined. It's not needed if you use access via FTP or HTTP.

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 hostnames for each card (as for a Beowulf server), use the install server name which is known by the install clients.

FAI uses apt-get(8) to create the nfsroot filesystem in /srv/fai/nfsroot. It needs about 230MB of free disk space. Before setting up FAI, you should get the program imggen,[4] if you like to boot from a 3Com network card. This executable converts netboot images created by mknbi-linux(8), so they can be booted by network cards from 3Com. Put that executable in your path (e.g. /usr/local/bin). After editing /etc/fai/fai.conf and /etc/fai/make-fai-nfsroot.conf call fai-setup.

     faiserver[~]# fai-setup 
     Creating FAI nfsroot can take a long time and will
     need more than 230MB disk space in /srv/fai/nfsroot.
     Creating nfsroot for sarge using debootstrap
     dpkg: base-passwd: dependency problems, but configuring anyway as you request:
      base-passwd depends on libc6 (>= 2.3.2.ds1-4); however:
       Package libc6 is not installed.
     dpkg: base-files: dependency problems, but configuring anyway as you request:
     .
     .
     .
     Creating base.tgz
     `/etc/fai/sources.list' -> `/srv/fai/nfsroot/etc/apt/sources.list'
     Upgrading /srv/fai/nfsroot
     Adding additional packages to /srv/fai/nfsroot:
     fai-nfsroot module-init-tools dhcp3-client ssh rdate lshw hwinfo portmap
     bootpc rsync wget rsh-client less dump reiserfsprogs usbutils
     psmisc pciutils hdparm smartmontools parted mdadm lvm2
     dnsutils ntpdate dosfstools cvs jove xfsprogs xfsdump
     sysutils dialog discover mdetect libnet-perl netcat libapt-pkg-perl
     grub lilo dmidecode hwtools read-edid
     Backing up any LVM2 metadata that may exist...done.
     Creating SSH2 RSA key; this may take some time ...
     Creating SSH2 DSA key; this may take some time ...
     Restarting OpenBSD Secure Shell server: sshd.
     Checking available versions of rmt, updating links in /etc/alternatives ...
     (You may modify the symlinks there yourself if desired - see `man ln'.)
     Updating rmt (/usr/sbin/rmt) to point to /usr/sbin/rmt-dump.
     Updating rmt.8.gz (/usr/share/man/man8/rmt.8.gz) to point to /usr/share/man/man8/rmt-dump.8.gz.
     Recovering jove files ... Done.
     Error : Temporary failure in name resolution
     `/etc/fai/fai.conf' -> `/srv/fai/nfsroot/etc/fai/fai.conf'
     `/etc/fai/make-fai-nfsroot.conf' -> `/srv/fai/nfsroot/etc/fai/make-fai-nfsroot.conf'
     `/etc/fai/menu.lst' -> `/srv/fai/nfsroot/etc/fai/menu.lst'
     `/etc/fai/sources.list' -> `/srv/fai/nfsroot/etc/fai/sources.list'
     Shadow passwords are now on.
     Kernel 2.6.16-fai-kernels installed into the nfsroot.
     DHCP environment prepared. If you want to use it, you have to enable the dhcpd and the tftp-hpa daemon.
     
     Image Creator for MBA ROMs v1.00
     Usage: imggen [OPTION] inputfile outputfile
       -a,	Add 3Com MBA/BootWare support
       -r,	Remove 3Com MBA/BootWare support from image file
       -i,	Show information on an image
       -h,	Help screen
     
     In filename: /srv/tftp/fai/installimage
     Out filename: /srv/tftp/fai/installimage_3com
     Adding MBA support...
     MBA support has been succesfully added 
     BOOTP environment prepared.
     Removing `diversion of /sbin/discover-modprobe to /sbin/discover-modprobe.distrib by fai'
     make-fai-nfsroot finished properly.     <= *
     Adding line to /etc/exports: /srv/fai/config 123.45.6.0/24(async,ro)
     Adding line to /etc/exports: /srv/fai/nfsroot 123.45.6.0/24(async,ro,no_root_squash)
     Re-exporting directories for NFS kernel daemon...done.
     You have no FAI configuration. Copy the simple examples with:
     cp -a /usr/share/doc/fai/examples/simple/* /srv/fai/config
     Then change the configuration files to meet your local needs.
     FAI setup finished.                     <= *

A complete log of fai-setup is available on the fai web page. It's important that you will see both lines that are marked with an asterisk. 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). You may restart it by calling 'make-fai-nfsroot -r' (recover). Adding '-v' gives you a more verbose output which may help you pinpoint the error. If you want to create a log file you may use

sudo /usr/sbin/make-fai-nfsroot -r -v 2>&1 | tee make-fai-nfsroot.log

It may help to enter the chroot environment manually

     sudo chroot /srv/fai/nfsroot

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 /etc/netgroup or in the corresponding NIS map. An example for the netgroup file can be found in /usr/share/doc/fai/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 one of the following commands, depending on which NFS server you are using:

     kueppers# /etc/init.d/nfs-kernel-server reload
     kueppers# /etc/init.d/nfs-user-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 Installation details, Chapter 6. Before you can set up a DHCP or BOOTP daemon, you should collect some network information of all your install clients. This is described in section Creating a boot floppy, Section 3.3.

When you make changes to /etc/fai/fai.conf, /etc/fai/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


2.3.1 Troubleshooting the setup

The setup of FAI adds the FAI account, exports filesystems 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. An example can be found in /usr/share/doc/fai/examples/etc/netgroup.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ next ]


FAI Guide (Fully Automatic Installation)

FAI Guide version 2.5.4, 20 april 2006 for FAI package version 2.10.1

Thomas Lange lange@informatik.uni-koeln.de