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.
Requirements:
\- You will need at least a 1 GB USB flash disk.
\- You must have
both
the ESX 3.x CD-ROM and ISO image handy.Steps Required:
boot.iso
file in the/images
directory on the ESX 3.x CD-ROM. Copyboot.iso
into a temporary directory on your hard drive.boot.iso
file to your USB flash drive. On my PC, it's theE:
drive.isolinux.bin
andupdatecd.cfg
files from the USB flash disk.isolinux.cfg
file on the USB flash disk tosyslinux.cfg
syslinux.cfg
file and add the keyword usbto the end of every line that begins withappend
. Here's what the file should look like when you're done:syslinux
.zip file into another temporary directory on your hard drive.cd
command to navigate into thewin32
directory. For example:cd C:\temp\syslinux-3.36\win32</p>
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:
boot.cat
boot.msg
initrd.img
snake.msg
splash.lss
vmlinuz
syslinux.cfg
esx-3.0.1-32039.iso
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
Hard Disk
.Paul
Hi,
I can confirm that this is the exact same issue as I am experiencing. Mike I am glad I read your email as I was loosing my mind.
LOL... know what you mean... I feel like I/we are on the cusp of cracking this one... I notice Paul's gone a bit quiet - lets hope he's looking at this one for us
Because I'm lost on issues to with IMG files... kickstart/syslinux.cfg I'm fine, but that's about it...
Regards
Mike
Question,
When you boot the usb drive then use the real cd-rom as install souce does your kicks file work? Mine isn't
If I uses a plan unmodified ESX ISO - it finds the ISO fine... and then I get the anaconda/python message...
if I use the IMG provided by Paul, and inject to the ISO... then it comes up message say that its not a valid redhat package something/something... I forget right now... I can grab it - but it sounds like you have the same error?
Regards
Mike
Yes same error.
Do you mind posting your esx01 kicks file? or PM me
If you read up above this post I cut & pasted my:
boot.msg
syslinux.cfg
and a basic "default.cfg" kickstart script to answer where the hard-drive is...
If a server has /dev/sda/ /dev/sdb and then you plug a USB key in it will be /dev/sdc[i]N[/i]. Go to another server with sda, sdb, sdc then the USB key becomes /dev/sdd... Hope I'm not teaching grama to suck eggs here!
I would be great if the USB key was found before SAN/RAID LUNs and was always /dev/sda... I'm disconnecting the SAN before installation (which is a good practise for local installs) but pain-in-the-ass for boot-from-SAN installations where a USB key would be handy. I guess if you have the SAME number of LUNs presented to each blade your OK, but if not then it reduces the level of automation you can do...
So the long and short of it is that in ALL of my files you may need to find and replace the sda4 value...
I've a longer kickstart script that does post-configuration (vSwitches, Software iSCSI, Create Users, and so on) I will attach it here. It works with my PXE appliance - but obiviously never tested it with "ESX-on-a-Stick"
(that the sub-chapter heading in the book)
There's two files here:
esx01 - for servers that present /dev/sda /dev/sdb to the installer and
esx03 - for HP Smart Raid Array Controllers that present /cciss/c0d0
Regards
Mike
Just a SWAG, does your new ISO have the .discinfo file in it?
Yup... not changing the ISO... just the img file...
Regards
Mike
hmmm, I am having no luck with this at all..always get "Operating System Not Found" (i.e. never even tries to boot).
It's an Imation 2GB USB
Formatted FAT
Syslinux done etc
Ideas?
Dave
Can I just check... Anyone got this working without error yet. I mean done a basic manual installation from a key...
I'm just trying to work out if its something I've done or if we still have fundemental problems to resolve?
Regards
Mike
David I had a imition 1GB drive and it wouldn't boot either. I had to use a tool in the Syslinux download. I have a feeling you might need to do this to...
1. From your Windows PC download the syslinux tools from:
http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.36.zip
2. Extract the ZIP file to you Windows PC
3. Transfer this file to Linux or your Service Console
4. Make a directory and extract the syslinux files to that location with
mkdir /root/syslinux
unzip syslinux-3.36.zip d /root/syslinux
5. Plug-in your USB Stick into Linux or the Service Console
When you do this the system should recognize the device if you are at the physical console you would see the device being recognized and would tell you what the /dev/sdn name is of the USB stick. If you miss this message then you can use the command
dmesg | grep sd
This will list all the SCSI devices on the system like so and I can see the USB device has been given the identity of /dev/sdl
SCSI device sda: 2072576 512-byte hdwr sectors (1012 MB)
sda: Write Protect is off
sda: sdl4
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready
sda: block size assumed to be 512 bytes, disk size 1GB.
sda: test WP failed, assume Write Enabled
sda: I/O error: dev 08:b0, sector 0
SCSI device sdl: 2072576 512-byte hdwr sectors (1012 MB)
sda: Write Protect is off
sda: sda4
6. Next we will use Linux command fdisk to delete any existing partition table, and find out the number of cylinders, heads and sectors are on the disk with
fdisk /dev/sdn
Press to print the partition table and make a note of the number of cylinders heads and sectors
Below is a print out from an Imation Mini Flash Drive
Disk /dev/sdl: 1061 MB, 1061158912 bytes
33 heads, 62 sectors/track, 1012 cylinders
Units = cylinders of 2046 * 512 = 1047552 bytes
7. Press to delete any existing partition
8. Press to write these changes to the USB Stick
9. Next transfer the mkdiskimage to the USB device by
cd /root/syslinux
perl mkdiskimage /dev/sdn -4 1012 33 62
This took about 15-20 minutes on my USB stick. The switch -4 indicates an image which is suitable for a zipdisks. The following numbers represent cylinders, heads and sectors. After this command completes you should be able to run fdisk /dev/sdn again to see a partition FAT16 has been created. In my case this reported:
Regards
mike
Regards
Mike
Hi all
I create my usb key to boot and install esx 3.0.1 automatically
I have following all the step. It was a bit difficulte to modify the .iso for include the file hdstg2.img but I succed
I explain if it can help somebody :
First put the Vmware esx 3.0.1 CD in your ESX CDROM
run :
dd if=/dev/cdrom of=/folder/esx-3.0.1.iso bs=1024
that's create the Iso image of the ESX CDROM
Now we must mount the Iso
run :
mkdir /mnt/iso
mount -o loop -t iso9660 /folder/esx-3.0.1.iso /mnt/iso
The iso file is mounted so we need to copye it in another folder /root/newiso by exemple
mkdir /root/newiso
cp -r /mnt/iso/* /root/newiso/
Now you can replace the file hdstg2.img in /root/newiso/VMware/base/
For create the new iso you need to install mkisofs.
Go to http://fr2.rpmfind.net/linux/rpm2html/search.php?query=mkisofs&submit=Search+...&system=&arch=[/u]
Take the mkisofs-1.10-11.asp.i386.rpm (the last)
Copy it on the ESX and start : rpm -hiv mkisofs-1.10-11.asp.i386.rpm
To create the iso run :
mkisofs -r -R -J -o /tmp/esx-3.0.1-v2.iso /root/newiso
Now you have the Iso with the new file
Be carful : I have done all and my server boot correctly on the USB Key, I select Hard-Drive and /dev/sda1 for the new image. BUT I have many anaconda error and the installation abort
That's all the errors :
File "/usr/bin/anaconda" , line 108, in ?
intf.run(id, dispach, configFileData)
File "/tmp/anaconda_build//usr/lib/anaconda/text.py" line 425 in run
File "/tmp/anaconda_build//usr/lib/anaconda/display.py" line 264 in currentStep
File "/tmp/anaconda_build//usr/lib/anaconda/display.py" line 159 in gotoNext
File "/tmp/anaconda_build//usr/lib/anaconda/display.py" line 227 in moveStep
File "/tmp/anaconda_build//usr/lib/anaconda/packages.py" line 147 in readPackages
File "/tmp/anaconda_build//usr/lib/anaconda/hardrive.py" line 208 in readHeaders
File "/tmp/anaconda_build//usr/lib/anaconda/hardrive.py" line 145 in mountMedia
If somebody able to help me to solve it I think I can publish a complet post to make the installation of ESX 3.0.1 just using an usb key ..
Message was edited by:
fbedell
mmm, looks like the python error is still there...
I injected the IMG file using WinISO... and will give your method a try and see what I find...
Regards
Mike
Mike,
Make sure the primary partition is marked as "active" otherwise it won't be bootable. Good ol' FDISK will do this, option (2).
Paul
Everything works for me other then the fact that I can not use the local USB iso image. I can use a local CD though. So close yet so far away.
Yep.. the USB sticks primary is marked as bootable... mkdiskimage.pl did all that for me...
My problems are further down the line with the customised version of the ESX3.0.1 ISO with the hdstg2.img...
Not had a chance to try the command-line method... to be honest I think the problem is with the hdstg2.img file...
Do you have this working without errors, Paul?
Regards
Mike
Yes, I installed ESX on two of my own servers this way. Let me go back and review your posts to see if I can find anything peculiar...
Paul
Paul,
I've been documenting the process for the new book. It's part of a chapter about ESX on the command-line and includes:
PXE/Kickstart Installation
ESX on a stick
Network & Storage esxcfg commands
User Management (su, sudo config, LDAP)
Can I send you the portion on "Esx on a stick" I've writen so far. Perhaps there's something I'm missing - and I'm too close to spot it...
To summarize an ordinary ISO works but gives the Python error... the customized ISO with the .img file throws up an error... I will sceen grab the error...
Your email?
Regards
Mike
Mike,
I don't know if I explain correctly my precedent post but with my method your are able to custumize the ISO to put the .img file giving by Paul.
You boot with USB ans select your correct /dev/sda.... and the key find well the Iso file.
But the python problem still...
I post here the anacdump.log from debug screen if can it help someone.
Traceback (most recent call last):
File "/usr/bin/anaconda", line 1087, in ?
intf.run(id, dispatch, configFileData)
File "/tmp/anaconda_build//usr/lib/anaconda/text.py", line 425, in run
File "/tmp/anaconda_build//usr/lib/anaconda/dispatch.py", line 264, in currentStep
File "/tmp/anaconda_build//usr/lib/anaconda/dispatch.py", line 159, in gotoNext
File "/tmp/anaconda_build//usr/lib/anaconda/dispatch.py", line 227, in moveStep
File "/tmp/anaconda_build//usr/lib/anaconda/packages.py", line 147, in readPackages
File "/tmp/anaconda_build//usr/lib/anaconda/harddrive.py", line 208, in readHeaders
File "/tmp/anaconda_build//usr/lib/anaconda/harddrive.py", line 145, in mountMedia
KeyError: 1
Local variables in innermost frame:
cdNum: 1
self: Mar 23 08:07:21 loader: Installer SCSI detection: adding LUN sda/'Kingston DataTraveler II+'
Wow... my error is much shorter than that!
I have "Device /dev/sdb4 does not appear to contain Red Hat CD-ROM images..."
Anyway, I'm gonna try making my ISO by the DD method and report back my findings later...
Regards
Mike