July 10, 2008, 6:25 PM — Once your jumpstart server has been set up, you can go about the work of detailing the clients that you want to install. Each client will be described in what is called a "profile", specifying how that client will be installed. You also need to add some information about each client to your /etc files -- notably the /etc/hosts and /etc/ethers files. This provides your server with the ability to answer the request that the client will make for its IP address during the boot process. Since each client will know its hardware (MAC) address, it will use this information to try to request its IP address. The server will look in its /etc/ethers file to match the MAC address with a hostname. Then, it will look in its /etc/hosts file to determine the client's IP address. Here's an example of how those files might look: /etc/ethers
0:3:ba:b6:6a:de boson0:3:ba:7c:46:15 fermion
# jumpstart clients#10.3.2.111 boson10.3.2.123 fermion
In this example, when boson boots, the 0:3:ba:b6:6a:de MAC address will retrieve the hostname "boson" and the hostname "boson" will retrieve the 10.3.2.111 IP address. Jumpstart clients can only boot from a server on the same subnet so, if your clients are on a different subnet, you will also need to set up a boot server on the same subnet as the client. The boot server will provide the initial support for booting the client. Your jumpstart (or "install") server will then provide the OS files to complete the installation. For this column, we assume that the jumpstart server and client are on the same subnet. In last week's column, we saw the commands for enabling tftpboot on Solaris 10. The tftp service will be used to transfer boot files to the clients we are now setting up. Once a client has received its IP address, it will be able to transfer and boot from files that will be set up in the /tftpboot directory. I will give an example after we look at adding the client to the server. With a number of clients' /etc/ethers entries have been set up, I like to use a simple script to run the add_install_client script for each of them -- thereby avoiding the tedious syntax. In the script shown below, the jumpstart server (newos) will set up the files in /tftpboot and entries in the /etc/bootparams file for each system listed in /etc/ethers. If you don't want to add all the clients in your /etc/ethers file, put the target systems' /etc/ethers entries in another file (say /tmp/ethers) and modify the script to use that file instead.
#!/bin/bashwhile read MAC CLIENTdo grep "^$CLIENT " /etc/bootparams > /dev/null if [ $? != 0 ]; then echo adding $MAC $CLIENT echo -n "architecture?> " read arch /jumpstart/Solaris_10/Tools/add_install_client \ -e $MAC -s newos:/jumpstart \ -c newos:/jumpstart/config \ -p newos:/jumpstart/config $CLIENT $arch else echo "skipping $CLIENT" fidone < /etc/ethers
The script runs add_install_client for each system, specifying each required parameters: e = the ethernet (MAC) address c = the server name and path to the jumpstart files p = the location of the sysidcfg file It also includes the name of the client (from the /etc/ethers file) and the architecture of the client (passed as an argument to the script). It checks to see if each client is already in the /etc/bootparams file and doesn't run the add_install_client command unless the client is new. It also prompts for each client's architecture. The files added to your /tftpboot directory for a single system will look like these:
lrwxrwxrwx 1 root root 27 Jul 2 11:48 0A03026F -> inetboot.SUN4U.Solaris_10-1lrwxrwxrwx 1 root root 27 Jul 2 11:48 0A03026F.SUN4U -> inetboot.SUN4U.Solaris_10-1-rw-r--r-- 1 root root 320 Jul 2 11:48 rm.10.3.2.111
You will also notice the boot file itself. In this case, it's called "inetboot.SUN4U.Solaris_10-1". The symlinks point to this file as would the symlinks for additional clients of the same architecture. The odd naming of the symbolic links makes a lot more sense than you might at first imagine. The 0A03026F strings in the first two file names are the hexadecimal codes for the system's IP address. "0A" is 10, "03" is 3, "02" is 2 and "6F" is 111. The rm.10.3.2.111 file is a script to remove the client's boot files from the jumpstart server. This script will be called by the rm_install_client script which you might elect to run after your client has been reinstalled. At this point, we still need to create the client's profile before we can jumpstart it. We'll look at this next week.