You will need access to a UNIX/Linux system and a copy of the base ESXi 5 ISO image. In this example I will be using VMware vMA and VMware-VMvisor-Installer-5.0.0.update01-623860.x86_64.iso and walk you through two different configurations. We will also be referencing the vSphere documentation Create an Installer ISO Image with a Custom Installation or Upgrade Script and Kernel Boot Options.
Create ESXi 5 Bootable ISO w/Remote ks.cfg:In this configuration, we will create a custom ESXi ISO that will boot with a static IP Address and use a remote ks.cfg (kickstart) configuration file.
Step 1 - Mount base ESXi ISO using the "mount" utility:
$ mkdir esxi_cdrom_mount
$ sudo mount -o loop VMware-VMvisor-Installer-5.0.0.update01-623860.x86_64.iso esxi_cdrom_mount
Step 2 - Copy the contents of the mounted image to a local directory called "esxi_cdrom":
$ cp -r esxi_cdrom_mount esxi_cdrom
Step 3 - Unmount the ISO after you have successfully copied it and change into the esxi_cdrom directory
$ sudo umount esxi_cdrom_mount
$ cd esxi_cdrom
Step 4 - Edit the boot.cfg and specifically the "kernelopt" line to not use the weasel installer but kickstart and also specifying the remote location of your ks.cfg. To get more details on the various kernel boot options, please take a look at the vSphere Boot Options documentation above.
You will also need to specify the static IP Address you wish to have the host automatically use when the ISO first boots up on the same line.
$ sudo mkisofs -relaxed-filenames -J -R -o custom_esxi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table esxi_cdrom/
Create ESXi 5 Bootable ISO w/Local ks.cfg:Similar to the above configuration, we will create a custom ESXi ISO that will boot with a static IP Address but use a local ks.cfg (kickstart) configuration file that will be included within the custom ISO.
Step 1 through 3 is exactly the same as above
Step 4 - By default, a basic ks.cfg is included in the ESXi 5 ISO in /etc/vmware/weasel/ks.cfg and we will create a custom *.tgz file that will include our ks.cfg within the ISO. First off by creating a temporary directory which will be used to store our ks.cfg:
$ mkdir -p temp/etc/vmware/weasel
Step 5 - Copy your ks.cfg file into the temp/etc/vmware/weasel:
$ cp ks_custom.cfg temp/etc/vmware/weasel
Step 6 - Create a *.tgz file containing the path to our ks.cfg using the "tar" utility. In this example, we will called it customks.tgz:
$ cd temp
$ tar cvf customks.tgz *
Step 7 - Copy the customks.tgz from temp directory to your esxi_cdrom directory:
$ cp temp/customks.tgz esxi_cdrom
You now have a new bootable ESXi 5 ISO called "custom_esxi.iso" which will now automatically boot up with the specified static IP Address and install based on the ks.cfg that is included within the ISO.