The time has come for me to rebuild my home LAB and I have decided to start from scratch and build from the ground up. I plan to build it using as much automation and ways of streamlining the process as possible, just as you would want to do in a large scale deployment.
Starting with my main host which is the most powerful with dual 2.5GHz quad core Xeons and 32Gb RAM. I use USB sticks or SD cards in all my servers to host the ESXi operating system as it free’s up the disks for me to wipe as I please.
What you will need:
- USB stick, min 4Gb and fast enough for it to work or an equivalent SD/microSD card
- A copy of UNetbootin, availble from http://unetbootin.github.io/
- The ISO of ESXi which you will be using. As I have HP servers I use the HP customised image which has all the relevant drivers for storage controllers etc.
Step 1 – Prepare the USB
It is a good idea to format the USB stick before you use put the boot image on it. If you have previously used it as a boot device it will likely have numerous partitions on. The easiest way to remove them all in Windows is to open a command prompt as admin and use DiskPart to clean the drive.
Extreme caution should be excercised here, you have the potential to destroy data. Ensure that the selected disk is the USB drive and not one of your data drives. The easiest way to see this quickly is from the size of the disk.
Step 2 – Install the boot files to the USB
Run UNetbootin, select the Diskimage option and browse to the ESXi ISO image. Select the USB drive which you wish to use and click OK. Click Exit once finished, no need to reboot.
Step 3 – Modify the SYSLINUX.CFG file
This step updates the syslinux.cfg file created by Unetbootin
Find SYSLINUX.CFG and locate the following line:
Modify this line to:
Then add a new section to the file which matches below.
APPEND -c boot.cfg ks=usb:/ks.cfg
MENU LABEL Super Ghetto Install
Step 4 – Create a KickStart file
The final step is to create the kickstart file specifying the options you wish to automate. The following basic settings will accept the EULA, set the password and install the ESXi OS onto the USB drive which you used to boot from. The network settings will also be set to a static address.
install --firstdisk=usb-storage --overwritevmfs
keyboard 'United Kingdom'
network --bootproto=static --device=vmnic0 --ip=192.168.1.100 --netmask=255.255.255.0 --gateway=192.168.1.254 --nameserver=192.168.1.254 --hostname=ESX_6.0_01
A great starting point for kickstart settings is http://kb.vmware.com/kb/2004582.
Step 5 – Boot from USB
Now that everything is ready and you have put the updated files on the USB stick you can transfer this into your ESXi host and boot from it. The installer loads everything into memory first which is why it can happily install to itself.