Jan 25 2008

Multi-OS Installation: Configuring the Solaris Environment

This article will discuss configuring Intel and Sparc Solaris for use in the Multi-OS installer. On successful boot of the intel media, the user will be greeted by the Solaris, blue and green text installer as if they had booted off of CD or DVD media. Sparc Solaris will require a bit more work as it makes use of native boot files and images.

Configuring Intel Solaris is similar to Linux. The low level startup boot process is the same as Windows and Solaris, mainly the use of a PXE loader to start the process, however in order to keep the top level menuing consistent for the client, and to work around a dhcpd configuration issue, it was required to chain together Sun’s version of PXEgrub with PXELinux.

In both the Intel and Sparc cases, a request to boot is dropped on the wire, the dhcpd server accepts the request and issues a reply packet containing the IP address for the PXE client, the IP address of the next server to speak to, and the filename that the PXE client needs to request, still PXELinux for the first stage. For Sparc Solaris, the filename that the bootloader needs to request is not a PXE loader, but instead is the actual Solaris supplied boot file.

The operating system makes use of the PXE Loader configuration. Please go read that post if you have yet to do so as general configuration details are described in that article.

Please take note that a conscious design decision was made at this point to chain the bootloaders to present a mostly unified menu system to the end user. It is possible to create an Intel Solaris stanza in the dhcpd.conf and add the mac addresses of each host that would need to boot off of pxegrub instead of pxelinux. However, this would require the modification of the configuration and restarting of the dhcpd service for each new intel host added.

Since, in the environment, there were an exceptionally small number of Sparc hosts to be installed, and new Sparcs were added intermittently at best, it was considered more desirable to touch the dhcpd files only for the Sparcs rather than the often multiple installs/day required of the Intel machines. This would then allow the scheduling of dhcpd restarts during a maintenance window.

There was one modification made to the dhcpd.conf file which needs to be made regardless of the architecture. The following option statements need to be added to the file somewhere near the PXElinux lines that were added to support PXE booting.

option SUNW.root-mount-options code 1 = text;
option SUNW.root-server-ip-address code 2 = ip-address;
option SUNW.root-server-hostname code 3 = text;
option SUNW.root-path-name code 4 = text;
option SUNW.swap-server-ip-address code 5 = ip-address;
option SUNW.swap-file-path code 6 = text;
option SUNW.boot-file-path code 7 = text;
option SUNW.posix-timezone-string code 8 = text;
option SUNW.boot-read-size code 9 = unsigned integer 16;
option SUNW.install-server-ip-address code 10 = ip-address;
option SUNW.install-server-hostname code 11 = text;
option SUNW.install-path code 12 = text;
option SUNW.sysid-config-file-server code 13 = text;
option SUNW.JumpStart-server code 14 = text;
option SUNW.terminal-name code 15 = text;

These vendor specific lines assign human readable names to the various SUNW codes that are used to set various parameters such as the root path, the swap file, and the like.

The pxelinux menu entry needs to be changed to point to the location of the Sun PXEgrub file placed in the boot tree, and a menu.lst file will need to be created to support that bootloader. The single Solaris entry in my environment looks like this:

label solaris
kernel /boot/grub/pxegrub.0

In my boot directory you can find a grub directory containing the files pxegrub.0 and menu.lst. The menu.lst file is grub’s version of the default entry. It must always be named menu.lst either via the actual filename or through a tftp filename remap. After reading through the Solaris pxegrub source it seems highly likely that this filename cannot be changed via a vendor ID code in the dhcpd.conf file despite what the manpages say.

The three line Solaris 10 entry in my sample menu.lst looks like:

title Solaris 10 Interactive
kernel /images/SOL_10_U3_x86_64/boot/multiboot kernel/unix – install nowin dhcp -B install_media=172.16.32.16:/export/install/images/SOL_10_U3_x86_64
module /images/SOL_10_U3_x86_64/boot/x86.miniroot

