2.2. Installing Red Hat Enterprise Linux for Real Time Using Diskless Boot

Diskless booting allows a system administrator to deploy a large number of compute nodes without having to configure an equal number of local storage devices. This section provides instructions on how to set up a remote diskless system using an NFS filesystem mounted by a PXE booting client. Perform the following procedure on an existing installation of Red Hat Enterprise Linux for Real Time.
  1. Install the following packages required to set up a basic remote diskless system booted over PXE:
    ~]# yum install tftp-server xinetd dhcp syslinux dracut-network

    Important

    • Ensure that the NFS and DHCP services are properly configured and started.
    • Firewall rules which have been predefined by system-config-firewall can block tftp traffic and prevent the clients from booting. It is necessary to adjust the firewall rules on the server.
  2. Enable the tftp service to allow PXE booting via the network. To do so, edit the /etc/xinetd.d/tftp file and set the Disabled parameter to No.
  3. Copy /usr/share/syslinux/pxelinux.0 to the tftp root directory in /var/lib/tftpboot/:
    ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
  4. Create a pxelinux.cfg directory inside the tftp root directory:
    ~]# mkdir -p /var/lib/tftpboot/pxelinux.cfg/
  5. Configure firewall rules to allow tftp traffic. Using a text editor, add the following line to /etc/hosts.allow:
    tftpd: .hostname.com
    Replace .hostname.com with the domain name of the target clients on which the installations will be performed. For more information on firewall rules refer to the man page for hosts_access.
  6. Restore the SELinux context on the tftp server. To provide the necessary files via the tftp protocol for PXE boot, run the following command:
    ~]# restorecon -R /var/lib/tftpboot
  7. To enable PXE booting on the DHCP server, add the following configuration to /etc/dhcp/dhcpd.conf:
    allow booting;
    allow bootp;
    class "pxeclients" {
       match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
       next-server server-ip;
       filename "pxelinux.0";
    }
    
    Replace server-ip with the IP address of the host machine on which the tftp and DHCP services reside.
  8. The root directory of the exported file system (used by diskless clients in the network) is shared via NFS. Configure the NFS service to export the root directory by adding it to the /etc/exports file in the following format:
    /exported/root/directory hostname.com(rw,sync,no_root_squash)
    The example configuration exports the directory /export/root/directory to all hosts on the hostname.com network with read-write permissions. The sync option ensures that the NFS server will not reply to requests before changes made by previous requests are written to disk. The no_root_squash option enables the NFS server to connect to the client with root privileges.
  9. To accommodate completely diskless clients, the root directory should contain a complete Red Hat Enterprise Linux for Real Time installation. You can synchronize this with a running system via rsync. Run:
    ~]# rsync -a -e ssh --exclude='/proc/*' --exclude='/sys/*' hostname.com:/ /exported/root/directory
    Replace hostname.com with the hostname of the running system with which to synchronize via rsync. The /exported/root/directory is the path to the exported file system.
  10. Add the following configuration to the exported file system's /etc/fstab file:
    none		/tmp		tmpfs	defaults	0 0
    tmpfs		/dev/shm	tmpfs	defaults	0 0
    sysfs		/sys		sysfs	defaults	0 0
    proc		/proc		proc 	defaults	0 0
    
  11. Select the kernel that diskless clients should use (vmlinuz-rt-kernel-version) and copy it to the tftpboot directory:
    ~]# cp /boot/vmlinuz-rt-kernel-version /var/lib/tftpboot/
  12. Create the initramfs disk image (i.e. initramfs-rt-kernel-version.img) with network support:
    ~]# dracut -a "network nfs" initramfs-rt-kernel-version.img rt-kernel-version
  13. Copy the initramfs disk image to the tftpboot directory:
    ~]# cp initramfs-rt-kernel-version.img /var/lib/tftpboot/
  14. Edit the default boot configuration to use the initramfs disk image and Realtime kernel inside /var/lib/tftpboot. This configuration instructs the diskless client to mount the exported file system (/exported/root/directory) as read-write. To do this, configure /var/lib/tftpboot/pxelinux.cfg/default with the following:
    default realtime
    
    label realtime
      kernel vmlinuz-rt-kernel-version
      append initrd=initramfs-rt-kernel-version.img root=nfs:server-ip:/exported/root/directory rw
    
    Replace server-ip with the IP address of the host machine on which the exported NFS root partition resides.
The NFS share is now ready for exporting to diskless clients. These clients can boot Red Hat Enterprise Linux for Real Time over the network via PXE.

Important

You must disable SELinux on diskless clients which use NFS as the root file system. Add SELINUX=disabled to the /etc/selinux/config file, or add selinux=0 on the kernel command line when booting the client.
For more information on setting up remote diskless systems, see the Storage Administration Guide.