Selasa, 26 Juli 2011

PXE Server setup (Linux suse 11.0)

1. Make a directory structure for installation media ISOs: 

mkdir -p /exports/iso

2. Create ISOs of the DVD installation media: 

dd if=/dev/cdrom of=/exports/iso/sles-11-x86_64.iso

3. Install Apache (YaST/Software/Software Management). For client software installation media access, you'll need NFS or HTTP to serve the installation media. For this exercise we chose the http route (find apache2 and install).
apache_install 4. Create the directory structure for ISO access through apache server: 

mkdir -p /srv/www/htdocs/sles/11/x86_64

5. Mount ISOs (loop) instead of extracting the images for more efficient storage utilization: 

mount -o loop /exports/iso/sles-11-x86_64.iso /srv/www/htdocs/sles/11/x86_64/

6. Append the following to /etc/fstab for automount of the ISOs so the mount returns automatically on boot: 

/srv/www/htdocs/sles/11/x86_64 iso9660 loop 0 0

7. Add a software repository for the Web server/ISO mount you just made: (Yast/Software/Software Repositories/Add) This repository will test the apache server, mount. If you get the "License agreement " dialog box, it works. You can delete the DVD software repository at this point.

sw_repos_web8. Install/enable TFTP Server if its not already installed. The TFTP server was installed as part of the SLES 11 default installation. In YaST, launch TFTP Server (under Network Services).

9. Click Enable, and note the boot image directory. We left it at the default /tftpboot for our lab.

tftpserver10. Install/configure DHCP. Here in the lab we weren't using DHCP, so we did the following steps to get ours going. If you have a DHCP server, make sure and add the "next-server" and "filename" referenced here:
a. Install YaST2 DHCP Server (YaST/Software/Software Management, search on DHCP)
b. Once installed, launch DHCP Server from YaST (YaST/Newtork Services/DHCP Server)
c. We used the DHCP Server wizard, and in Step 1 of 4 (Card selection) Select desired adapter, click Select and then Next.
d. For Steps 2 and 3, enter the appropriate information:

dhcp_step2At the end of step 4 in the DHCP Server wizard, click When Booting and then DHCP Server Expert Configuration.
dhcp_step4
After you're in DHCP Server Expert Configuration, click Expert Settings and then Yes:
expert_settings
Then select the subnet and click Edit.
pxe server on SLES 11 - The Dell TechCenterClick Add, select next-server (input TFTP server IP)
Click Add, select filename and input "pxelinux.0" for the value.

When finished, it should look like:

pxe server on SLES 11 - The Dell TechCenterClick OK, and then Finish

11. Create directory structure for TFTP server:

mkdir -p /tftpboot/pxelinux.cfg 
mkdir -p /tftboot/sles/11/x86_64

12. Copy the necessary files for boot to the TFTP server directory structure: 

cp /srv/www/htdocs/sles/11/x86_64/boot/x86_64/loader/linux /tftpboot/sles/11/x86_64cp /srv/www/htdocs/sles/11/x86_64/boot/x86_64/loader/initrd /tftpboot/sles/11/x86_64
13. Verify syslinux is installed (YaST/Software Management - search on syslinux, make sure gfxboot and syslinux both are installed).

14. Per /usr/share/doc/packages/syslinux/pxelinux.txt, copy prelinux.0 to /tftboot/ structure: 

cp /usr/share/syslinux/pxelinux.0 /tftpboot/

15. For menu-driven prompts on client boot, copy menu.c32 to tftboot (usr/share/syslinux): 

cp /usr/share/syslinux/menu.c32 /tftpboot/

16. Edit /tftpboot/pxelinux.cfg/default to input desired menu options. Here is an example of what we did here (Attached file at the bottom of the page as well):

pxe server on SLES 11 - The Dell TechCenterOur TFTP server boot directory looked like this after we were done:

pxe server on SLES 11 - The Dell TechCenter17. Now its time to boot the client!

On our PowerEdge R710, we hit F12 when we saw this screen:
pxe server on SLES 11 - The Dell TechCenter

The client grabs IP and finds the PXE server:

pxe server on SLES 11 - The Dell TechCenterSuccessful transfer to our Menu (default file under /ftptboot/pxelinux.cfg/)
pxe server on SLES 11 - The Dell TechCenter

SUSE Installation Menu: