At the moment the installation of the diskless server basically follows the method descibed in the RHEL System Administration Guide for creation of an NFS based diskless client: install the OS on a local disk and then copy its contents to the network disk.
Install the mkinitrd-iscsi package from the RHEL3-local-extras repository. This will install its depency packages too:
# yum install mkinitrd-iscsiConfigure mkinitrd for iscsi boot:
# echo "BOOTMETHOD=iscsi" >> /etc/sysconfig/kernelConfigure
grubby-iscsi by editting
/etc/sysconfig/iscsi-boot:
# local
VERBOSE=1
LOCALBOOTDIR=/boot/iscsi
KERNELARGS="ETHERNET=eth0,eth1 BOND=bond0 RAID=yes"
# remote
BOOTSERVER=10.20.1.2
REMOTEBOOTDIR=/tftpboot/linux-install/$(hostname -s)
REMOTEUSER=tftpboot
# default sync commmand
SYNCCOMMAND="rsync -aH --rsh=ssh ${LOCALBOOTDIR}/ ${REMOTEUSER}@${BOOTSERVER}:${REMOTEBOOTDIR}"![]() | Note |
|---|---|
The parameters |
![]() | Important |
|---|---|
In the example config grubby-iscsi is instructed to sync the
boot setup to the boot server with ssh. In this case you will need to
setup ssh public key authentication to allow the rsync command to
write in the |
Remove all 'scsi_hostadapter' references from
/etc/modules and if you want to bond ethernet devices
configure the bonding settings. The resulting
/etc/modules should look similar to this:
alias eth0 tg3
alias eth1 tg3
alias eth2 tg3
alias eth3 tg3
alias usb-controller usb-uhci
alias usb-controller1 ehci-hcd
options bonding miimon=100 mode=1The default init scripts interfere with the iSCSI services and therefore need to be tweaked a bit:
remove the ethernet configuration for the NICs in the storage
network: These NICs already have been configured by the initrd and
must not be brought up or down or reconfigured later in the startup
sequence or the shutdown sequence. In short 'rm
/etc/sysconfig/network-scripts/ifcfg-'
for the appropiate devices.ethX
/etc/init.d/halt calls
killall5. This tool kills all processes except for
the current session. Unfortunately this also includes the iSCSI kernel
threads. Therefore remove or comment the lines calling
killall5.
/etc/init.d/halt calls
/sbin/halt with argument '-i'. This argument means
' Shut down all network interfaces just before halt or reboot', which
interferes with iSCSI. Remove the offending argument from
HALTARGS.
The config file /etc/iscsi.conf needs to
contain the discovery addresses of the SANs and the targets. Technically
explicit configuration of which targets to enable is not mandatory but it
is safer to do so: else a configuration error on the SAN could mix up
targets in a nasty way (e.g. a mixture of snapshots could be
mounted).
The configuration should look like this:
#HeaderDigest=Prefer-off
#DataDigest=Prefer-off
#LoginTimeout=15
#AuthTimeout=45
#IdleTimeout=60
# don't do IdleTimeouts
IdleTimeout=0
#PingTimeout=5
#ReplacementTimeout=30
DiskCommandTimeout=15
#AbortTimeout=10
#ResetTimeout=30
#ImmediateData=Yes
Enabled=no
DiscoveryAddress=10.20.1.1
TargetName=iqn.1999-12.net.enovation:storage.esan11.appserver1-root.part0
Enabled=yes
DiscoveryAddress=10.30.1.1
TargetName=iqn.1999-12.net.enovation:storage.esan21.appserver1-root.part1
Enabled=yesParameter IdleTimeout should be set to 0. DiskCommandTimeout should not be set to 0 or else the RAID1 devices will not degrade if a SAN fails or becomes unreachable.
Partition the disks of both targets:
# parted /dev/sdX mklabel msdos
# parted /dev/sdX mkpart primary 0 root-partition-size
# parted /dev/sdX set 1 raid on
Optionally create partitions for data partitions and swap.
Create RAID1 devices out of the partition(s):
mdadm --create /dev/md0 --level=1 --raid-devices=2
/dev/sd[bc]1
Now create and mount the iSCSI root filesystem:
# mkfs -t ext3 /dev/md0
# e2label /dev/md0 /
# mkdir /mnt/iscsi
# mount /dev/md0 /mnt/iscsiAnd finally copy the root filesystem to iSCSI:
# rsync -axH / /mnt/iscsiThe boot server needs to have the boot configuration (pxelinux.cfg) and kernel and initrd images. mkinitrd-iscsi will ensure that upon every kernel update the boot server will be updated too. For the install we will fake a kernel update with:
# new-kernel-pkg --mkinitrd --depmod --install `uname -r`Finally, configure the machine on the boot server with iscsi-boot-admin. For example:
# iscsi-boot-admin add-server machine123 00:11:22:33:44:55,66:77:88:99:AA:BB "123 room 1.5.1 rack 12"
# iscsi-boot-admin set-active machine123 appserver1
# iscsi-boot-activateSee the documentation of iscsi-boot-admin for an explanation of these commands and instructions on how to setup the boot server.