Chapter 5. Network Based Installation

Table of Contents

1. Boot Server
1.1. Introduction
1.2. Required Services on the Boot Server
1.3. Boot Server Configuration
2. Installation Server
2.1. SUSE Linux
2.2. SUSE Linux Enterprise Server
3. Configuration Server
3.1. HTTP Repository
3.2. NFS Repository
3.3. TFTP Repository

The installation method using AutoYaST provides a way to automatically and identically install groups of systems. The first step when preparing AutoYaST installations is deciding how you want the systems at your site to be installed. For example, the following scenario would be ideal to set up and perform automated installations:

Prerequisites:

1.  Boot Server

1.1. Introduction

The boot server is composed of DHCP or BOOTP and TFTP servers. In some cases the boot server has to be in the same network segment as the client due to the fact that DHCP or TFTP packets will not be forwarded across routers.

For administrative purposes, booting from a network card (NIC) is much more flexible than booting from a floppy or other types of media. In order to use this boot method, the client's NIC needs to have a boot PROM that is able to communicate with a DHCP or BOOTP server to receive configuration parameters such as network addresses and boot server location.

PXE (Pre-boot Execution Environment) is a protocol designed by Intel that allows computers to boot through the network. PXE is stored in the ROM of new generation network cards. When the computer boots up, the BIOS loads the PXE ROM in the memory and executes it. A menu can be displayed, allowing the computer to boot an operating system loaded through the network.

To install a client via Pre-Boot Execution Environment (PXE) you don't need a PXE server! PXE sends a BOOTP request to get an IP address and other network information and a bootloader program to the client. You can either use a BOOTP server or a DHCP and TFTP server.

Etherboot and netboot are capable of creating a PROM binary (which must still be programmed onto a PROM) and a corresponding "tagged" TFTP boot image which includes a kernel and the initial ramdisk (initrd).

Unlike a PXE ROM, which loads an intermediate network boot program, these other network booting solutions are designed to load a specially-marked Linux kernel directly. There are only three differences in the server configuration:

  • You don't need PXELinux at all.

  • In the DHCP configuration, the filename parameter contains the name of the client kernel file.

  • The client kernel file needs to be processed by the mknbi program to correctly recognized by the ROM.

One or two protocols (depending on how you set it up) are used to boot a machine off the network. The first, DHCP, is a protocol to allow hosts to automatically configure their network parameters from a server, and is commonly used on networks to make IP address allocation and network administration easier. You'll only need to set this up if you use Etherboot or PXE. The second, TFTP, is a stripped down FTP protocol, commonly used in boot loaders where a full FTP client would be too large. The server machine (Boot server) must run servers for at least TFTP, and DHCP too if you want to load an image off the network.

1.2. Required Services on the Boot Server

1.2.1. DHCP

Install the DHCP server from ISC (http://www.isc.org/) by using the package available in the SuSE distribution. Configure the DHCP server parameter in /etc/sysconfig/dhcpd and make sure you have a working configuration file /etc/dhcpd.conf.

Note that you'll need the Ethernet address of your client machine before you can use this DHCP configuration. There are several ways to get this information. If the client machine already has Linux installed, use ifconfig and look for the HWaddr value.

The PXE ROM will often show such information either in the configuration screen or during an attempt to boot from the network. If none of those work, use arpwatch or tcpdump on the server to watch the network packets from the client as the client tries to network boot.

1.2.2. TFTP

PXE requires a special TFTP server. Read /usr/share/doc/packages/syslinux/pxelinux.doc from the already mentioned syslinux package for details.

The INETD based TFTP server cannot reliably handle much more than 64 clients at a time! With more clients not all of them will get an answer from your TFTP and you will see syslog messages like this:

tftpd: read: Connection refused.
      

To overcome this problem you can use atftp which is available as a package. This TFTP server can run as stand-alone daemon.

The TFTP server directory /tftpboot should look like the following:

Example 5.1. Tftpboot directory contents

/tftpboot/initrd     
          pxelinux.0
          linux    
	

See next section for how to get the files linux and initrd.

1.3. Boot Server Configuration

1.3.1. Kernel and Initial Ramdisk

For network booting and other configurations, it is recommended to use the images available on the first SuSE CD-ROM in the directory boot/loader. The initial ramdisk (initrd) contains all kernel modules needed for successful installation. In special cases, you might need to build you own kernel or use special kernels available on the CD-ROM.

Copy the kernel image and the initial ramdisk to the TFTP directory (/tftpboot). Those files will be called from the configuration files of either PXE or GRUB.

1.3.2.  DHCP Configuration Examples

To allow the specification of the source media location when booting over the network, root-path options of DHCP can be used.

Example 5.2.  /etc/dhcpd.conf with the root-path option

subnet 192.168.1.0 netmask 255.255.255.0 
{
      range dynamic-bootp 192.168.1.100 192.168.1.110;
      option broadcast-address 192.168.1.255;
      option routers 192.168.1.1;
      filename "vmlinuz.nbi";
      option root-path "/tftpboot/CDs";
	
      next-server 192.168.1.1; 
}
	  

One more example shows how the DHCP server can send an image to the client, depending on the type of the requesting client (PXE or Etherboot).

Example 5.3.  DHCP server configuration with PXE and Etherboot options

ddns-update-style none;
allow bootp;
allow booting;


subnet 192.168.1.0 netmask 255.255.255.0 {
  range dynamic-bootp 192.168.1.100 192.168.1.110;
  option domain-name "cluster.suse.de";
  option routers 192.168.1.240;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.1.255;
  filename "vmlinuz-node.nbi";
  option root-path "/local/CD1";
}


group {
    next-server 192.168.1.240;
    use-host-decl-names on;

    host n1 {
        hardware ethernet 00:00:1c:b5:6e:71;
        fixed-address n1;
        if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
            filename "/tulip.lzpxe";
        } else if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {
            filename "/vmlinuz-node.nbi";
        }
    }
    host n2 {
        hardware ethernet 00:00:1c:b5:72:ea;
        fixed-address n2;
        if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
            filename "pxelinux.0";
        } else if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {
            filename "/vmlinuz-node.nbi";
        }
    }
}
	  
	  

