After Mike Laverick posted his experience with ESX Server and USB flash disks in another thread, I decided to figure out how to make it work.
Here's a quick rundown on setting up a USB flash disk (ie. pen drive, flash key, etc.) to install ESX Server.
\- You will need at least a 1 GB USB flash disk.
\- You must have
boththe ESX 3.x CD-ROM and ISO image handy.
boot.isofile in the
/imagesdirectory on the ESX 3.x CD-ROM. Copy
boot.isointo a temporary directory on your hard drive.
boot.isofile to your USB flash drive. On my PC, it's the
updatecd.cfgfiles from the USB flash disk.
isolinux.cfgfile on the USB flash disk to
syslinux.cfgfile and add the keyword usbto the end of every line that begins with
append. Here's what the file should look like when you're done:
syslinux.zip file into another temporary directory on your hard drive.
cdcommand to navigate into the
win32directory. For example:
9. Now, run the syslinux program to apply the boot loader and boot sector to the USB flash drive:</p>
syslinux -s e:
( On my PC, my USB flash drive is mounted as drive E: )
10. Finally, copy the ESX 3.x ISO image onto the flash drive:
+copy c:\iso\esx-3.0.1-32039.iso e:\ +
11. Confirm that your USB flash drive contains the following files:
12. You're all set! Unplug the USB flash drive, configure the BIOS on your server to boot from USB accordingly, and boot 'er up!
13. The ESX installer will detect the USB device and whatever SCSI / disk controllers you have. When the installer asks you what the installation source will be, choose
Excellent post, I assume I could also embed a series of ks.cfg files onto the USB key and modify the syslinux.cfg to have entries to auto build a suite of ESX servers.
Now of to find my USB key
My thoughts precisely Michael.
Thanks a billion Paul for this - do you mind if I reference this for the book?
FYI... I've been working with PXE appliance that will deploy ESX - the only interaction required is an ILO and F12... comes with a menu. It will be in the book as well - although I plan to release the getting-started guide to it on RTFM... the original developer wants to add some ESX 3.x functionality - so we can create kickstart file using a wizard (which hopefully be better than VMware's...) and the option to hard-code scripts by MAC address for additional security...
My interest in this USB key is related to this as well...
Anyway, thanks once again -
ps thought it was best to thank you hear than extend a Windows Vs Linux flame on the other thread!!!!
Paul, you rock. Have you gotten any job offers based on the work you've done on this board? You have put out some amazing work.
Well, i gave that shot... got so far, but hit a road block. This might be down to my type of pen drive - which one of those SanDisk types which appears to have a protected/hidden 5MB CD-ROM style partition somewhere before the Pen drive itself which holds the software for the pen drive itself...
The HP DL385 G1 boots from the pen drive just fine. But when I get to the point where I would select the ISO file. What I actually get is:
This is on a server with a single LUN which I wiped especially for this test. I don't see a /dev/sdb - and although I've tried /dev/sdb and variants on this theme it doesn't seem to be finding the pen drive after booting from it...
I have a feeling it might be the SanCruiser. Might buy another 1GB stick that is more vanilla and try again...
I successfully setup ESX on my Verbatim memory key.
For reference I used:
Now to setup my KS files.
UPDATE: Fix for "BUG" in Anaconda installer script
I've discovered a "bug" in the
partitions.pyPython script that gets invoked by the Anaconda installer.
Right after you click on the "Agree" checkbox in the EULA screen, you're presented with a disk partitioning question: Recommended or Advanced. Regardless of which choice you make, the next screen normally presents the disk partition layout. In the case of this USB-based installer, though, Anaconda generates an unhandled exception (Traceback) and the installation aborts.
The failed Python module, partitions.py, normally attempts to "protect" the filesystem that houses the .ISO image for installation. However, in the case of a USB-based install, this protective mechanism fails and causes the installation to die ungracefully.
I've patched this module and re-integrated it back into the
hdstg2.imgfile. In order to apply this patch, you'll need to do the following:
1. Download the patch from: Warning: File is approx. 10 MB
2. Open up the esx .ISO file on your USB flash key using WinISO, MagicISO, etc.
3. Navigate into the
/VMware/basedirectory within the ISO file.
4. Delete the
hdstg2.imgfile in the /VMware/base directory.
5. Add the patched
hdstg2.imgversion back in.
6. Save the ESX .ISO back to the USB flash drive.
I tested the ESX install using a 1GB USB flash drive and the entire installation took less than 3 minutes.
Hope this helps!
PS. If you're a Linux guru and you would rather re-create the hdstg2.img file yourself, you can download just the patched Python script here:
It goes in the /usr/lib/anaconda/ directory within the hdstg2.img cramfs filesystem.
Message was edited by: Paul Lalonde
Note: All files contained in the hdstg2.img file fall under the GPL are are included in the VMware ESX Server open source packages.
Ok, this is fine, did this months ago, but I could not get past one key issue, anaconda has an issue with finding the ks.cfg file that is on the flash source. I could never get a ks.cfg to complete correctly using this method.
Glad to hear it. Now try this:
esx boot text nofb usb ks=hd:sdb1:/ks.cfg
(where sdb1 is the device of the USB flash, replace as necessary)
with the ks.cfg file in the root directory of the USB flash drive.
What method do you use to update hdstg2.img within the ISO. I'm using WinImage which treats the ISO as closed/read-only. I'm trying to aviod reburning a CD with the new file with nero and creating an ISO from that...
I'm been doing some work on this over the weekend. This is what I have got so far:
I changed the syslinux.cfg to disable graphical installations (not supported with hard disk media installs - and added a menu option to install my server(s)
append initrd=initrd.img noapic nomediacheck debug usb
append initrd=initrd.img usb
append ks initrd=initrd.img text usb ks=hd:sda4:/kickstart/default.cfg
append expert initrd=initrd.img usb
append ks initrd=initrd.img usb
append initrd=initrd.img lowres usb
append ks initrd=initrd.img usb ks=hd:sda4:/kickstart/esx01.cfg
append ks initrd=initrd.img usb ks=hd:sda4:/kickstart/esx02.cfg
append ks initrd=initrd.img usb ks=hd:sda4:/kickstart/esx03.cfg
The kickstart/default.cfg stops the prompts to do with being asked what disk to use and how to find the ISO file
\# Auto-Generated Scripted Install Configuration file.
\# This file is used for VMware ESX Server Scripted Install Deployment
\# Installation Method
harddrive --partition=sda4 --dir=/
For a bit of fun I modified the boot.msg file to give friendly information
- To install or upgrade 03VMware ESX Server 07 in text mode, press 0f 07
- Note: Graphical Mode is not supported with ESX-on-a-Stick
One real problem I can see with this - is how much /dev/sd[i]NN[/i] varies from system to system. I see it change depending if the SAN is connected (I get /dev/sdk4) the USB stick always appears as the last drive. Alternatively, on my HP proliants - because the first LUN is /ccisso/c0d0, the USB stick appears without the SAN connected the USB drive is /dev/sda4.... I wish we could hard-code the usb device to always be /dev/sdz - that way I could move the key from system to system and 9/10 it would know which disk contained the kickstart files and the ISO...
I believe that you have to remove the U3 software to get rid of that darn virtual cd-rom drive that it tries to run. I just bought a cruzer and had the same issue until I removed the U3 software.
Yeah, I got the cruiser to work by using the boot disk image tool... was able to do that without need to get rid of the U3 partition...
ps I bought WinISO today to assist injecting the IMG file provide by Paul...
well, I'm not having any fun with this...
I bought WinISO today - and I was able to open the ESX iso and add the file that Paul modified... BUT now the Anaconda installer believes the ISO is not there...
I've checked and the ISO works fine as a normal CD...
The only thing that's different between my two ISOs - is the adding of the .IMG file and the fact that its been processed by WinISO... I've checked thier FAQ's and emailed support...
Has anyone got this working without error... not sure where I am going wrong... my only barrier is the python error and the img file...
Paul what are your thoughts?