Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The Definitive Guide to Installing ESXi using iPXE...
2012-01-14, 07:49 (This post was last modified: 2012-01-16 04:11 by MultimediaMan.)
Post: #1
The Definitive Guide to Installing ESXi using iPXE...
There are currently five Seven methods to install ESXi;

1) Boot from Physical Media of some kind... (Slow, boring, mundane, provincial, tragically manual...)
_ a) There are several methods of doing this via CD, DVD and USB Sticks, with and without Kickstart files. All of them, no matter how sophisticated, are like pulling oars on a slave ship; slow, painful and ultimately a waste of time and energy.

2) Boot from Mounted Image (using a RAC Card - DRAC, iDRAC, iLO iLO2, iLO3) SLOW...did I mention SLOW? 3rd. Party Automation tools are horribly cobbled-together and inefficient.

3) PXE Boot using pxelinux.0 (Slow, fraught with corruption opportunities)

4) PXE Boot using ipxelinux.0 (Faster, lacking Scripting Support)

5) iPXE Boot using Memdisk (Excellent Scripting support, CD is Emulated, no Media Depot Required - RAM requirements can be a problem).

6) iPXE Boot from HTTP-Mounted ISO (Sexy, Faster and will get you dates with beautiful women...Oh, and VMware might take a slightly dim view of this). Requires editing the ISO file; Bespoke workaround.

7) iPXE Boot from HTTP-Mounted ISO (Sexy, Faster and will get you dates with beautiful women, all of whom want to bear your children...Oh, and VMware may support you if someting goes awry). Requires editing the ISO file; Supported workaround.

Method 1) RTFM.
Method 2) Ditto.
Method 3) RTFM... specifically this document on Page 26. The most important parts are Creating a Media Depot, but invoking the Media Depot [sarcasm] was thoughtfully somewhat glossed over...[/sarcasm]

This is the most important part...

Code:
install http://example.com/VMware/ESXi

Note: All Most of the network-based installations of ESXi Require a Media Depot and a Kickstart file with the Media Depot Referenced in it. Otherwise you will get the No Media Error message.

Followed by page 34

Code:
default 1
prompt 1
menu title VMware VMvisor Boot Menu
timeout 50
label 1
kernel esxi/mboot.c32
append esxi/vmkboot.gz ks=http://xx.xx.xxx.xxx/kickstart/ks.cfg --- esxi/vmkernel.gz ---
esxi/sys.vgz --- esxi/cim.vgz --- esxi/ienviron.vgz --- esxi/install.vgz
label 0
localboot 0x80

The Kickstart file needs the statement "install http://example.com/VMware/ESXi" placed in it... There are many, many great sites out there that can show the user how to write kickstart files that discover, configure and tweak ESXi out there. This post will not go into that level of detail...

Example:

Code:
vmaccepteula
autopart –firstdisk=local –overwritevmfs
install http://example.com/VMware/ESXi
network –bootproto=dhcp –device=vmnic0 –addvmportgroup=1
rootpw –iscrypted <encrypted_root_password>

# Reboot after the installation
reboot


Method 4) RFTM... substituting iPXE for the obsolete gPXE; paying close attention to the requirements of Method 3.

Method 5) Robinsmidsrod's Way, using Memdisk: No Media Depot or Kickstart file required.

Code:
echo
echo Booting VMware 64-bit installer for ${hostname} from SAN
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.vmware
sanhook ${root-path} || goto failed
initrd http://server.smidsrod.lan/tftp/vmware/esxi-5.0-x64.iso
chain http://server.smidsrod.lan/tftp/memdisk iso || goto failed

:failed
echo Boot from ${root-path} failed, dropping to shell
shell

Method 6) Create a Media Depot, and Modify the ISO; Mount the ISO and edit the following file in the root of the ISO: isolinux.cfg
Add "install=http://epimetheus.olympus.bv.ar.us.local/vmware/4.1/x86_64/os/ESXi_4_1_U2" after vmkboot.gz but before vmkernel.gz

Example:
Code:
default menu.c32
menu title VMware VMvisor Boot Menu
timeout 80

label ESXi Installer
menu label ^ESXi Installer
kernel mboot.c32
append vmkboot.gz install=http://epimetheus.olympus.bv.ar.us.local/vmware/4.1/x86_64/os/ESXi_4_1_U2 --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz

