Multi-PXE Install Server | SUSE Communities

Multi-PXE Install Server

Share
Share

I build a lot of SUSE Enterprise Storage Clusters and am always working to improve the deployment times. In the past, I setup a PXE server to handle my BIOS based x86 environment, but given that we are now in a multi-architecture environment that supports both X86_64 and ARMv8 platforms with both BIOS and EFI, it is necessary to make this environment support all of them.  In this article, I’ll cover setting up a multi-architecture PXE environment for installation of the operating system and include the components I normally host on the installation server.

System Requirements

You really don’t need much, but drive space, a few GB of RAM, and two network connections for a reasonable install server.  In regards to the drive space, I suggest reserving a few hundred GB as I also make this the SMT server that the deployment will use in an ongoing manner and you will be mirroring updates for the architectures in question in addition to the installation repos.

Install the OS

To start all of this off, you will need to install SUSE Linux Enterprise Server 12 SP2 on a system (virtual or physical).

On the registration screen, I suggest clicking in the upper right and configuring the network.  I have two interfaces; one for the public network with access to the internet, and one for the cluster network.  I tend to deploy using the cluster network for several reasons:

  • Should be a private network just for the storage systems and thus, no conflict with other DHCP servers or PXE servers
  • Generally is faster than the public network, 40GbE in the case of the environment I am working with.

When it gets to the screen where you verify the options, I always go into the software selection and de-select gnome desktop environment and x-windows.  For this, you are also safe deselecting 32-bit compatibility libraries.

Setup NTP Server

This is used to act as an authoritative time source in my installations.  Simply start Yast, select NTP server and configure it to start at boot.  Under security settings, select Open Port in Firewall and then select OK.  When you use the install server, you can point the systems being deployed back to it for time sync.

Setup DHCP Services

First, go into YaST and select DHCP server from network services and configure the IP range you wish to use.  After that, it is your choice on whether you use YaST or edit the configuration file (/etc/dhcpd.conf) by hand.  As with the other services, be sure to open the ports in the firewall.  The end result needs to be a file that looks like what is below.

option domain-name "my.lab";
option domain-name-servers 172.16.253.5;
option routers 192.168.124.1;
option ntp-servers 192.168.124.3;
option arch code 93 = unsigned integer 16; # RFC4578
default-lease-time 3600;
ddns-update-style none;
subnet 192.168.124.0 netmask 255.255.255.0 {
  range 192.168.124.100 192.168.124.199;
  next-server 192.168.124.3;
  default-lease-time 3600;
  max-lease-time 3600;
  if option arch = 00:07 or option arch = 00:09 {
   filename "/EFI/x86/bootx64.efi";
    } else if option arch = 00:0b {
   filename "/EFI/armv8/bootaa64.efi";
    } else {
   filename "/bios/x86/pxelinux.0";
    }
}

I am sure you’ve noticed the if option arch sections.  These are what allow the DHCP server to make the correct decision on which file to use for booting.

Setup Repositories

This step creates the installation source directories.  I suggest using a structure like this: /srv/install/arch/product/version.

For this article, we have the following:

/srv/install/x86/sles12/sp2/cd1
/srv/install/armv8/sles12/sp2/cd1

Next, you need to mount the install media into the appropriate location.  Be sure to add it to /etc/fstab for persistance between reboots

mount -o loop /root/sles12sp2.iso /srv/install/x86/sles12/sp2/cd1/

Do the same for each architecture’s boot media.

The final part of setting up the repositories is to export them. I prefer to use NFS myself, although there are other supported methods such as HTTP, FTP, etc.  First, enable the NFS server through Yast and select Open Port in Firewall.  In this instance, I export the entire /srv/install structure as seen in the sample /etc/exports entry below.

/srv/install  *(ro,root_squash,sync,no_subtree_check)

Setup TFTP

This step simply enables the tftp server.  To perform this step, I simply start Yast, and select TFTP Server, found in Network Services.  The system then prompts to install tftp.  Next I simply select enable, leave the image directory at /srv/tftpboot, select Open Port in Firewall, and select OK.

Setup PXE Boot

This is where the rubber really meets the road. Getting all the right files in the right places allows you to add more architectures, OS install options, etc.  If you’re going to make a typo, this is probably where it will happen.

The first thing I do is make a structure in /srv/tftpboot to support the various options.

mkdir /srv/tftpboot/bios
mkdir /srv/tftpboot/bios/x86
mkdir /srv/tftpboot/EFI
mkdir /srv/tftpboot/EFI/x86
mkdir /srv/tftpboot/EFI/x86/boot
mkdir /srv/tftpboot/EFI/armv8
mkdir /srv/tftpboot/EFI/armv8/boot

Setup the x86 BIOS boot environment

At this point, you need to copy necessary boot files for the x86 BIOS environment to the appropriate boot location.  This is easiest to do if you navigate to the appropriate directory as seen below.

cd /srv/install/x86/sles12/sp2/cd1/boot/x86_64/loader/
cp -a linux initrd message /srv/tftpboot/bios/x86/

