1. iscsi-boot-admin


1.1. introduction

iscsi-boot-admin is a small adminstration tool for creation and maintainance of the DHCP server configuration files for booting diskless servers.

1.1.1. definitions

(diskless) server

A physical machine without disks.

boot server

A server that runs the DHCP and TFTP daemons for booting diskless servers.

service

The OS + applications running on a diskless server. Equivalent to 'host'. In this definition a server can run only 1 service simultaneously. (If we keep hardware virtualization out of the picture).

shared service

A service that can be run simultaneously on multiple servers. Typically these services do not require a volume on the SAN, like a 'diagnostic' service such as memtest or use a shared read-only volume.

exclusive service

A service that cannot be run simultaneously on multiple servers. E.g. a webserver. These services have a dedicated volume on the SAN for OS and application data.

bootloader

Program loaded by PXE on the diskless server in order to bootstrap the OS startup. The bootloader loads the kernel and initial ramdisk via TFTP from the bootserver and starts it up.

PXE

Preboot eXecution Environment. Intel standard for booting PC style hardware via the LAN.

1.2. installation

The easiest way to install iscsi-boot-admin is to let yum download and install the RPM. This will install its depency package system-config-netboot (or redhat-config-netboot), tftp-server and dhcp.

1.3. configuration

iscsi-boot-admin keeps its configuration files in /etc/iscsi-boot-admin. Currently this contains two files: admin.conf for global settings and servers.conf containing the settings for individual diskless servers. The latter is not intended for manual editting: use the iscsi-boot-admin tool to manipulate its settings.

1.3.1. admin.conf

Example:

server_db_file

Specifies the file containing the server database. Default: /etc/iscsi-boot-admin/servers.conf

dhcp_config_file

Specifies the file containing the DHCP definities for the diskless servers. This file needs to be included in the DHCP server configuration file /etc/dhcp.conf. See XXX. Default: /etc/dhcpd.d/iscsi-boot-group-1.conf

tftp_rootdir

Specifies the 'root directory' of the TFTP server. Default: /tftpboot

pxe_subdir

Specifies the subdirectory within tftp_rootdir containing the bootloader (pxelinux.0) and the service specific directories containing the boot config (pxelinux.cfg), kernel image and initial ramdisk. Default: linux-install

default_service

Specifies the shared service to be used for new, spare and broken servers. Default: diagnostics.

domain_suffix

Specifies the suffix to add to a service name in order to translate it to the corresponding hostname. E.g. service 'webservice1' translates to hostname 'webservice.san.loc'. This hostname needs to resolve or else the DHCP server cannot assign an IP address to the server booting the service. Default: .san.loc.

Typically only the parameters 'default_service' and 'domain_suffix' need to be changed. Example (and default):

server_db_file=/etc/iscsi-boot-admin/servers.conf
dhcp_config_file=/etc/dhcpd.d/iscsi-boot-group-1.conf
tftp_rootdir=/tftpboot
pxe_subdir=linux-install
default_service=diagnostics
domain_suffix=.san.loc

1.3.2. dhcpd.conf

Iscsi-boot-admin requires a few modifications to the configuration of the DHCP server. Particularly it needs some pxelinux DHCP options to properly set the directory where pxelinux will download the kernel and initrd. The config also needs to include a separate DHCP config file containing the host definitions of the diskless servers, typically '/etc/dhcpd.d/iscsi-boot-group-1.conf'. That way iscsi-boot-admin does not need to modify the main dhcpd.conf file.

The config file below contains a typical setup. The boot server has IP address 10.15.49.1. The peer server 10.15.49.2 has an identical dhcp.conf, except for the 'range' parameter (which should not overlap) and the next-server parameter (which should point to its own IP address).

ddns-update-style ad-hoc;

allow booting;  #PXE
allow bootp;    #PXE

option space pxelinux;
option pxelinux.magic      code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;

subnet 10.15.48.0 netmask 255.255.252.0 {
  range 10.15.49.224 10.15.49.254;
# range 10.15.49.192 10.15.49.223;
  authoritative;
  ddns-updates off;

  host bootserver1.san.loc { fixed-address 10.15.49.1; }
  host bootserver2.san.loc { fixed-address 10.15.49.2; }

# iscsi-boot-group-1
  group {
    site-option-space "pxelinux";
    option pxelinux.magic f1:00:74:7e;
    if exists dhcp-parameter-request-list {
    # Always send the PXELINUX options (specified in hexadecimal)
        option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
    }

    next-server 10.15.49.1;
#   next-server 10.15.49.2;
    filename "linux-install/pxelinux.0";
# root-path is obsolete: as of mkinitrd-iscsi-1.4 the initrd contains a complete iscsi.conf
#    option root-path "10.15.48.5:/,10.15.48.6://";

    include "/etc/dhcpd.d/iscsi-boot-group-1.conf";
  }
}

1.4. usage

The iscsi-boot-admin package contains two commands, iscsi-boot-admin and iscsi-boot-activate. The first manages the diskless server database and the corresponding DHCP configuration. The latter optionally synchronises the peer boot server with the new configuration and restarts DHCP.

iscsi-boot-admin [--config=<admin.conf>] command

write-dhcp-config [ '-' | <output-file>]

writes the DHCP config to either stdout, the specified output file, or the default config file (as specified by parameter dhcp_config_file in admin.conf).

list [ 'ACTIVE' | 'SPARE' | 'BROKEN' ]

lists all servers or the servers in the specified state.

list-services

lists all services found in the PXE directory.

find-service <service> [<status>]

lists the server(s) to which the specifed services has been assigned.

show <server>

shows all details of the specified server.

show-config

shows all configuration parameters (i.e. the contents of admin.conf)

switch-server <server1> <server2>

swaps the services and statuses assigned to both servers.

replace-server <active-server> <spare-server>

replaces the active server with the specified spare server. The active server will be set to state BROKEN and the spare server will be configured for the service assigned to the previously active server and set to ACTIVE.

add-server <server> <ethernets> <description>

adds the specified server to the server database. parameter ethernets is a comma separated list of the servers MAC addresses that are in the boot network segment (i.e. may send DHCP requests). Parameter description is a free text string except for that it may not contain a TAB character.

The new server will have status SPARE and be assigned the default service.

Example:

iscsi-boot-admin add-server erepos-1 00:0E:0C:65:E2:7A,00:0E:0C:65:E2:7B "erepos pand 12 rack 24"

[--force] remove-server <server>

removes the specified server from the server database. If the server in state ACTIVE, this command will refuse removal unless option '--force' is given.

set-active <server> [<service>]

sets the status of the specified server to ACTIVE and if a service is specified changes the service. The command will not change the service if the server is already ACTIVE for another service. In this case you will need to set the server to state SPARE first (with command 'set-spare').

Also, if the new service is an exclusive service and it already has assigned been to another server, this command will not reassign the service. In this case you will need to either unassign the service by setting the other server to state SPARE or use command 'switch-server' to swap the services between the two servers.

[--force] set-spare <server>

sets the status of the specified server to SPARE and changes its service to the default service. If the server is currently in state ACTIVE, this command will refuse to change the status unless option '--force' is used.

[--force] set-broken <server>

sets the status of the specified server to BROKEN and changes its service to the default service. If the server is currently in state ACTIVE, this command will refuse to change the status unless option '--force' is used.

set-description <server> <new description>

sets the description for the given server.

help

shows all commands.

iscsi-boot-activate [ 'local' | <peer-server>] [<config-dir>] [<PXE-dir>] [<DHCP config dir>]