The Actual Step-by-Step HOWTO

  1. Install the SystemImager server package on the machine you have chosen as your image server.

    Example 2. Often times, a machine that is already performing some kind of management function is a good choice for your image server.

    You can find the SystemImager packages and links to some of the dependent packages that may not be a part of your Linux distribution at http://systemimager.org/.

    The SystemImager server software is available in tar ball format and may be available in other distribution specific packaged formats. The example below is for installing from a tar ball. The software is the same regardless of the packaging format.

    Example 3. Installing the SystemImager server software

    [root@imageserver]# bzcat va-systemimager-server-x.x.x.tar.bz2 | tar -x
    [root@imageserver]# cd va-systemimager-server-x.x.x
    [root@imageserver]# ./install
    Welcome to SystemImager.
    
    This install script may modify the following files and/or directories:
    
     /tftpboot/systemimager/ -- create if necessary and add appropriate files/links
     /tftpboot/pxelinux.cfg/ -- create if necessary and add appropriate files/links
     /etc/services           -- add /sync and/or tftp entries if necessary
     /etc/inetd.conf         -- remove rsync entry if necessary and
                                add or modify tftp entry if necessary
     /etc/rsyncd.conf        -- it is assumed that SystemImager will manage this
                                file and that it will not be used for anything else
    
     All modified files will be backed up with the .beforesystemimager extension.
    
     See "install -help" for command line options.
    
    Install SystemImager? (y/[n]) y
    Ok. Installing SystemImager...
    
    Installing files in /usr/sbin/
    Installing files in /etc/init.d/
    Installing files in /tftpboot/
    Installing files in /tftpboot/pxelinux.cfg/
    Installing files in /tftpboot/systemimager/
    Installing files in /var/spool/systemimager/images/
    rsync entries already enabled in /etc/services...
    tftp entry already enabled in /etc/inetd.conf...
    SystemImager brand /etc/rsyncd.conf file already exists...
    creating soft links to rsync init script...
    running rsync init script...
    Stopping rsync daemon: rsync.
    Starting rsync daemon: rsync.
    Installing files in /usr/share/doc/va-systemimager-x.x.x/
    
    All done!  Please read the manual before using SystemImager.
    See /usr/share/doc/va-systemimager-x.x.x/ for all documentation.
    	  
  2. Install Linux on your "golden client", and customize as you desire.

    Select a machine which will be the "golden client". This machine's image is the image you will replicate to other machines.

    Configure this "golden client" as you normally would any machine. Install Linux on this node with the understanding that the software installed will eventually constitute the image for all other nodes installed with SystemImager. Don't worry too much about getting it exactly right the first time, since you can easily use SystemImager to make incremental changes to your image and distribute those changes without doing a complete re-install.

    Example 4. Install the "golden client"

  3. Install the SystemImager client software on your "golden client" and run the prepareclient command.

    The SystemImager client software is available in tar ball format and may be available in other distribution specific packaged formats. The example below is for installing from a tar ball. The software is the same regardless of the packaging format.

    Example 5. Installing the SystemImager client software

    [root@imageserver]# bzcat va-systemimager-client-x.x.x.tar.bz2 | tar -x
    [root@imageserver]# cd va-systemimager-client-x.x.x
    [root@imageserver]# ./installclient 
    Install SystemImager client? (y/[n]) y
    Ok. Installing SystemImager client...
    
    Installing files in /usr/share/doc/va-systemimager-x.x.x/
    
    All done!  Please read the manual before using SystemImager.
    See /usr/share/doc/va-systemimager-x.x.x/ for all documentation.
    
    You must run "prepareclient" before you can retrieve this clients image.
    Do you want to run "prepareclient" now? (y/[n]) n
    "prepareclient" not run.
    Be sure to run "prepareclient" before you run "getimage" on the imageserver.
          

    Example 6. Running prepareclient

    [root@imageserver]# prepareclient
    
    Welcome to the SystemImager prepareclient command.  This command
    may modify the following files to prepare your client for having it's
    image retrieved by the imageserver.  It will also create the 
    /etc/systemimager directory and fill it with information about your 
    golden client, such as the disk partitioning scheme(s). 
     
     /etc/services    -- add rsync line if necessary
     /etc/inetd.conf  -- comment out rsync line if necessary
                         (rsync will run as a daemon until shutdown)
     /tmp/rsyncd.conf -- create a temporary rsyncd.conf file with a
                         [root] entry in it.
     
    All modified files will be backed up with the .beforesystemimager 
    extension.
    
    See "prepareclient -help" for command line options.
    
    Prepare client for SystemImager? (y/[n]): y
    Ok. Preparing client for SystemImager...
    
    Creating /tmp/rsyncd.conf ...
    Starting or re-starting rsync as a daemon.....done!
    
    This client is ready to have it's image retrieved.
    You must now run the "getimage" command on the imageserver.
    	  
  4. Run getimage on the image server to pull the image from the "golden client" to the image server.

    Example 7. Pull the "golden client's" image to the image server

    The basic syntax is: "getimage -golden-client [client_hostname] -image [image_name]"

    Where [client_hostname] is the hostname or IP address of the "golden client" and [image_name] is the name that you want to give to this image. There are many other options that can be seen with "getimage -help".

    Example 8. Running getimage

    [root@imageserver]# getimage -g my-golden-client -image web_server_image_v1
    
    This program will get the "web_server_image_v1" system image from "my-golden-client"
    making the assumption that all filesystems considered part
    of the system image are using ext2, ext3, or reiserfs.
    
    This program will not get /proc, NFS, or other filesystems
    not mentioned above.
    
    See "getimage -help" for command line options.
    
    Continue? ([y]/n): y
    
    Retrieving /etc/systemimager/mounted_filesystems from my-golden-client to check for mounted filesystems...
    ------------- my-golden-client mounted_filesystems RETRIEVAL PROGRESS -------------
    receiving file list ... done
    /var/spool/systemimager/images/web_server_image_v1/etc/systemimager/mounted_filesystems
    wrote 132 bytes  read 294 bytes  852.00 bytes/sec
    total size is 180  speedup is 0.42
    ------------- my-golden-client mounted_filesystems RETRIEVAL FINISHED -------------
    
    
    Retrieving image web_server_image_v1 from my-golden-client
    ------------- web_server_image_v1 IMAGE RETRIEVAL PROGRESS -------------
    receiving file list ... done
    ./
    bin/
    bin/mt -> /etc/alternatives/mt
    bin/pidof -> ../sbin/killall5
    bin/rbash -> bash
    bin/sh -> bash
    boot/
    boot/lost+found/
    cdrom/
    dev/
    dev/MAKEDEV -> /sbin/MAKEDEV
    dev/agpgart
    dev/atibm
    dev/audio
    dev/audio1
    dev/audio2
    dev/audio3
    dev/audioctl
    dev/aztcd0
    dev/bpcd
    
    [ ... etc, etc, etc ... ]
    
    var/log/
    var/log/exim/
    var/log/ksymoops/
    var/log/news/
    var/run/
    var/spool/
    var/spool/cron/
    var/spool/cron/atjobs/
    var/state/
    var/state/apt/
    var/state/apt/lists/
    var/state/logrotate/
    var/tmp/
    wrote 117490 bytes  read 134577117 bytes  413808.32 bytes/sec
    total size is 134072667  speedup is 1.00
    ------------- web_server_image_v1 IMAGE RETRIEVAL FINISHED -------------
    
    Press <Enter> to continue...
    
    IP Address Assignment
    ---------------------
    
    There are four ways to assign IP addresses to the client systems on an
    ongoing basis:
    
    1) static_dhcp -- A DHCP server will assign the
         same static address each time to clients 
         installed with this image.  Also see the
         "mkdhcpstatic" command.
    
    2) dynamic_dhcp -- A DHCP server will assign IP
         addresses dynamically to clients installed
         with this image.  They may be assigned a
         different address each time.
    
    3) static -- The IP address the client uses
         during autoinstall will be permanently
         assigned to that client.
    
    4) replicant -- Don't mess with the network
         settings in this image.  I'm using it as a
         backup and quick restore mechanism for a 
         single machine.
    
    Which method do you prefer? [1]: 3
    You have chosen method 3 for assigning IP addresses.
    
    Are you satisfied? ([y]/n): y
    Would you like to run the "addclients" utility now? (y/[n]): n
    	  
  5. Run addclients on the image server to tell it which clients will receive which image, and to populate the image server's /etc/hosts and /tftpboot/systemimager/hosts files.

    Example 9. Running addclients

    [root@imageserver]# addclients
    
    Welcome to the SystemImager "addclients" utility  
    ---------------------------------------------------
    
    This utility has 3 sections.  
    
    
    "Section 1" will ask you for your hostname information.
    
    
    "Section 2" will allow you to create softlinks from each
    client hostname to your "master" script in the
    "/tftpboot/systemimager/" directory.  
    
    Example: www297.sh -> web_server_image_v1.master
    
    
    "Section 3" will ask you for IP address information that will
    be combined with the hostname information provided in Section 1
    to create entries in "/etc/hosts" for each of these same clients.
    New entries will be appended to the end of "/etc/hosts".  If you 
    specify new hostnames for existing IP addresses, those entries 
    will be re-written in place to reflect the new host names.
    
    
    Continue? ([y]/n): 
    
    
    addclients -- Section 1 (hostname information)
    ----------------------------------------------
    
    The next series of questions will be used to create a range
    of hostnames.  You will be asked for your domain name, the 
    base host name, a beginning number, and an ending number.
    
    For example, if you answer:
      domain name     = systemimager.org
      base host name  = www
      starting number = 7
      ending number   = 11
    
    Then the result will be a series of hostnames that looks like this:
      www7.systemimager.org
      www8.systemimager.org
      www9.systemimager.org
      www10.systemimager.org
      www11.systemimager.org
    
    
    What is your domain name? []: mydomain.com
    What is the base host name that you want me to use? []: server
    What number should I begin with? []: 1
    What number should I end with? []: 99
    
    
    I will work with hostnames:  server1 through server99
                 in the domain:  mydomain.com
    
    Are you satisfied? (y/[n]): y
    
    
    addclients -- Section 2 (soft links to master script)
    -----------------------------------------------------
    
    Would you like me to create soft links to a "master" script so
    that hosts:
    
      server1 through server99
    
    can be autoinstalled with that image? ([y]/n): 
    
    Here is a list of available images:
    
    debian_ide_2.2 
    debian_hwraid_ext2 
    web_server_image_v1 
    
    Which image would you like these hosts to receive? [web_server_image_v1]: 
    
    Your soft links have been created.
    
    Press <Enter> to continue...
    
    
    addclients -- Section 3 (adding or modifying /etc/hosts entries)
    ----------------------------------------------------------------
    
    It is necessary to have an entry for each client in "/etc/hosts".
    
    I will ask you for your clients' IP addresses one subnet at a time.
    
    
    Would you like me to make these entries for you? ([y]/n): 
    
    
    addclients -- Section 3 (adding or modifying /etc/hosts entries -- continued...)
    --------------------------------------------------------------------------------
    subnet 1
    
    The first host in subnet 1 will be: server1
    What is the starting IP address for subnet 1? []: 192.168.1.1
    What is the ending IP address? []: 192.168.1.99
    I will work with IP addresses:  192.168.1.1 through 192.168.1.99
    
    Are you satisfied? (y/[n]): y
    
    These entries have been added to /etc/hosts.
    
    Press <Enter> to continue...
          

    Example 10. Entries in /etc/hosts created by addclients

    192.168.1.1    server1.mydomain.com  server1
    192.168.1.2    server2.mydomain.com  server2
    192.168.1.3    server3.mydomain.com  server3
    192.168.1.4    server4.mydomain.com  server4
    192.168.1.5    server5.mydomain.com  server5
    192.168.1.6    server6.mydomain.com  server6
    192.168.1.7    server7.mydomain.com  server7
    192.168.1.8    server8.mydomain.com  server8
    192.168.1.9    server9.mydomain.com  server9
    192.168.1.10    server10.mydomain.com  server10
    192.168.1.11    server11.mydomain.com  server11
    
    [ ... etc, etc, etc ... ]
    
    192.168.1.97    server97.mydomain.com  server97
    192.168.1.98    server98.mydomain.com  server98
    192.168.1.99    server99.mydomain.com  server99
    	  
  6. Choose and configure the method for assigning IP addresses to your autoinstall clients.

    The most common way to assign IP addresses to autoinstall clients is DHCP. To easify the configuration of the DHCP configuration file (/etc/dhcpd.conf), SystemImager includes a utility called mkdhcpserver. This utility asks you for all the information it needs to create a DHCP configuration file that is appropriate for your installation of SystemImager. It is also possible to use DHCP to assign static IP addresses to your clients on an ongoing basis after installation. If you choose to do so, simply run the mkdhcpstatic command after all of your clients have had a chance to boot and be assigned an IP address. It will modify your /etc/dhcpd.conf file on the imageserver to include static entries for each of your hosts.

    Alternately, hostname, imageserver, and networking information can be put in a configuration file on a floppy diskette. Or if you are using a running system's hard drive as the boot media, you can run "updateclient -autoinstall -server <imageserver> -config eth0" which will create a local.cfg file at the root of the client's hard drive containing the existing live network settings.

    When the autoinstall client boots, it will look for this file and use the provided values instead of getting them from DHCP and the /tftpboot/systemimager/hosts file on the image server. A local.cfg file on a floppy will work with any of the autoinstall media. The configuration file can even be put on the autoinstall floppy itself! If you use a local.cfg file on a hard drive and on a floppy, the settings on the floppy will override the settings on the hard drive.

    Example 11. Running mkdhcpserver

    [root@imageserver]# mkdhcpserver
    
    Welcome to the SystemImager "mkdhcpserver" command.  This command
    will prepare this computer to be a DHCP server by creating the 
    following file:
    
     /etc/dhcpd.conf
    
    If there is an existing file, it will be backed up as:
    
     /etc/dhcpd.conf.beforesystemimager
    
    Continue? (y/[n]): y
    
    
    Type your response or hit <Enter> to accept [defaults].  If you don't
    have a response, such as no first or second DNS server, just hit 
    <Enter> and none will be used.
    
    
    What is your domain name? [localdomain.domain]: mydomain.com
    What is your network number? [192.168.1.0]: 
    What is your netmask? [255.255.255.0]: 
    What is the starting IP address for your dhcp range? [192.168.1.1]: 
    What is the ending IP address for your dhcp range? [192.168.1.100]: 192.168.1.99
    What is the IP address of your first DNS server? []: 192.168.1.200
    What is the IP address of your second DNS server? []: 192.168.1.201
    What is the IP address of your third DNS server? []: 
    What is the IP address of your default gateway? [192.168.1.254]: 
    What is the IP address of imageserver? [192.168.1.254]: 192.168.1.203
    What is the air speed velocity of the common swallow? []: 
    
    
    Ahh, but seriously folks...
    Here are the values you have chosen:
    
    ################################################################
    DNS Domain Name:                          mydomain.com
    network number:                           192.168.1.0
    netmask:                                  255.255.255.0
    starting IP address for your dhcp range:  192.168.1.1
    ending IP address for your dhcp range:    192.168.1.99
    first DNS server:                         192.168.1.200
    second DNS server:                        192.168.1.201
    third DNS server:                         
    default gateway:                          192.168.1.254
    imageserver:                              192.168.1.203
    ################################################################
    
    Are you satisfied? (y/[n]): y
    
    
    The dhcp server configuration file (/etc/dhcpd.conf) file has been 
    created for you.  Please verify it for accuracy.
    
    If this file does not look satisfactory, you can run this command again
    to re-create it: "mkdhcpserver"
    
    WARNING!:  If you have multiple physical network interfaces, be sure to 
    edit the init script that starts dhcpd to specify the interface that 
    is connected to your DHCP clients.  Here's an example:
    
     Change "/usr/sbin/dhcpd" to "/usr/sbin/dhcpd eth1".
    
    Also, be sure to start or restart your dhcpd daemon.  This can usually
    be done with a command like "/etc/init.d/dhcpd restart" or similar.
    	  

    Example 12. Running updateclient with the "-autoinstall" and "-config" options

    Note that the options -autoinstall, -server, and -configure-from are abbreviated below as -a, -s, and -c. It is possible to abbreviate options to minimum uniqueness with most SystemImager commands.

    Minimum uniqueness means that if you have two options for a single command that are similar, such as the -image and -ip-assignment options to getimage, they can be abbreviated to -im and -ip.

    [root@server7]# updateclient -a -s imageserver -c eth0
    Retrieving SystemImager kernel...
    Retrieving SystemImager initial ramdisk...
    Adding SystemImager entry in /etc/lilo.conf...
    running /sbin/lilo -d 50 -D systemimager ...
    Ignoring entry 'delay'
    Ignoring entry 'default'
    Added linux
    Added systemimager *
    
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Below are the contents of your /local.cfg file.  Make sure that all
    the variables are filled in and that they contain the proper values.
    You may edit the file directly if you need to change any of the values.
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    
    #
    # "SystemImager" - Copyright (C) 1999-2001 Brian Elliott Finley <brian@systemimager.org>
    #
    # This file is: /local.cfg
    #
    HOSTNAME=server7
    DOMAINNAME=mydomain.com
    DEVICE=eth0
    IPADDR=192.168.1.7
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    BROADCAST=192.168.1.255
    GATEWAY=192.168.1.254
    GATEWAYDEV=eth0
    IMAGESERVER=192.168.1.203
    	  
  7. Autoinstall the "golden" image on other machines.

    There are four methods for autoinstalling the clients:

    • Boot the system from a floppy diskette.

      Run mkautoinstalldiskette to create an autoinstall diskette. Autoinstall diskettes can be used with any machine unless you add a customized /local.cfg file to the diskette.

    • Boot the system from a CDROM.

      Run mkautoinstallcd to create an ISO image that can be burned to CDROM. This CDROM can then be used to boot your autoinstall clients and can also be used with any machine.

    • Boot the system from it's own hard drive.

      If your client is already running Linux, and uses LILO as it's boot loader, then you can simply copy over the updateclient command and run it with the -autoinstall option.

      Example 13. Copy over the updateclient command

      [root@server7]# rsync -av imageserver::tftpboot/systemimager/updateclient /usr/sbin
      receiving file list ... done
      updateclient
      wrote 115 bytes  read 14560 bytes  29350.00 bytes/sec
      total size is 14445  speedup is 0.98
               

      Example 14. Booting the autoinstall media from a system's hard drive

      [root@server7]# updateclient -a -s imageserver -c eth0
      Retrieving SystemImager kernel...
      Retrieving SystemImager initial ramdisk...
      Adding SystemImager entry in /etc/lilo.conf...
      running /sbin/lilo -d 50 -D systemimager ...
      Ignoring entry 'delay'
      Ignoring entry 'default'
      Added linux
      Added systemimager *
      	      
    • Boot the system from the network using PXE if your system supports it. This is usually enabled through a BIOS setting.

      PXE booting can be flaky and client side firmware is less than consistent. If you must boot without physically touching your machines, may I suggest that you try the -autoinstall option to updateclient first and see if it meets your needs.

      SystemImager comes with the mkbootserver utility to help configure a PXE server. mkbootserver, is new with the 2.0.0 release, and will likley not work with all PXE clients. If it fails to work with your configuration, please submit a bug report.