The first line is the title as it will appear in the grub menu. The second describes the kernel file to load including all switches passed to the kernel. Given the strange wrapping, please take note that the line ends with the install_media stanza found in the SOL_10_U3_x86_64 directory. Finally, the final line specifies the module the kernel will need to load in order to run properly.

For an Intel installation, the prep work is completed and there remains only the image to prepare. For the sparc image, the dhcpd.conf file will need to be edited each time a new sparc host is added and the following stanza will need to be added and/or updated:

group {
vendor-option-space SUNW;
option SUNW.JumpStart-server “172.16.32.16:/export/JS/sol8/configs”;
option SUNW.install-server-hostname “gorgon”;
option SUNW.install-server-ip-address 172.16.32.16;
option SUNW.install-path “/export/install/images/SOL_9_U8_x86″;
option SUNW.root-server-hostname “gorgon”;
option SUNW.root-server-ip-address 172.16.32.16;
option SUNW.root-path-name “/export/install/images/SOL_9_U8_x86/Solaris_9/Tools/Boot”;
next-server 172.16.32.16;

host solclient01 {
hardware ethernet 00:0c:29:e3:e9:94;
fixed-address 172.16.33.69;
option host-name “solclient01″;
option SUNW.sysid-config-file-server=”172.16.32.16:/export/install/jumpstart”;
}
}

Each new sparc addition will require the addition of a new host substanza in this group. You’ll need to gather the mac address of the new host as well as assign it a static IP address. Once the configuration file has been updated, simply restart dhcpd and the configuration changes are complete. As a side note, installations were done using a small preallocated pool of statics outside the dhcpd range and then the host was reconfigured once the installation was complete.

Now that dhcpd has been setup, we can setup the images. Substitute x86_64 with SPARC as appropriate in the examples. Note that the solaris media comes on DVDs and so there is only a single image to copy.

mkdir /export/install/images/SOL_10_U3_x86_64 # or the path for the real vers.
mkdir -p /mnt/{1,2,3,4…N} # one per ISO
mount -o loop /path/to/iso/SOL_10_U3_x86.iso /mnt/1
…
mount -o loop /path/to/iso/SOL_10_U3_x86.iso /mnt/N
.
tar -C /mnt/1 cpvf – | tar -C /export/install/images/SOL_10_U3_x86_64/ -xpf -

When finished, in /export/install/images/SOL_10_U3_x86/ directory you should have the following directories: boot, Solaris_10, and a Copyright and installer file. Note that there is only a single ISO released from Sun. If the host is 64 bit capable the Solaris OS will boot in 64 bit mode. If the host is only 32 bit capable the OS will boot on its 32 bit kernel. The directory naming of _64 was chosen to remain consistent with the other directory names.

Next confirm that the boot/ directory contains the files you supplied paths to in the grub menu.lst, mainly multiboot and x86.miniroot:

ls -al /export/install/images/SOL_10_U3_x86_64/boot/
grep boot /export/install/boot/menu.lst

And that concludes all of the image prep necessary. The next item to configure is the apache server to ensure it can serve the http content from the /export/install mountpoint. To do so we need to edit the configuration of apache and add a section allowing the webserver to find our content at /images/. Edit the httpd.conf and add the following in an appropriate location, or use this snippet to create a new file uniquely named along the lines of install.conf in the httpd/conf.d directory, if present.

Alias /images/ /export/install/images/
< directory >
Options Indexes FollowSymLinks
AllowOverride Limit
Order allow,deny
Allow from all
< /directory >

Apache needs to then be restarted or HUP’ed for the configuration changes to take effect.

Unless the entire installation is being done over HTTP, Solaris also introduces the need for an NFS server for the image shares. How this is done will be dependent on your operating system, but assuming the nfs software is installed on the machine, in order to nfs export /export/install one needs to try one of the following:

Linux:
edit /etc/exports and add
/export/install *(ro)
service nfsd restart

Solaris:
edit /etc/dfs/dfstab and add
share -F nfs -o ro -d “Image Mounts” /export/install

All that is left now is to test the individual components:

First we need to make sure dhcpd is running:

ps -ef | grep dhcpd

Next we ensure apache is running:

ps -ef | grep httpd

Next ensure that nfsd is running:

ps -ef | grep nfs

Now we make sure that the repository is in proper order:

ls -al /export/install/boot/pxelinux # check for pxelinux
ls -al /export/install/boot/grub/pxegrub # check for pxegrub
ls -al /export/install/boot/grub/menu.lst # check for pxegrub’s menu file
ls -al /export/install/boot/default # check for the default menu file for your entry
ls -ald /export/install/images/SOL_10_U3_x86_64 # ensure the image is there
ls -ald /export/install/images/SOL_10_U3_x86_64/boot # should return 3 files: grub, multiboot, x86.miniroot

Now we make sure that tftp is working as expected (remember that tftp was chrooted to /export/install so everything will be relative to that path):

tftp localhost
cd images/SOL_10_U3_x86_64/boot/
get x86.miniroot

Next we ensure the apache is serving content properly.

wget http://localhost/images/SOL_10_U3_x86_64/boot/x86.miniroot

if, for some reason, you dont have wget on your server you can do it manually using telnet:

telnet localhost 80
HEAD /images/SOL_10_U3_x86_64/boot/x86.miniroot HTTP/1.0

Finally we test the NFS shares. Mount the filesystem on another machine if possible:

mount -o ro yourserver:/export/install /mnt
cd /mnt/images/SOL_10_U3_x86_64/boot
ls -al x86.miniroot

This essentially concludes the work required to net install a Solaris installation.

After finishing the configuration, all that is left is to reboot the machine and netboot using the F12 key, and then select the newly added menu entry from the pxelinux menu when prompted. Grub will then start and present its menu to you. From there select the entry you desire and then just wait until you reach the Solaris blue and green configuration screens.

Again, If you have any problems or questions, drop me a line and I’ll see what I can do to help. If there is interest in the topic, moving from an interactive installation to the configuring of jumpstart may be discussed in a later article should there be interest in the topic. If this article sounds familiar it is because I followed the guidelines I established in the Linux article. ;)

>>> Karl

No responses yet

Jan 22 2008

Multi-OS Installation: Configuring the Linux Environment

This article will discuss configuring a RHEL image for use in the Multi-OS installer. On successful boot, the user will be greeted by the text installer as if they had booted off of CD or DVD media. Other Linux variants are likely easily adaptable but were out of scope for the project that was delivered to the client.

Configuring Linux is nowhere near as complex as the Windows environment. The low level Linux boot process is the same as Windows and Solaris, mainly a PXE request is dropped onto the wire. The dhcpd server accepts the request and issues a reply packet containing the IP address for the PXE client, the IP address of the next server to speak to, and the filename that the PXE client needs to request. The filename passed to the client used is the pxelinux bootloader which has been described in detail elsewhere.

The operating system makes use of the PXE Loader configuration. Please go read that post if you have yet to do so as general configuration details are described in that article.

The pxelinux menu entry needs to be updated to point to the linux kernel and an appropriate initrd stanza needs to be added to the menu entry as well. Substitute your own directory name for all instances of RHEL_4_U5_x86_32. That said, a sample entry in my environment looks like this:

label rhel4_32
kernel /images/RHEL_4_U5_x86_32/install/images/pxeboot/vmlinuz
append initrd=/images/RHEL_4_U5_x86_32/install/images/pxeboot/initrd.img nofb text noipv6 method=http://install/images/RHEL_4_U5_x86_32/install ksdevice=eth0

Remember that the tftpd server is chrooted to /export/install, so on the filesystem, the kernel resides in the base directory /export/install/images/RHEL_4_U5_x86_32/. The nomenclature used at the customer site allows multiple variants of RHEL 4 32 and 64 bit to live in the tree concurrently. Menu entries need only be added for each desired variant to install other versions.

