Project

General

Profile

Tftp » History » Revision 2

Revision 1 (Ohad Levy, 01/15/2011 02:27 AM) → Revision 2/11 (Frank Sweetser, 04/04/2011 03:50 PM)

h1. TFTP 

 An essential first step in netbooting a system theory, any TFTP service is preparing supported, the TFTP server with the PXE configuration file and boot images.    This document assumes that you have already configured your DHCP infrastructure, either via manual configuration or through the DHCP smart proxy. 

 h2. Configuration Values 

 Once enabled, there is currently only one valid setting to change, the default TFTP root.    This is set with the @:tftproot:@ parameter, which defaults needs to @/var/lib/tftpboot@. 

 Please note that currently, foreman defaults to be configured on the name of the machine running the TFTP smart proxy.    Future plans are to allow you to explicitly specify the nextServer value - see issue #800 for details. 

 h2. Setting Up the Proxy Server Host 

 Regardless of the filesystem setup proxy, is performed, you must also make sure you have where the wget utility installed and in the default path.    wget is used to download OS specific installation when a given host is enabled for the build process. tftp path is. 

 h3. Automatic Setup 

 Foreman includes a "TFTP server module":https://github.com/ohadlevy/puppet-foreman/blob/master/foreman/manifests/proxy/tftp.pp that will perform all of the basic setup.    It defaults to TFTP root of @/var/lib/tftp@, which may change if necessary.    You will still need to provide the basic TFTP load images in your TFTP root directory.    For vanilla PXE booting, this includes @pxelinux.0@, @menu.c32@, and @chain.c32@. 

 h3. Manual Setup 

 The setup is very simple, and may be performed manually if desired. 

 # The TFTP root directory must exist (we will use @/var/lib/tftproot@ in this example). 
 # Populate @/var/lib/tftproot@ with PXE booting prerequisites.    At a minimum, this should include: 
 ** @pxelinux.0@ 
 ** @menu.c32@ 
 ** @chain.c32@ 
 # Create the directory @/var/lib/tftp/boot@ and make it writeable by foreman-user. 
 # Create the directory @/var/lib/tftp/pxelinux.cfg@ and make it writeable by foreman-user. 

 h2. Setting Up Foreman 

 In most cases, the default templates should work fine.    You do, however, need to make sure that a PXELinux or gPXE template is associated with your hosts.    See [[Foreman:Unattended_installations|Unattended Installations]] you are managing another tftp service (via nfs for details.    The template will be used to example), you can define the PXE configuration file when a host is enabled for build. 

 h2. Workflow 

 This is a rough outline of the steps triggered on the TFTP smart proxy host when you click on the "Build" link for a host. 

 # Call @mkdir -p /var/lib/tftp/pxelinux.cfg@ if it does not already exist. 
 # Create a host-specific TFTP configuration file in @/var/lib/tftp/pxelinux.cfg/01-XX-XX-XX-XX-XX-XX@, named based off of the MAC address, tftp server name using the associated PXE template. 
 # Call @mkdir -p /var/lib/tftp/boot@ if it does not already exist. 
 # Download the OS specific kernel and initrd files using wget.    The download URLs are derived from the installation media path, and OS specific log (see @app/models/redhat.rb@ and @debian.rb@ in foreman for examples of the gory details).    The exact wget command is 
 <pre>wget --no-check-certificate -nv -c <src> -O "<destination>"</pre> 
 # At this point, the TFTP state is ready for the installation process. 
 # Once the host has completed installation, the OS specific installation script should inform foreman by retrieving the built URL. 
 # The host-specific TFTP configuration file is deleted. 
 # The kernel and initrd are not deleted, but left in place for future installs of the same OS and architecture combination.    Please note that in the unlikely case that these files are modified, the simplistic freshness check of wget will likely get confused, corrupting the downloaded versions of the files.    If this happens, you should simply delete the files and let them be re-downloaded from scratch. :servername option.