Installation walkthrough: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
m (→‎single network interface: changed 2 slashes to stars (actual list))
Line 26: Line 26:
|-
|-
|ClientIP range
|ClientIP range
|192.168.42.128 - 192.168.62.239
|192.168.62.128 - 192.168.62.239
|-
|-
|}
|}

Revision as of 22:45, 26 February 2013

Introduction

Why 4.0? It comes with out-of-the-box support for multiple interfaces thanks to dracut.

Why this document? Installing FAI is very simple, but there are a couple of common pitfalls. So - before you attempt to use any of the fancy features (like splitting the FAI-server into multiple components, installing multiple operating systems, etc.) make sure you got the basics right. This will help you to get up to speed and this will help the mailing list to avoid answering the same common problems over and over again. ;) This document intentionally describes a full bare-bones installation and not just the 'interesting' parts in order to (hopefully) avoid any kind of trouble.

Important This document assumes you have a nice little subnet all for yourself which is separated physically or via a VLAN from any other network. If you don't then you MUST not configure the DHCP Server as described or else your colleagues and your network administrators WILL most definitely hate you.

This document assumes the following network configuration:

Type Value
Network 192.168.62.0 / 255.255.255.0
DNS-Server 192.168.68.2
DefaultRouter 192.168.62.2
Server (TFTP, NFS, FAI) 192.168.68.10
ClientIP range 192.168.62.128 - 192.168.62.239

operating system

initial install from CD-ROM

Debian Squeeze 6.0.7 (64bit)

- minimal installation
- sources: main + security (no contrib / non-free / volatile)
- no additional software collections

