HowTo - Quick setup a PXE-Server to boot the zos-boot-script

Since I noticed in the chat, that some have problems to boot the nodes via PXE I thought I share my experience because I successfully boot my nodes via PXE.

With help from Raffi my very old friend I did this steps a time ago and it works like a charm.

If you just run the script at the bottom of this post you can have the pxe-server up and running in 5 minutes. you just need to copy it to a container or a VM and run it there. After that you have to config your DHCP-Service.

Setup the LXC container or VM (this step is a bonus and can be overjumped)

This step will be different for you, but I show this cause its super easy in PROXMOX and I really recommend it for your private playground at home :wink:

First you have to download the LXC container you wish

Create an LXC container and follow the creation fill-ins:
image


image
the steps will will be self-explanatory, just make sure its a static IP or a static given via DHCP over the mac-address!

Once created you can see the mac here, as you can see I send a static IP lease via DHCP:

This can be done in opnsense via DHCP Static Mappings:

Install PXE-Server Stuff

This is quite the easiest step.

As I used an old debian buster LXC Container I had to do following steps:

mv /etc/apt/source.list /etc/apt/source.list.backup
echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/source.list
echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/source.list 
echo "deb http://deb.debian.org/debian-security/ buster-security main" >> /etc/apt/source.list 
echo "deb-src http://deb.debian.org/debian-security/ buster-security main" >> /etc/apt/source.list 
echo "deb http://deb.debian.org/debian buster-updates main" >> /etc/apt/source.list 
echo "deb-src http://deb.debian.org/debian buster-updates main" >> /etc/apt/source.list

Install tftp server:

apt-get update
apt-get install tftpd-hpa

Download bootfiles:

cd /srv/tftp/
wget http://ftp.nl.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz
wget http://ftp.nl.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/pxelinux.0

Untar and remove unused files:

tar -xvzf netboot.tar.gz
rm version.info netboot.tar.gz
rm pxelinux.cfg/default

Download and move tf bootfile, dont forget to fill in your farm id:

This wget url is preconfigured to download the productive bootfile, so if you want to change that change “prod” to either dev or test.

wget https://bootstrap.grid.tf/krn/prod/<FARM-ID> --no-check-certificate
mv <FARM-ID> ipxe-prod.lkrn
echo 'default ipxe-prod.lkrn' >> pxelinux.cfg/default

Configure your DHCP

I use Opnsense as my router, firewall, dhcp and for nearly everything on my network I surely love it! So thats why i show this steps on opnsense, but on any dhcp server it should pretty the same.

Navigate to DHCP:

there enable the “network booting” and configure your pxe-server as “next-server IP”, last configure “pxelinux.0” as the default bios filename.

Don’t use TFTP-Server although we set up tftp on debian. This is the mostly done mistake here!

Make sure your nodes are in the same network as your DHCP server. If yes they will get leased the new network boot informations via DHCP, and the Node will ask the TFTP to send the tf bootscript which we copied onto our tfp path on debian. In detail it asks for pxelinux.0 but in the config of pxelinux “pxelinux.cfg/default” we wrote our tf bootscript " ipxe-prod.lkrn"
as default bootoption.

Maybe this helps a bit to understand:
image

The whole script to install PXE and download your tf bootfile

this is preconfigured to download the productive bootfile, so if you want to change that go to the wget command with “https://bootstrap.grid.tf/krn/prod/$farmid” and change “prod” to either dev or test

#!/bin/bash
# optional i did that because i use buster and the container needed it:
mv /etc/apt/source.list /etc/apt/source.list.backup
echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/source.list
echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/source.list 
echo "deb http://deb.debian.org/debian-security/ buster-security main" >> /etc/apt/source.list 
echo "deb-src http://deb.debian.org/debian-security/ buster-security main" >> /etc/apt/source.list 
echo "deb http://deb.debian.org/debian buster-updates main" >> /etc/apt/source.list 
echo "deb-src http://deb.debian.org/debian buster-updates main" >> /etc/apt/source.list

# input farm id for your tf bootstrap file
echo INPUT FARM ID
read farmid

# install tftp server
apt-get update
apt-get install tftpd-hpa
# download bootfiles
cd /srv/tftp/
wget http://ftp.nl.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz
wget http://ftp.nl.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/pxelinux.0
wget https://bootstrap.grid.tf/krn/prod/$farmid --no-check-certificate
mv $farmid ipxe-prod.lkrn
tar -xvzf netboot.tar.gz
rm version.info netboot.tar.gz
rm pxelinux.cfg/default
echo 'default ipxe-prod.lkrn' >> pxelinux.cfg/default
5 Likes

Thank you @flowmotion for sharing your experience and knowledge, it will certainly help the community. :slightly_smiling_face: :slightly_smiling_face:

1 Like

I just realized nelson did also a tutorial about this topic, he uses a little bit other approach.

1 Like