label ^Boot from local disk
menu label ^Boot from local disk
localboot 0x80

Copy the ISO to your webserver: I renamed mine "ESXi_4_1_U2_MAN.iso".

Code:
#!ipxe
#564dcda8-1f0f-2292-f735-847aecb320d7.ipxe
goto startme
:retry
sleep 5
:startme
set keep-san 1
set initiator-iqn iqn.2011-04.local.us.ar.bv.olympus:v-ipxe-a.olympus.bv.ar.us.local
sanboot --drive 0x80 iscsi:atlas.olympus.bv.ar.us.local::::iqn.1991-05.com.microsoft:atlas-v-ipxe-a-target ||
sanboot --drive 0x81 --no-describe http://epimetheus.olympus.bv.ar.us.local/vmware/4.1/x86_64/iso/ESXi_4_1_U2_MAN.iso || goto retry

This way of doing it will allow a manual installation of the ESXi without a kickstart file.


Method 7) Create a Media Depot and a Kickstart file with the Media Depot referenced in it.

Mount the ISO and edit the following file in the root of the ISO: isolinux.cfg
Add "ks=http://xx.xx.xxx.xxx/kickstart/ks.cfg" after vmkboot.gz but before vmkernel.gz

Example:
Code:
default menu.c32
menu title VMware VMvisor Boot Menu
timeout 80

label ESXi Installer
menu label ^ESXi Installer
kernel mboot.c32
append vmkboot.gz ks=http://xx.xx.xxx.xxx/kickstart/ks.cfg --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz

label ^Boot from local disk
menu label ^Boot from local disk
localboot 0x80

Copy the ISO to your webserver: I renamed mine "ESXi_4_1_U2_MOD.iso".

Now you can setup the boot in iPXE (undionly.kpxe or other);

Code:
#!ipxe
#564dcda8-1f0f-2292-f735-847aecb320d7.ipxe
goto startme
:retry
sleep 5
:startme
set keep-san 1
set initiator-iqn iqn.2011-04.local.us.ar.bv.olympus:v-ipxe-a.olympus.bv.ar.us.local
sanboot --drive 0x80 iscsi:atlas.olympus.bv.ar.us.local::::iqn.1991-05.com.microsoft:atlas-v-ipxe-a-target ||
sanboot --drive 0x81 --no-describe http://epimetheus.olympus.bv.ar.us.local/vmware/4.1/x86_64/iso/ESXi_4_1_U2_MOD.iso || goto retry

Viola! Working iPXE ESXi Installs.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2012-01-14, 17:35
Post: #2
RE: The Definitive Guide to Installing ESXi using iPXE...
That was very complicated. Maybe ESXi 5.0 has come a long way from 4.x, but I only do like this:

Code:
#!ipxe

echo
echo Booting VMware 64-bit installer for ${hostname} from SAN
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.vmware
sanhook ${root-path} || goto failed
initrd http://server.smidsrod.lan/tftp/vmware/esxi-5.0-x64.iso
chain http://server.smidsrod.lan/tftp/memdisk iso || goto failed

:failed
echo Boot from ${root-path} failed, dropping to shell
shell

Of course, I don't have a kickstart file, which means I have to manually fill in configuration stuff, but the iSCSI volume is detected without effort.
Visit this user's website Find all posts by this user
Quote this message in a reply
2012-01-14, 19:48 (This post was last modified: 2012-01-14 19:57 by MultimediaMan.)
Post: #3
RE: The Definitive Guide to Installing ESXi using iPXE...
I know it's complicated: it's also a variation on a supported method by VMware; and since I've a couple of hundred hosts to install, quite necessary.

My boot LUN setup is very close to yours. The big thing is how the ISO is presented to the Host. For instance, your method could be altered to use a Kickstart file by editing the ISO. There are no right or wrong answers here.

But I did learn something new: Smile I didn't know you could present an ISO as a ramdisk.


The reason I went with the install the way I did is mostly for support: By using a Media Depot, and standardized kickstart, if I have a problem which requires VMware Support, I am likely covered.