Once the PXE menu entries have been added, the image can be prepared. This is nowhere near as complex as windows and requires only a few steps:

mkdir /export/install/images/RHEL_4_U5_x86_32 # or the path for the real vers.
mkdir -p /mnt/{1,2,3,4…N} # one per ISO
mount -o loop /path/to/iso/RHEL4-U5-i386-AS-disc1.iso /mnt/1
…
mount -o loop /path/to/iso/RHEL4-U5-i386-AS-discN.iso /mnt/N
# note, if you run out of loopback devices, add “options loop max_loop=256”
# to /etc/modprobe.conf and reboot.
tar -C /mnt/1 cpvf – | tar -C /export/install/images/RHEL_4_U5_x86_32/ -xpf -
…
tar -C /mnt/N cpvf – | tar -C /export/install/images/RHEL_4_U5_x86_32/ -xpf -

When finished, in /export/install/images/RHEL_4_U5_x86_32/ directory you should have the following directories: RedHat, SRPMS, install, images, isolinux, and a large number of README html files.

Confirm that the install/images/pxeboot directory contains a file called vmlinuz and the path matches what was indicated in the pxelinux menu entry and that the initrd.img is present in the same directory and that the paths to the images match:

ls -al /export/install/images/RHEL_4_U5_x86_32/install/images/pxeboot
grep RHEL_4_U5_86_32 /export/install/default

And that concludes all of the image prep necessary. The next item to configure is the apache server to ensure it can serve the http content as requested by the method= line of the menu entry. To do so we need to edit the configuration of apache and add a section allowing the webserver to find our content at /images/. Edit the httpd.conf and add the following in an appropriate location, or use this snippet to create a new file uniquely named along the lines of install.conf in the httpd/conf.d directory, if present.

Alias /images/ /export/install/images/
< directory >
Options Indexes FollowSymLinks
AllowOverride Limit
Order allow,deny
Allow from all
< /directory >

Apache needs to then be restarted or HUP’ed for the configuration changes to take effect.

All that is left now is to test the individual components:

First we need to make sure dhcpd is running:

ps -ef | grep dhcpd

Next we ensure apache is running;

ps -ef | grep httpd

Now we make sure that the repository is in proper order:

ls -al /export/install/boot/pxelinux # check for pxelinux
ls -al /export/install/boot/default # check for the default menu file for your entry
ls -ald /export/install/images/RHEL_4_U5_x86_32/ # make sure the RedHat dir is there
ls -ald /export/install/images/RHEL_4_U5_x86_32/install/images/pxeboot # should return 4 files: initrd.img, README, TRANS.TBL, vmlinuz

Now we make sure that tftp is working as expected (remember that tftp was chrooted to /export/install so everything will be relative to that path):

tftp localhost
cd images/RHEL_4_U5_x86_32/install/images/pxeboot
get vmlinuz

Next we ensure the apache is serving content properly.

wget http://localhost/images/RHEL_4_U5_x86_32/install/images/pxeboot/vmlinuz

if for some reason you dont have wget on your server you can do it manually using telnet:

telnet localhost 80
HEAD /images/RHEL_4_U5_x86_32/install/images/pxeboot/vmlinuz HTTP/1.0

This essentially concludes the work required to netboot a RHEL installer to the point where the user can make their desired selections to complete the installation.

After finishing the configuration, all that is left is to reboot the machine and netboot using the F12 key, and then select the newly added menu entry from the pxelinux menu when prompted. When the installer loads and begins the interactive installation you will need to walk through the installer options and answer any question.

If you have any problems or questions, drop me a line and I’ll see what I can do to help. If there is interest in the topic, moving from an interactive installation to the configuring of kickstart may be discussed in a later article should there be interest in the topic.

>>> Karl

No responses yet

Jan 21 2008

Multi-OS Installation: Windows Final Steps