1.3.3. Booting with PXE

PXE can load a program into the client's memory and start it (the bootloader). The bootloader then loads its configuration file via TFTP from the server defined in next-server in /etc/dhcpd.conf.

The bootloader configuration file determines whether a client boots from its local hard disk or over the network.

The following are example configuration files for both cases:

Example 5.4. Configuration file for PXELINUX net boot

default linux
serial 0,9600n8
label linux
  kernel linux
  append console=ttyS0,9800 console=tty0 load_ramdisk=1  initrd=initrd  autoyast=nfs://nfsserv/file.xml
	    

Boot from local hard disk (filename default):

Example 5.5. Configuration file for PXELINUX local boot

default linux
label linux
  localboot 0
	    

The file pxelinux.0 tries to read several configuration files. It uses the first one it finds. The filenames it looks for are determined by the IP address of the client it is running on. It converts the four decimal number parts of an IP address (they are divided by dots) into hexadecimal numbers and concatenates them. Example: IP address 192.168.0.11 gets converted into C0 A8 00 0B (without the spaces).

The search for files starts at C0A8000B and proceeds by removing one digit from the right (leaving C0A8000) and so forth. When all digits are removed it will try as last resort the filename default.

On your TFTP server, this algorithm can be used to tell each single machine how to boot:

Example 5.6. PXELINUX Configuration

/tftpboot/pxelinux.cfg/
                   C0A8000B -> default.netboot-8.0    
                   C0A8000C -> default.netboot-8.1    
                   default.netboot-8.0
                   default.netboot-8.1
                   default
	    

This is important if you install a lot of machines at the same time. You can watch the syslog file on your TFTP server and whenever a client got its initial RAM disk transmitted, you can remove the symlink for that machine from the pxelinux.cfg directory. This forces the client to load the default configuration which says: "Boot from local disk!" when the machine reboots after AutoYaST is done. (This process can be automated by monitoring the network or syslog for booting clients and removing the links with a script running in the background)

1.3.4. Booting with Etherboot

Etherboot, as mentioned earlier, is the piece of software that loads off of a floppy or boot EPROM and loads the GRUB, the second-stage loader, off the server. It is a freely-available, open source package which also can be found with SuSE Linux.

To use Etherboot with a boot EPROM, consult the Etherboot documentation. The Etherboot package contains pre-compiled images for boot EPROM and floppies.

To create a bootable floppy for network installation copy the image in a floppy:

              
cat /usr/lib/etherboot/dsk/<NIC> > /dev/fd0

Once you have a bootable floppy, test-boot it. You should receive a prompt asking whether to boot from (L)ocal or (N)etwork. Choose network. If you haven't set up a DHCP server yet, it should hang - but at least Etherboot works.

To boot using Etherboot, you need to create the tagged image using mknbi-linux which is part of the mknbi package. Assuming you have copied the linux image and the initial ramdisk to a directory (images) below /tftpboot, the following command line will be used to create the image:


mknbi-linux images/linux images/initrd --output=linux.nbi

Using the --param command line option, you can set the kernel parameter in case you don't have them applied somewhere else.


    mknbi-linux images/linux images/initrd --output=linux.nbi   --param='autoyast="http://192.168.1.1/profiles" .....'

        

