December 2009
November 2009
October 2009
September 2009
June 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
July 2008
June 2008
October 2007
September 2007
In the middle of last year, I had a short post detailing booting the ESXi installer. Tom recently asked how one would PXE boot and kickstart the ESX installer. This is not much different than any other Red Hat Kickstart. I am going to assume you already have a working PXE booting environment using pxelinux and a FTP server set up to host the install media plus kickstart configurations.
The first thing to do is copy the contents of the install media to a location on your FTP server. If you have the install media in ISO form, it is as easy as this:
mkdir /mnt/esxinstall mount -o loop /path/to/esx.iso /mnt/esxinstall cp -r /mnt/esxinstall /var/ftp/pub umount /mnt/esxinstall rm -r /mnt/esxinstall
Verify that you can navigate the contents via FTP on another machine before continuing. Now that the media is accessible, we need the kernel and initial ram disk to boot from pxelinux. You will find both in the contents of the install media, in images/pxeboot, with the names vmlinuz and initrd.img. Copy these files somewhere in your tftpboot directory like so:
cd /var/ftp/pub/esxinstall/images/pxeboot cp vmlinuz initrd.img /var/lib/tftpboot/esx
Note that /var/lib/tftpboot is where tftpboot resides on Fedora 10, the distribution I am hosting everything in this example on. This may be different on your system. The next step is to make your kickstart configuration. The easiest way to get a starting point on this is to install ESX normally. After install, ESX stores a kickstart config based on the install in /root/anaconda-ks.cfg, like every other Red Hat derivative. ESX features some special kickstart options for VMware specific functions, like service console memory and virtual networking. Here is a minimal headless kickstart for ESX:
install lang en_US.UTF-8 langsupport --default en_US.UTF-8 keyboard us mouse genericwheelps/2 --device psaux skipx vmaccepteula # DHCP if you are doing multiple network --device eth0 --bootproto dhcp --addvmportgroup=1 --vlanid=0 rootpw this_is_too_easy firewall --enabled authconfig --enableshadow --enablemd5 timezone --utc America/Denver bootloader --location=mbr clearpart --exceptvmfs --drives=sda part /boot --fstype ext3 --size=100 --ondisk=sda --asprimary part / --fstype ext3 --size=1800 --grow --maxsize=5000 --ondisk=sda part swap --size=544 --grow --maxsize=544 --ondisk=sda part /var/log --fstype ext3 --size=500 --grow --maxsize=2000 --ondisk=sda part local --size 1 --ondisk=sda --fstype vmfs2 --grow %packages grub %post # Put whatever commands you would like to run at the end here, # Just like in other Kickstarts
Put your kickstart somewhere available from your FTP, like /var/ftp/pub/esxinstall/headless.cfg. For the final ordeal, we need to add a entry in pxelinux.cfg/default or similar, so our machines can PXE boot. Here is what it might look like:
label esx
kernel esx/vmlinuz
append initrd=esx/initrd.img ramdisk_size=7268 ksdevice=eth0 ip=dhcp \
method=ftp://yourftpserver/esxinstall ks=ftp://yourftpserver/esxinstall/headless.cfg
This will give you headless installs. NOTE: Do not include the backslashes and line breaks in your append line of your pxelinux entry. These are only here for readability's sake. Here is an explanation of the append options.
- ksdevice If you have multiple nics, you can tell anaconda which to use during the first install phase.
- ip Tell anaconda how to configure networking for this install.
- method = URL to your media.
- ks = URL to your kickstart configuration.
If you are like me, then you want to use network booting for everything, especially installs. PXE booting the VMware installer with pxelinux is much easier than I thought it would be. First, copy the entire contents of the installer CD to your tftp directory. I copied mine to /tftpboot/esxi/3.5.
Now, open your pxelinux.cfg/default. Add this entry, changing the path to each of the components to coincide with where you placed the files within your tftp directory.
label esx35i kernel esxi/3.5/mboot.c32 append esxi/3.5/vmkernel.gz --- esxi/3.5/binmod.tgz --- esxi/3.5/ienviron.tgz --- \ esxi/3.5/cim.tgz --- esxi/3.5/oem.tgz --- esxi/3.5/license.tgz --- esxi/3.5/install.tgz
That's all you have to do.
You may also want to look at the post on PXE booting and kickstarting the ESX installer.
