fully hardware-independent unattended ESX3 Server installation – Part 1

This article will show you how to build an unique installjob for unattended ESX3 installations. It will run on different hardware plattforms.

The process of setting up an VMware ESX3 Host ist quite similar to RHEL3/Centos3. I’m using Altriris Deployment Server (or HP Rapid Deployment Pack) but IMHO you could easily customize it for any other deployment solution.

The main steps are:
1. create a bootable dos partition with all necessary files for booting up the linux installer with loadlin – or linld.
2. create bootentries depending on your physical hardware (Proliant, PowerEdge Server…)
3. create a custom kickstart (ks.cfg) file which uses hostname and ip you entered in you deployment server console.
4. create virtual switches, portgroups etc. depending on your enviroment.
5. install further Managmentsoftware (e.g.: Openmanage, Proliant Support Pack), Backup- or Monitoringagents

Step One:
Deploy an empty FAT32 partition to you deploment client. Mine is 100MB, but it can be much smaller – you can use rdeploy. Reboot your maschine.
The install01.bat file attached is copying the needed files from deplomentserver share.

copy %OSFilesPath%\dosutils\loadlin.exe c:\loadlin.exe
copy %OSFilesPath%\dosutils\linld.com c:\linld.com
copy %OSFilesPATH%\dosutils\autoboot\initrd.img c:\initrd.img
copy %OSFilesPATH%\dosutils\autoboot\vmlinuz c:\vmlinuz

echo dos2unix.exe ks.cfg > C:\autoexec.bat

Step 2:
Now you have to create a custom bootentry for your linux loader. The main problem is that the ks.cfg will be located on hardware and the devicenames differ from vendor to vendor (e.g. /dev/cciss/c0d0 for HP with SmartArray – /dev/sda for MegaRaid). Be aware that the 9th generation of PowerEdge Server (PE1950, PE2950…) will not work with loadlin. Nobody really knows why, but I found it here.

install02.bat does make the decision for you what server hardware you’ve got:

if "%#!computer@right(prod_name,4)%" =="2850" goto sda
if "%#!computer@right(prod_name,4)%" =="2950" goto sdalld
if "%#!computer@right(prod_name,2)%" =="G4" goto cciss

REM if nothing ins found make sda entry
goto exitsda

:sda
echo i boot from sda
echo c:\loadlin c:\vmlinuz initrd=c:\initrd.img ramdisk_size=12288 ks=hd:sda1/ks.cfg >> c:\autoexec.bat
goto Exit

:sdalld
echo i boot with linld from sda
echo c:\linld.com image=c:\vmlinuz initrd=c:\initrd.img "cl=ramdisk_size=12288 ks=hd:sda1/ks.cfg" >> c:\autoexec.bat
goto Exit

:cciss
echo i boot from cciss
echo c:\loadlin c:\vmlinuz initrd=c:\initrd.img ramdisk_size=12288 ks=hd:cciss/c0d0p1:/ks.cfg >> c:\autoexec.bat
goto Exit

:exitsda
echo i boot from sda
echo c:\loadlin c:\vmlinuz initrd=c:\initrd.img ramdisk_size=12288 ks=hd:sda1/ks.cfg >> c:\autoexec.bat
goto Exit

:Exit
exit

The strange looking “%#!computer@right(prod_name,4)%” is Altiris DS specific. It’s reading out the vendor description for the Server presented at PXE Boot. This will differ to other Deployment solutions.
Now reboot you maschine and make C:\ drive bootable (install03.bat) and copy further files.

f:\bootwiz\dos\sys.com f:\bootwiz\dos c:
f:
copy f:\bootwiz\dos\himem.sys c:\
copy f:\bootwiz\dos\smartdrv.exe c:\
echo device=c:\himem.sys>>c:\config.sys
echo @echo on>>c:\autoexec.bat

Step3a: create ks.cfg file

The ks.cfg file is the answer file for the ESX Installer. If you are not familar with the kickstart procedure you can fancy it as an unattended.txt or winnt.sif file for Windows Installations. :) The main difference is that you also define package source (in my case a webserver with the hole cd copied to “http://webserverurl/esx3″ and partition scheme. The important section begins at %post and process self written scripts after the installation. I’m using it for creating virtual networks, installing the altiris (adl)agent and some small jobs.

You can easily create a ks.cfg file with installing ESX Server one time manually. The specified options are written to /root/anaconda-ks.cfg. For further information about kickstartfile consult VI Installation guide.

Step3b: Token Replacement Process
The Replacement Process is also Altris DS specific und uses for creating a machine specific kickstart file. It is replacing placeholders with the values you entered in Deployment Server Console. Because there is no Token for VMKernel network ip, I’m using the os license entry for it. Do not remove any “rem”ed line. – the Token Replacement will not work.

rem bootwork unload

rem replacetokens .\deplmes\deploy\pre-os\esx3\ks.cfg .\deplmes\deploy\pre-os\esx3\%ID%.cfg
Firm Copy F:\deplmes\deploy\pre-os\esx3\%ID%.cfg C:\ks.cfg
Firm Copy F:\deplmes\centos\unixdo16\dos2unix.exe C:\dos2unix.exe

After the Token Replacement process you installation is ready to be booted to production. This will start the installer with the ks.cfg file. Good luck!

You will find more information about step 4 and step 5 in the next Blog-entry “fully hardware-independent unattended ESX3 Server installation – Part 2″. This will be published in the next days.

Attachments:
install01.bat
install02.bat
install03.bat
Kickstart file ks.cfg

Leave a Reply

Spam Protection by WP-SpamFree