biolocal:Diskless
From Wiki CEINGE
| Revision as of 10:30, 27 February 2009 (edit) Gianluca (Talk | contribs) ← Previous diff |
Current revision (10:14, 14 April 2009) (edit) (undo) Gianluca (Talk | contribs) |
||
| (20 intermediate revisions not shown.) | |||
| Line 1: | Line 1: | ||
| - | + | == New diskless OS == | |
| - | ''Preparing the NFS server'' | ||
| - | On 143.225.151.72 (storagesrv2) there are 2 LUNs available for diskless OSes: | ||
| + | '''NFS server configuration''' | ||
| + | |||
| + | Two volumes are available on the SAN for diskless data: | ||
| <div> | <div> | ||
| - | /dev/ | + | rootOSes /dev/emcpowern1 (500Gb) |
| - | /dev/ | + | snapOSes /dev/emcpowerm1 (1Tb) |
| </div> | </div> | ||
| + | |||
| + | They are mounted on 143.225.151.72 (storagesrv2) under: | ||
| + | |||
| + | <div> | ||
| + | /mnt/rootOSes | ||
| + | /mnt/snapOSes | ||
| + | </div> | ||
| + | |||
| + | Create the directory structure runing the command: | ||
| + | |||
| + | <div> | ||
| + | /root/config_os_partitions.sh oslabel | ||
| + | ex: /root/config_os_partitions.sh centos5sge | ||
| + | </div> | ||
| + | |||
| + | This script makes the directories | ||
| + | <pre> | ||
| + | /mnt/rootOSes/$oslabel | ||
| + | /mnt/snapOSes/$oslabel | ||
| + | /diskless/i386/$oslabel/root | ||
| + | /diskless/i386/$oslabel/snapshot | ||
| + | </pre> | ||
| + | and remount the /mnt directories on /diskless directories. | ||
| + | |||
| + | Note: The two paths in /mnt must be remounted through a binding mount on /diskless/i386/... paths. This is required to export the paths /diskless/i386/... according to the diskless standard. | ||
| + | |||
| + | |||
| + | |||
| + | '''OS creation''' | ||
| + | |||
| + | Rsync the installed os from an existing disk to /diskless/i386/$oslabel/root | ||
| + | |||
| + | After the copy is completed, edit the oslabel file in etc to store the new label: | ||
| + | <pre> | ||
| + | echo 'centos5sge' > /diskless/i386/centos5sge/root/etc/oslabel | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | Export the root and snapshot directories to a new network. | ||
| + | <pre> | ||
| + | echo "/diskless/i386/centos5sge/root 192.168.151.43(rw,sync,no_root_squash)" >> /etc/exports | ||
| + | echo "/diskless/i386/centos5sge/root 192.168.129.0/24(ro,sync,no_root_squash)" >> /etc/exports | ||
| + | echo "/diskless/i386/centos5sge/snapshot 192.168.129.0/18(rw,sync,no_root_squash)" >> /etc/exports | ||
| + | exportfs -r | ||
| + | </pre> | ||
| + | |||
| + | Register the new rootfs and the Os by using the web interface (http://mac-web.ceinge.unina.it/servers): | ||
| + | *Create a rootfs | ||
| + | *Create the OS; the OS should be linked to the created rootfs selecting the corresponding checkbox in the new os interface. | ||
| + | |||
| + | |||
| + | '''Clustermanager setup''' | ||
| + | |||
| + | * DHCP | ||
| + | Edit the file /etc/dhcpd.conf and insert a new network configuration: | ||
| + | <pre> | ||
| + | pool { | ||
| + | include "dhcpd.d/centos5sge/dhcpd.inc"; | ||
| + | filename "centos5sge/pxelinux.0"; | ||
| + | range 192.168.129.1 192.168.129.254; | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | In /etc/dhcpd.d create a new directory and the include file: | ||
| + | <pre> | ||
| + | mkdir /etc/dhcpd.d/centos5sge | ||
| + | touch /etc/dhcpd.d/centos5sge/dhcpd.inc | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | * tftserver | ||
| + | Create a new directory in /tftpboot/ and build the structure for the current diskless os: | ||
| + | <pre> | ||
| + | mkdir /tftpboot/centos5sge | ||
| + | mkdir /tftpboot/centos5sge/centos5sge | ||
| + | cp -aR /tftpboot/linux-install/pxelinux.0 /tftpboot/linux-install/pxelinux.cfg /tftpboot/linux-install/msgs /tftpboot/centos5sge/ | ||
| + | </pre> | ||
| + | |||
| + | The /tftpboot/centos5sge/centos5sge should contain the kernel and the initrd image of the diskless os to run. | ||
| + | |||
| + | |||
| + | * pxe | ||
| + | Configure the xml pxeos file describing the new os; write in /tftpboot/linux-install/pxelinux.cfg/pxeos.xml and in /tftpboot/centos5sge/pxelinux.cfg/pxeos.xml the tags: | ||
| + | <pre> | ||
| + | <?xml version="1.0" ?> | ||
| + | <OperatingSystems> | ||
| + | |||
| + | <OS Anonymous="1" | ||
| + | Description="CentOS5 for SGE cluster Nodes" | ||
| + | Diskless="1" Kernel="2.6.18-92.1.18.el5" | ||
| + | Kickstart="" Location="/diskless/i386/centos5sge" | ||
| + | Name="centos5sge" | ||
| + | Password="" | ||
| + | Protocol="NFS" | ||
| + | Server="192.168.151.125" | ||
| + | User=""/> | ||
| + | |||
| + | </OperatingSystems> | ||
| + | </pre> | ||
| + | |||
| + | Now, build the diskless directories, mounting the volumes from the nfs server | ||
| + | config_newos.sh centos5grid 192.168.151.125 | ||
| + | |||
| + | Finally, write the list of files to be included into the snapshot folders: | ||
| + | /diskless/i386/centos5sge/snapshot/files | ||
| + | /diskless/i386/centos5sge/snapshot/files.custom | ||
Current revision
[edit] New diskless OS
NFS server configuration
Two volumes are available on the SAN for diskless data:
rootOSes /dev/emcpowern1 (500Gb) snapOSes /dev/emcpowerm1 (1Tb)
They are mounted on 143.225.151.72 (storagesrv2) under:
/mnt/rootOSes /mnt/snapOSes
Create the directory structure runing the command:
/root/config_os_partitions.sh oslabel ex: /root/config_os_partitions.sh centos5sge
This script makes the directories
/mnt/rootOSes/$oslabel /mnt/snapOSes/$oslabel /diskless/i386/$oslabel/root /diskless/i386/$oslabel/snapshot
and remount the /mnt directories on /diskless directories.
Note: The two paths in /mnt must be remounted through a binding mount on /diskless/i386/... paths. This is required to export the paths /diskless/i386/... according to the diskless standard.
OS creation
Rsync the installed os from an existing disk to /diskless/i386/$oslabel/root
After the copy is completed, edit the oslabel file in etc to store the new label:
echo 'centos5sge' > /diskless/i386/centos5sge/root/etc/oslabel
Export the root and snapshot directories to a new network.
echo "/diskless/i386/centos5sge/root 192.168.151.43(rw,sync,no_root_squash)" >> /etc/exports echo "/diskless/i386/centos5sge/root 192.168.129.0/24(ro,sync,no_root_squash)" >> /etc/exports echo "/diskless/i386/centos5sge/snapshot 192.168.129.0/18(rw,sync,no_root_squash)" >> /etc/exports exportfs -r
Register the new rootfs and the Os by using the web interface (http://mac-web.ceinge.unina.it/servers):
- Create a rootfs
- Create the OS; the OS should be linked to the created rootfs selecting the corresponding checkbox in the new os interface.
Clustermanager setup
- DHCP
Edit the file /etc/dhcpd.conf and insert a new network configuration:
pool {
include "dhcpd.d/centos5sge/dhcpd.inc";
filename "centos5sge/pxelinux.0";
range 192.168.129.1 192.168.129.254;
}
In /etc/dhcpd.d create a new directory and the include file:
mkdir /etc/dhcpd.d/centos5sge touch /etc/dhcpd.d/centos5sge/dhcpd.inc
- tftserver
Create a new directory in /tftpboot/ and build the structure for the current diskless os:
mkdir /tftpboot/centos5sge mkdir /tftpboot/centos5sge/centos5sge cp -aR /tftpboot/linux-install/pxelinux.0 /tftpboot/linux-install/pxelinux.cfg /tftpboot/linux-install/msgs /tftpboot/centos5sge/
The /tftpboot/centos5sge/centos5sge should contain the kernel and the initrd image of the diskless os to run.
- pxe
Configure the xml pxeos file describing the new os; write in /tftpboot/linux-install/pxelinux.cfg/pxeos.xml and in /tftpboot/centos5sge/pxelinux.cfg/pxeos.xml the tags:
<?xml version="1.0" ?>
<OperatingSystems>
<OS Anonymous="1"
Description="CentOS5 for SGE cluster Nodes"
Diskless="1" Kernel="2.6.18-92.1.18.el5"
Kickstart="" Location="/diskless/i386/centos5sge"
Name="centos5sge"
Password=""
Protocol="NFS"
Server="192.168.151.125"
User=""/>
</OperatingSystems>
Now, build the diskless directories, mounting the volumes from the nfs server config_newos.sh centos5grid 192.168.151.125
Finally, write the list of files to be included into the snapshot folders: /diskless/i386/centos5sge/snapshot/files /diskless/i386/centos5sge/snapshot/files.custom