An alternative for adding the kernel parameters while creating the image which is not optimal for multiple clients needing different parameters is to make the DHCP server send the parameters during booting using a special option in /etc/dhcpd.conf.

You need to define two custom options (T128 and T129) in the DHCP configuration as described in the following example:

Example 5.7. Etherboot with kernel command line options via DHCP

allow bootp;
allow booting;

option T128 code 128 = string;
option T129 code 129 = string;
..
.
subnet 192.168.1.0 netmask 255.255.255.0 {
  range dynamic-bootp 192.168.1.100 192.168.1.150;
 
  option routers 192.168.1.240;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.1.255;
  option domain-name-servers 192.168.1.240;
  next-server 192.168.1.1;
}

.
group {

    next-server 192.168.1.1;
    option root-path "/SuSE/CDs/latest";
    use-host-decl-names on;
    option T128 e4:45:74:68:00:00;
.
.
.
    host athlon {
        hardware ethernet 00:50:ba:e8:45:5b;
        fixed-address avicenna;
        option T129 "autoyast=http://192.168.1.1/profiles/  install=nfs://192.168.1.1/SuSE/CDs/latest   vga=791";
        filename "vmlinuz.nbi-9.0";
    }
..
.
.
}

1.3.5. GRUB Floppy

To create a GRUB boot floppy with the menu interface, the easiest way is:

  1. Create filesystem in your floppy disk. For example:

    
    $ mke2fs /dev/fd0
    
    
  2. Mount it on somewhere, say, /mnt.

  3. Copy the GRUB images from /usr/lib/grub/ to /mnt/boot/grub. Only stage1, stage2 (Use stage2.netboot in this case) and menu.lst are necessary. You may not copy "stage1.5"s.

  4. Unmount the floppy.

  5. Run the following command:

    
    $ /usr/sbin/grub --batch <<EOT
    	       root (fd0)
                   setup (fd0)
                   quit
                   EOT
    
    

The file menu.list can have multiple entries. the following example shows different ways for booting the client over the network:

Example 5.8.  GRUB menu.lst


color white/blue black/light-gray
default 0
timeout 8
framebuffer 1

title autoinstall-bootp
    bootp
    root (nd)
    kernel (nd)/linux   vga=791 install=nfs://192.168.1.1/CDs/9.0
    autoyast=http://192.168.1.1/profiles/
    initrd (nd)/initrd

title autoinstall-ip
    ifconfig --address=192.168.1.50 --server=192.168.1.1
    root (nd)
    kernel (nd)/linux install=nfs://192.168.1.1/work/CDs/full-i386 ip=192.168.1.50 netmask=255.255.255.0
    initrd (nd)/initrd

title floppy
    root (fd0)
    chainloader +1


  
[Note]NIC Support

GRUB does not support all network interfaces and having all network interfaces enabled in the /usr/lib/grub/stage2.netboot might have some side effects when booting certain network devices.

1.3.6. Combining Etherboot with GRUB

GRUB consists of several images: two essential stages, optional stages called Stage 1.5, and two network boot images. Here is a short overview of the network boot images:

nbgrub. This is a network boot image for the Network Image Proposal used by some network boot loaders, such as Etherboot. This is mostly the same as Stage 2, but this also sets up a network and loads a configuration file from the network.

pxegrub. This is another network boot image for the Pre-boot Execution Environment used by several Netboot ROMs. This is identical to nbgrub, except for the format.

Those images are the same as the normal Stage 2, except that they set up a network automatically, and try to load a configuration file from the network, if specified. The usage is very simple: If the machine has a PXE ROM, use `pxegrub'. If the machine has a NBI loader such as Etherboot, use `nbgrub'. There is no difference between them but their formats. As how to load a second stage image you want to use should be described in the manual on your Net Boot ROM, please refer to the manual, for more information.

However, there is one thing specific to GRUB. Namely, how to specify a configuration file in a BOOTP/DHCP server. For now, GRUB uses the tag 150, to get the name of a configuration file. The following is an example about a DHCP configuration:

Example 5.9. Grub image via DHCP

option domain-name "example.org";
option domain-name-servers 10.0.0.1;
option T150 code 150 = string;


subnet 10.0.0.0 netmask 255.255.255.0 {
	range 10.0.0.128 10.0.0.192;
	option routers 10.0.0.1;
	option broadcast-address 10.0.0.255;

	# GRUB network boot stuff
	filename "/tftpboot/nbgrub";
	server-name "10.0.0.1";
        option T150 "(nd)/tftpboot/menu.lst";
}

Note that you should specify the drive name (nd) in the name of the configuration file. That is because you can change the root drive before downloading the configuration from the TFTP server, when the preset menu feature is used.

PXEGRUB can be configured in a similar way when booting using a PXE enabled NIC.