This is my second attempt at writing this post. I was using ecto this morning for the last time while writing the first iteration of this post and when switching between html and text mode the app decided to eat the post for me. Hopefully this iteration will be as good as the first, if not better…

So, there are a few things left to do before we can attempt a network boot. Primarily we need to add/create the winnt.sif configuration file, update the binl daemon files and restart the daemon, and then we need to test the components to make sure that everything is in order.

An absolute minimal winnt.sif created by the addnewos.sh script looks like the following:

[data]
floppyless = "1"
msdosinitiated = "1"
; Needed for second stage
Orisrc="\\\\172.16.32.16\REMINST\\W50AA\i386"
OriTyp = "4"
LocalSourceOnCD = 1
;DisableAdminAccountOnDomainJoin = 1
[SetupData]
OsLoadOptions = "/fastdetect"
; Needed for first stage
SetupSourceDevice = "\Device\LanmanRedirector\172.16.32.16\REMINST\\W50AA"
[UserData]
ComputerName = *
FullName = *
OrgName = *
ProductID = *

Briefly, the [data] section specifies where the media will be coming from and what type it is. The [SetupData] stanza contains any arguments to be passed to the kernel, as well as establishing the source device from which setup is to pull the additional datafiles. The listed path corresponds to the samba share that was setup earlier.

Finally, the [UserData] section allows for the customization of the computer name, the user name, and the company name, as well as provide a slot to prefill the appropriate license key obtained from Microsoft.

This sif file will allow setup to execute in a fully interrogative mode, asking the user performing the install the same series of questions as if they’d used the CD media for the installation. There are quite a few options available for the sif file allowing for the full unattended installation of windows. If there is an interest I can expand on it in a future piece.

Once the w50aa.sif file is in place, we can go refresh the binlsrv.py database. Assuming the copies of binlsrv.py, infparser.py, and windirs.conf.sample were obtained from this site, this is accomplished by doing the following:

  • edit windirs.conf and add the new directory name, i.e. W50AA
  • run infparser.py
  • run binlsrv.py

With the binlsrv.py script running, we can begin to do the testing on the system. Of course you could at this point simply reboot the box you wish to install, cross your fingers, and hit F12 to netboot while hoping for the best. Those of you willing to use some methodology in their testing, please read on. Please note: I’m assuming the path to your install tree is /export/install/ and you have the windows image in images/W50AA. You’ll need to adjust it for your environment otherwise.

First we need to make sure dhcpd is running:

ps -ef | grep dhcpd

Next we ensure binlsrv.py is running;

ps -ef | grep binl

Now we make sure that the repository is in proper order:

ls -al /export/install/pxelinux	   # check for pxelinux
ls -al /export/install/default     # check for the default menu file for pxelinux
ls -ald /export/install/images/W50AA/i386 # make sure the i386 dir is there
ls -ald /export/install/images/W50AA/w50aa* # we should get 3 files back, w50aa, w50aa.0, w50aa.sif.

Now we make sure that tftp is working as expected (remember that tftp was chrooted to /export/install so everything will be relative to that path):

tftp localhost
cd images/W50AA/boot
get w50aa.sif

Now we ensure that the rewriting rules for the tfpd map files worked properly

grep W50AA /var/log/messages  # on linux
grep W50AA /var/adm/messages  # on solaris

You should have seen several log lines spit out as a match to the grep statement. If not, there is the possibility that the mapping isn’t working. Try a tail -f on the logfile and run a few tftp fetches by hand looking for the matches.

At this point the only thing left to do is the actual boot of the computer. So, reboot the test machine, netboot it, and if all goes well you will be greeted by the pxelinux menu. From there pick the entry you created for the windows installation and you will soon be greeted by the windows setup program.

Hopefully there is enough in here to allow you to troubleshoot any issues which you may run into. If this is not the case, please post in the comments and I’ll do what I can to assist you.

>>> Karl

No responses yet

Next »