While still in the loader directory, make the directory for the config file and copy it in.

mkdir /srv/tftpboot/bios/x86/pxelinux.cfg
cp -a isolinux.cfg /srv/tftpboot/bios/x86/pxelinux.cfg/default

The next step is to copy pxelinux.0 to the same structure.

cp /usr/share/syslinux/pxelinux.0 /srv/tftpboot/bios/x86/

Now that the files are all in place, it is time to edit the configuration to get all the correct boot options in place.  Start with editing /srv/tftpboot/bios/x86/pxelinux.cfg/default. My example is here:

default harddisk

# hard disk
label harddisk
  localboot -2
# install
label install
  kernel linux
  append initrd=initrd showopts install=nfs://192.168.124.3/srv/install/x86/sles12/sp2/cd1

display message
implicit 0
prompt 1
timeout 600

Next you should edit /srv/tftpboot/bios/x86/message to reflect the default file you just edited. My example is below.

                           Welcome to the Installer Environment! 

To start the installation enter 'install' and press <return>.

Available boot options:
  harddisk   - Boot from Hard Disk (this is default)
  install     - Installation

Have a lot of fun...

Setup the x86 EFI boot environment

Start by copying the files required for UEFI booting of a grub2-efi environment.

cd /srv/install/x86/sles12/sp2/cd1/EFI/BOOT
cp -a bootx64.efi grub.efi MokManager.efi /srv/tftpboot/EFI/x86/

Next copy the kernel and initrd to the directory structure.

cd /srv/install/x86/sles12/sp2/cd1/boot/x86_64/loader/
cp -a linux initrd /srv/tftpboot/EFI/x86/boot

Now, you will need to create a grub.cfg file.  This file goes in /srv/tftpboot/EFI and should have contents similar to below.

set timeout=5
menuentry 'Install SLES12 SP2 for x86_64' {
 linuxefi /EFI/x86/boot/linux install=nfs://192.168.124.3/srv/install/x86/sles12/sp2/cd1
 initrdefi /EFI/x86/boot/initrd
}

Setup the ARMv8 EFI boot environment

This is done in a way very similar to the x86_64 EFI environment. Start by copying the files required for UEFI booting of a grub2-efi environment.

cd /srv/install/armv8/sles12/sp2/cd1/EFI/BOOT
cp -a bootaa64.efi /srv/tftpboot/EFI/armv8/

Next copy the kernel and initrd to the directory structure.

cd /srv/install/armv8/sles12/sp2/cd1/boot/aarch64
cp -a linux initrd /srv/tftpboot/EFI/armv8/boot

Now, you will need to edit the grub.cfg file and add a section.  This file is in /srv/tftpboot/EFI.  You should add contents similar to below.

menuentry 'Install SLES12 SP2 for SoftIron OverDrive' {
 linux /EFI/armv8/boot/linux network=1 usessh=1 sshpassword="suse" \
   install=nfs://192.168.124.3/srv/install/armv8/sles12/sp2/cd1 \
   console=ttyAMA0,115200n8
 initrd /EFI/armv8/boot/initrd
}

This addition to the config file has a few other options to enable the serial console and allow installation via ssh, which is helpful for systems that do not have a standard KVM console interface.  You’ll notice that this is specifically setup for a specific ARM platform

Setup SMT

The SMT service is invaluable in that it provides a local repository mirror for updates to your software.  Follow the instructions here to install and configure SMT.  Be sure to select both the pool and update repositories for each product you are supporting with this server.

Ready to Roll!

At this point, you are ready to roll and use the installation server for BIOS and EFI on x86 and EFI on ARMv8.  Be sure to select the SMT server as the registration server during install.  Further goodness can be had by building custom autoyast files as well.  These files can enable a streamlined installation process and perhaps even an unattended process if everything is well enough defined.

I hope this guide has been helpful, and if you have some tips, tweaks, etc that you would add to this, please comment!

Share

Comments

  • Avatar photo ds_prashanth says:

    This is a life saver, thank you David. Am also trying to include a autoyast entry to make this installation a unattended one, could you please help me with the entry that need to be made in grub.cfg file. I have tried many things but nothing seems to work. Could you please help me with this ?

    • Avatar photo davidbyte says:

      Thanks for the comment, the goal was definitely to put something very useful out there. Just for the record, I updated the NFS options to include crossmnt so that re-exports work correctly for ISO images.

      As for autoyast, the answer is quite easy, you edit the kernel command line in the grub.cfg and/or pxelinux.cfg/default and add autoyast= e.g. autoyast=tftp://172.16.250.2/myserver.xml.

  • Avatar photo frank hollmann says:

    Use Case: unattended install for many servers in parallel:
    If i use pxelinux.0 (aka bios boot), a machine-related config-file (ip-adress in hex) can be used. Problem solved.

    WIth efi-boot i have grub.cfg. Is there a possibility to use a machine-related config file, for example based on the ip-adress?

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    Avatar photo
    10,084 views