• Aucun résultat trouvé

Diskless Environments

Some networks require multiple systems with the same configuration. They also require that these systems be easy to reboot, upgrade, and manage. One solution is to use a diskless environment in which most of the operating system, which can be read-only, is shared from a central server between the clients. The individual clients have their own directories on the central server for the rest of the operating system, which must be read/write. Each time the client boots, it mounts most of the OS from the NFS server as read-only and another directory as read-write. Each client has its own read-write directory so that one client can not affect the others.

The following steps are necessary to configure Red Hat Enterprise Linux to run on a diskless client:

1. Install Red Hat Enterprise Linux on a system so that the files can be copied to the NFS server.

(Refer to the Installation Guide for details.) Any software to be used on the clients must be installed on this system and the busybox-anaconda package must be installed.

2. Create a directory on the NFS server to contain the diskless environment such as /diskless/i386/RHEL4 -AS/. For example:

mkdir -p /diskless/i386/RHEL4-AS/

This directory is referred to as the diskless directory.

3. Create a subdirectory of this directory named root/:

mkdir -p /diskless/i386/RHEL4-AS/root/

4. Copy Red Hat Enterprise Linux from the client system to the server using rsync. For example:

rsync -a -e ssh installed-system.example.com:/ /diskless/i386/RHEL4-AS/root/

The length of this operation depends on the network connection speed as well as the size of the file system on the installed system. Depending on these factors, this operation may take a while.

5. Start the tftp server 6. Configure the DHCP server

7. Finish creating the diskless environment as discussed in Section 4.2, “Finish Configuring the Diskless Environment”.

8. Configure the diskless clients as discussed in Section 4.3, “Adding Hosts”.

9. Configure each diskless client to boot via PXE and boot them.

4.1. Configuring the NFS Server

The shared read-only part of the operating system is shared via NFS.

Configure NFS to export the root/ and snapshot/ directories by adding them to /etc/exports. For example:

/diskless/i386/RHEL4-AS/root/ *(ro,sync,no_root_squash) /diskless/i386/RHEL4-AS/snapshot/ *(rw,sync,no_root_squash)

Replace * with one of the hostname formats discussed in Section 21.3.2, “Hostname Formats”. Make the hostname declaration as specific as possible, so unwanted systems can not access the NFS mount.

If the NFS service is not running, start it:

service nfs start

If the NFS service is already running, reload the configuration file:

service nfs reload

4.2. Finish Configuring the Diskless Environment

To use the graphical version of the Network Booting Tool, you must be running the X Window

System, have root privileges, and have the system -config-netboot RPM package installed. To start the Network Booting Tool from the desktop, go to Applications (the main menu on the panel) =>

System Settings => Server Settings => Network Booting Service. Or, type the command system -config-netboot at a shell prompt (for example, in an XTerm or a GNOME terminal).

If starting the Network Booting Tool for the first time, select Diskless from the First T im e Druid. Otherwise, select Configure => Diskless from the pull-down menu, and then click Add.

A wizard appears to step you through the process:

1. Click Forward on the first page.

2. On the Diskless Identifier page, enter a Nam e and Description for the diskless environment. Click Forward.

3. Enter the IP address or domain name of the NFS server configured in Section 4.1, “Configuring the NFS Server” as well as the directory exported as the diskless environment. Click Forward.

4. The kernel versions installed in the diskless environment are listed. Select the kernel version to boot on the diskless system.

5. Click Apply to finish the configuration.

After clicking Apply, the diskless kernel and image file are created based on the kernel selected. They are copied to the PXE boot directory /tftpboot/linux-install/<os-identifier>/. The directory snapshot/ is created in the same directory as the root/ directory (for example,

/diskless/i386/RHEL4 -AS/snapshot/) with a file called files in it. This file contains a list of files and directories that must be read/write for each diskless system. Do not modify this file. If additional entries must be added to the list, create a files.custom file in the same directory as the files file, and add each additional file or directory on a separate line.

4.3. Adding Hosts

Each diskless client must have its own snapshot directory on the NFS server that is used as its

read/write file system. The Network Booting Tool can be used to create these snapshot directories.

After completing the steps in Section 4.2, “Finish Configuring the Diskless Environment”, a window appears to allow hosts to be added for the diskless environment. Click the New button. In the dialog shown in Figure 4.1, “Add Diskless Host”, provide the following information:

Hostnam e or IP Address/Subnet — Specify the hostname or IP address of a system to add it as a host for the diskless environment. Enter a subnet to specify a group of systems.

Operating System — Select the diskless environment for the host or subnet of hosts.

Serial Console — Select this checkbox to perform a serial installation.

Snapshot nam e — Provide a subdirectory name to be used to store all of the read/write content for the host.

Ethernet — Select the Ethernet device on the host to use to mount the diskless environment. If the host only has one Ethernet card, select eth0.

Ignore the Kickstart File option. It is only used for PXE installations.

Figure 4 .1. Add Diskless Host

In the existing snapshot/ directory in the diskless directory, a subdirectory is created with the Snapshot nam e specified as the file name. Then, all of the files listed in snapshot/files and snapshot/files.custom are copied copy from the root/ directory to this new directory.

4.4. Booting the Hosts

Consult the documentation for your PXE card to configure the host to boot via PXE.

When the diskless client boots, it mounts the remote root/ directory in the diskless directory as read-only. It also mounts its individual snapshot directory as read/write. Then it mounts all the files and directories in the files and files.custom files using the m ount -o bind over the read-only diskless directory to allow applications to write to the root directory of the diskless environment if they need to.