We only need a very minimal operating system. It is strongly suggested to start your first steps into the FAI world by installing a Debian FAI-Server and Debian Clients. (Server and client can be mixed however you like - but for starters let's stick to the simplest and best supported case. Installing a 64bit server is preferred because it makes installing 32bit clients a bit easier then installing 64bit clients from a 32bit server.)

upgrade to wheezy (for fai 4.x)

edit /etc/apt/sources.list

  • remove all sources relating to the installation CD/DVD
  • replace all occurrences of 'squeeze' with 'wheezy'
aptitude update
aptitude dist-upgrade
aptitude clean

post-install configuration

  • edit /etc/network/interfaces and configure a static ip address (makes remote login easier)
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 192.168.62.10
        netmask 255.255.255.0
        gateway 192.168.62.2

Install OpenSSH to access this machine remotely

aptitude install openssh-server

configure FAI server

install FAI software package

The current version as of 2013-02-26 is 4.0.6 (provided by debian repository and http://fai-project.org/download)

aptitude install fai-server fai-doc

configure DHCP daemon

#
# configuration file for ISC dhcpd for Debian
#

# MAKE SURE YOU ARE THE ONLY DHCP-SERVER OR USE YOUR SITE'S EXISTING DHCP-
# SERVER. THIS CONFIGURATION ~WILL~ MAKE AN EXISTING DHCP-CONFIG GO BOOM
# (Going boom early is good. It makes debugging easier.)

ddns-update-style none;
authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

subnet 192.168.62.0 netmask 255.255.255.0 {
	# network settings
	option domain-name         "installnet.invalid";
	option domain-name-servers 192.168.62.2;
	option routers             192.168.62.2;

	# client IP allocation
	range              192.168.62.128 192.168.62.239;
	default-lease-time 60;
	max-lease-time     720;

	# PXE boot server
	next-server 192.168.62.10;
	filename    "fai/pxelinux.0";
}

This config file is stripped down to a minimum. Simply allocate an ip address to whoever is asking. If you run into trouble check '/var/log/syslog'.

configure TFTP server

The installation default is for the tftp-daemon to run in 'standalone' mode. If the netstat output does not show 'in.tftpd' then you are using either a different tftp server or it is handled via inetd/xinetd. The server in itself will continue to work just fine, but you may have to check other config files for the configured tftp root directory.

netstat -anp|grep :69
udp        0      0 0.0.0.0:69              0.0.0.0:*                           29269/in.tftpd

This tftp server is running in standalone mode. Now let's check its configuration for the root directory:

cat /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
 
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="--secure"

Exactly where I like it to be. Another possible value would be '/var/lib/tftpboot'. There's nothing wrong with that, but you have to make sure that FAI is configured for the proper directory or the PXE-boot process will fail.

configure FAI itself

install GPG key for fai-project.org

gpg -a --recv-keys DC13E54EAB9B66FD; gpg -a --export DC13E54EAB9B66FD | apt-key add -

Please note: This is slightly different then the description on <http://fai-project.org/download/>.

create NFS directory layout, configure /etc/exports, setup log user

fai-setup
echo '/srv/fai/config 192.168.62.10/24(async,ro,no_subtree_check,no_root_squash)' >> /etc/exports
/etc/init.d/nfs-kernel-server restart

(One could use 'exportfs -r' instead of the restart, but I want to make sure that the NFS server is truly started.)

create minimal configspace directory layout

for dir in class disk_config package_config scripts ; do
  mkdir -p /srv/fai/config/$dir
done

(This is just enough to make the installation not fail due to missing directories - this will NOT produce a useable installation!)

generate a fai-client configuration for ALL clients

 fai-chboot -B -I default

(This ~will~ attempt to reinstall any PXE-booting client!)

testing the installation

The following minimal client configuration is assumed:

  • a CPU
  • enough RAM to start the installation (at least about 200MB??)
  • an empty disk containing at least 250MB of disk space
  • a network interface connected to the FAI install network
  • boot device order: disk, network

single network interface

the most basic of configurations

  • create a client with a single network interface connected to the fai network
  • boot the client

-> expected result: fai starts, but drops out into a 'root@(none):/#' prompt

possible problem sources: DHCP, TFTP, NFS

Please note: In previous 4.0 releases there was a problem were the FAI nfsroot did not properly configure NFSv4. The fai client mounted the nfsroot seemingly successfully but complained about missing file permissions. This is fixed now.

multiple network interface

Since FAI 4.0 / dracut-network supports netbooting with multiple network interface we're going to test that thoroughly. The main goal is to prove whether any given client can boot from the network regardless if the 'primary' or 'secondary' network interface is connected to the FAI install network. (Common failure symptoms are 'installation did not start' and 'Client hangs / times out during installation' )

  • add a second network interface to the client
  • connect second interface to somewhere different (It must NOT able to reach the fai install network!)
  • boot the client

-> expected result: fai starts after a long timeout, but drops out into a 'root@(none):/#' prompt

  • switch configured network interfaces with each other
  • boot the client

-> expected result: fai starts after a long timeout, but drops out into a 'root@(none):/#' prompt

  • configure both network interfaces so they can't reach the fai install network
  • boot the client

-> expected result: client does not PXE-boot

(Untested: Connect both interfaces to the FAI install network.)

accessing the config space

update the client config to use a config space

fai-chboot -B -I -u nfs://192.168.62.10/srv/fai/config default
  • Create a client with a single network interface connected to the fai network
  • boot the client

-> expected result: fai starts, and reports about actually starting the installation, but finally drops out into a 'root@(none):/#' prompt

possible problem sources: NFS

using a minimal disk layout

create and edit '/srv/fai/config/disk_config/DEFAULT'

# an extremely simple layout
#
disk_config disk1 disklabel:msdos
primary /      250      ext3  rw
  • reuse previous client
  • boot the client

-> expected result: fai does a complete installation and reboots the client afterwards

(Due to lack of configuration a dysfunctional client is installed. It must be manually terminated.)

test for LVM-related bugs

modify '/srv/fai/config/disk_config/DEFAULT'

# configure LVM
#
disk_config disk1 disklabel:msdos
primary -      250      - -

disk_config lvm
vg  vg_system   disk1.1
vg_system-root          /     100    ext4    rw
vg_system-var           /var  100    ext4    rw
  • create a new client or make sure the client performs a netboot
  • boot the client

-> expected result: fai stops installation because tar runs out of diskspace

  • reuse the previous client, make sure the client performs a netboot
  • boot the client

-> expected result: dracut finds a volume group and does NOT mount nfsroot

Solution:

  • modify client pxeboot configuration
fai-chboot -B -I -u nfs://192.168.62.10/srv/fai/config -k rd_NO_LVM default
  • reuse the previous client, make sure the client performs a netboot
  • boot the client

-> expected result: fai starts again, but stops with a 'FATAL ERROR'

Solution: No truly accepted solution. It's an unfixed bug in setup_storage. Inofficial patches against setup-storage are available.

Conclusion

Congratulations. Your FAI-server is now fully functional and you can start your own experiments.