One thing is certain: it's fast.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2012-01-15, 10:38
Post: #4
RE: The Definitive Guide to Installing ESXi using iPXE...
Actually, the sanboot http iso support in iPXE is very similar to how memdisk does things, it only uses much less memory, as it uses ranged HTTP requests instead of downloading everything before starting. But as long as the ISO in question supports running purely from ramdisk things just work (and ESXi 5.0 seems to do that).
Visit this user's website Find all posts by this user
Quote this message in a reply
2012-01-15, 16:13
Post: #5
RE: The Definitive Guide to Installing ESXi using iPXE...
I agree: ESXi 5.0 doesn't need the Media Depot... ESXi 4.x does: VMware's hokey installation CD Scheme really wasn't given too much thought until vSphere 4... and it was too late to change anything before the release. They fixed it in vSphere 5.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2012-01-16, 03:37 (This post was last modified: 2012-01-16 03:57 by MultimediaMan.)
Post: #6
RE: The Definitive Guide to Installing ESXi using iPXE...
Memdisk via iPXE vs. ISO Boot HTTP via iPXE:

Memdisk via iPXE does the following things:

1) Emulates a CD-ROM allowing a Network-Based Install.
2) Masks actual system RAM because the environment memdisk creates "hides" a certain amount of RAM to allow for the ISO - This amount is generally 2x ISO Size (Maximum 2GB - I think).
3) Preloads the ISO into memory before executing the ISO. This slows boot time a bit.

ISO Boot over HTTP via iPXE:

1) Does not emulate a CD-ROM. It is a Block Device.
2) Does not mask system RAM.
3) Executes as it reads: Faster than memdisk and no "preloading" of the ISO is required.
4) Does not hold the ISO as a readable device once the ISO is loaded unless loaded into the iBFT.

Updated to reflect two more methods of installing ESXi using iPXE.

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2014-04-14, 09:08
Post: #7
RE: The Definitive Guide to Installing ESXi using iPXE...
(2012-01-14 17:35)robinsmidsrod Wrote:  That was very complicated. Maybe ESXi 5.0 has come a long way from 4.x, but I only do like this:

Code:
#!ipxe

echo
echo Booting VMware 64-bit installer for ${hostname} from SAN
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.vmware
sanhook ${root-path} || goto failed
initrd http://server.smidsrod.lan/tftp/vmware/esxi-5.0-x64.iso
chain http://server.smidsrod.lan/tftp/memdisk iso || goto failed

:failed
echo Boot from ${root-path} failed, dropping to shell
shell

Of course, I don't have a kickstart file, which means I have to manually fill in configuration stuff, but the iSCSI volume is detected without effort.

How would you use a kickstarter file with your method?
Find all posts by this user
Quote this message in a reply
2014-04-18, 13:06
Post: #8
RE: The Definitive Guide to Installing ESXi using iPXE...
stokbaek: You can't (at least not without editing the ISO).
Visit this user's website Find all posts by this user
Quote this message in a reply
2014-09-03, 01:40
Post: #9
RE: The Definitive Guide to Installing ESXi using iPXE...
Sorry for the bumping of this thread - I'm not very familiar with ESXI but I'm supposed to migrate our ESXI boot configs from PXE to iPXE, and we currently have the configs set up mostly as described in http://pubs.vmware.com/vsphere-50/index....1E0E5.html
.

How should I migrate this to an iPXE config? setting the target_args (including boot.cfg) in a .ipxe file seems to make it hang when it chainloads mboot.c32 with set target_args -c location of boot.cfg. Looking at this definite guide I don't see any method by which boot.cfg is utilized at all.

Thanks for any help you can offer!
Find all posts by this user
Quote this message in a reply
2014-09-05, 10:49
Post: #10
RE: The Definitive Guide to Installing ESXi using iPXE...
You might be able to use a similar trick to boot ESXi as used in the XenServer appnote. The only thing you need to figure out are which of the modules are compressed, as iPXE does not support transparent decompression, as mboot.c32 does.

Also take note that when using multiboot, each module can take cmdline parameters, as shown in the appnote above.
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-05-18, 15:55
Post: #11
RE: The Definitive Guide to Installing ESXi using iPXE...
RE: The Definitive Guide to Installing ESXi using iPXE..

Below is what the procedure I followed:

1) Downloaded the ipxe.iso
2) Mounted and edited isolinux.cfg with below lines:
append vmkboot.gz ks=http://myloc/ks.cfg --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz
3) Edited the kickstart file in the remote location with below lines inside:
autopart --firstdisk=remote --overwritevmfs
install http://myloc/myOriginIsoImage.iso
4) Then rebooted in the ilo of server. Didn't work! Anything else that's missed!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: