HOWTO Net Boot with SystemImager 3.4.1
From SystemImager
Contents |
Introduction
The purpose of this document is to descibe how to network boot different architectures with SystemImager 3.4.1. The glorious end result is that one should be able to autoinstall a client via booting from the network. Following the autoinstall, subsequent reboots should then boot off the client's harddrive.
X86 with PXE
This section describes how to set up and use NetworkBoot for x86 machines with PXE. This basically involves configuring a boot server, followed by individual client configuration. These instructions may have a bent toward SuSE 9.1, but they have been written as generically as possible.
Boot Server Setup
Obviously your boot server is going to be the same machine as your SI server. This section describes what you need to do in order to turn the machine into a boot server.
Install Required Software
In addition to the SISuite software, I found that I had to install the following RPM packages: tftp inetd pxe dhcp-server dhcp
Note that even though the RPM dependencies require dhcp packages, it is not necessary to run DHCP on the boot server.
Note #2: If you are running Red Hat Enterprise Linux 5 and you intend to run si_mkbootserver in self-configure mode, please note that the tftpd server distributed by Red Hat respects /etc/hosts.allow even for the loopback connection. The si_mkbootserver script performs a tftp server test through the loopback (127.0.0.1) connection. The script will fail if you do not add an entry to /etc/hosts.allow which permits 127.0.0.1 to connect to in.tftpd.
Create Boot Directories
I found that I had to create the followings directories like so:
mkdir /srv/tftpboot /srv/tftpboot/pxelinux.cfg
I think that on some distributions you may find that /tftpboot and /tftpboot/pxelinux.cfg are more standard. As I understand it, regular PXE uses directories such as these for the network boot procedure. The TFTP protocol is how files are transferred, the pxelinux.cfg directory contains the PXE configuration for the client, and the tftpboot directory contains the files to boot an OS (kernel, initrd, etc).
Edit SystemImager Configuration
You probably want network boot autoinstallation to occur only once; subsequent network boots should make the client boot off of its local hard drive. To make this happen, edit the NET_BOOT_DEFAULT variable in /etc/systemimager.conf like so:
NET_BOOT_DEFAULT = LOCAL
Perform Automatic Setup Tasks
At this point in the setup process, you can make use of a magical SISuite tool called si_mkbootserver. This program will copy files and edit configurations to do the final steps in the setup of the boot server. The program can be run interactively or you can specify all the parameters on the command line. Here is what my command looked like:
si_mkbootserver --interface=eth0 --localdhcp=n \ --kernel=/usr/share/systemimager/boot/i386/standard_plus_drivers/kernel \ --initrd=/usr/share/systemimager/boot/i386/standard_plus_drivers/initrd.img \ --tftpdir=/srv/tftpboot --pxelinux=/usr/share/syslinux/pxelinux.0
There are a few things to make note of in the above command. First you will see that I am getting my kernel and initrd.img from a standard_plus_drivers directory. I created this directory after finding that SystemImager's standard boot package did not have support for newer network devices. My standard_plus_drivers directory simply contains the files from Peter Mueller's kernel. You should also be aware that if you do not have a /usr/share/syslinux directory then you need to install the syslinux package. The man page for si_mkbootserver is somewhat informative and you should probably give it a read before running the command.
Start Services
In the process of getting the boot server working, I found that I had to start a few services. These services may be started automatically by si_mkbootserver, but just in case:
/etc/init.d/inetd start /etc/init.d/systemimager-server-netbootmond start /etc/init.d/systemimager-server-rsyncd start chkconfig inetd on chkconfig systemimager-server-netbootmond on chkconfig systemimager-server-rsyncd on
Note that I had to edit /etc/init.d/systemimager-server-netbootmond so that it referened si_netbootmond instead of netbootmond.
At this point, you are ready for client machines to begin network booting!
Autoinstallation Via PXE
Now that the boot server is ready, you must configure your clients. This section describes the steps that must be taken to get a client to autoinstall over the network. The implied first step is to of course make sure that network boot is at the top of the boot order in your client's BIOS. For this section we will assume that the client to be installed is called getafix and the SI server is called epidemix.
Configure DHCP
You will need to edit /etc/dhcpd.conf on whatever machine is providing DHCP for the client. Here is an example:
host getafix {
next-server epidemix;
filename "pxelinux.0";
hardware ethernet 00:E0:81:2E:74:04;
fixed-address getafix;
}
The relevant lines for network boot are "next-server" (the location of the boot server) and "filename" (the name of the initial boot file). Whenever you want to enable network boot for a client, those two lines must be added to the client's configuration. Note that if these lines are presented in a group scope, they will apply to all clients in that group (useful for clusters). Once you change the configuration, you must restart DHCP:
/etc/init.d/dhcpd restart
Create PXE Configuration
The client now needs its own PXE configuration file. In our example, the file can be generated with this command:
si_mkclientnetboot --verbose --netboot --clients "getafix"
This will create a file like this:
/srv/tftpboot/pxelinux.cfg/C0A80566
The filename represents the client's IP address in hex. If your DHCP server is different from your SI server, then you must edit this file so that it will report the IP address of the SI server in the kernel append parameters. If the file is named C0A80566 and the SI server is at 192.168.5.8, then you can accomplish this like so:
perl -pi -e 's/APPEND/APPEND IMAGESERVER=192.168.5.8 IMAGENAME=webserver/' C0A80566
Note the IMAGENAME parameter - this allows one to specify which image to autoinstall. If IMAGENAME is not specified, then the autoinstallation will look in SystemImager's scripts directory for getafix.master. One could also use si_addclients to map the client to the correct image. In this case, we have simply specified that we want getafix to be installed with the webserver image.
You Have the Power
Reboot your client and you should see PXE messages followed thereafter by SystemImager messages. Once the autoinstall is complete, reboot your machine. Again you'll see the PXE messages, but this time there will be a message saying that the client is booting from the local disk. The reason this works is because following a successful network autoinstall, the SISuite will overwrite /srv/tftpboot/pxelinux.cfg/C0A80566 (or whatever the client's PXE config file is named) with a configuration that tells the network boot client to boot from its own harddrive. It's kind of a zen moment; the client realizes that the answer was inside itself all along.
IA64 with EFI
Please add me
PPC64
The Open Firmware used in IBM Power platforms supports network booting directly.
