Upgrading Firmware on ESXi

A bane of any system administrator’s existence is the constant stream of firmware updates to fix various bugs and issues that occur. One of these HBA Firmware updates is a fairly common issue where a new LUN or Target is not being discovered without a reboot. With Emulex there is a set of tools called the HBAanywhere that can be installed onto ESX Classic. Then you can perform an Emulex HBA Firmware upgrade without having to reboot the ESX Host.

Example script:

1
2
3
4
cd /usr/sbin/hbanywhere
./hbacmd listhbas
./hbacmd download 00:00:01:02:03:04:05 zd282a4.all
./hbacmd hbaattributes 00:00:01:02:03:04:05

With this you have just updated the firmware to 2.82a4 on an LPe11000-M4 card.

With ESXi it isn’t that easy since hbacmd isn’t available. The solution I came up with is to create a bootable WinPE CD with the Emulex Tools and firmware available on it. Then all you have to do is boot off this CD and you will be able to update your 10G CNA or your Emulex LPe12000 HBAs.

This script expects you to have the Windows AIK installed locally. Just update this script to point at the appropriate locations of the listed files.

CustomEmulexWinPE.cmd – Run this to create a bootable ISO that will install the Emulex WinPE utilities & drivers and then attempt to upgrade the 10G CNA & LPe12000 cards in the system.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
call "C:Program FilesWindows AIKToolsPEToolspesetenv.cmd"
 
call copype x86 EmulexWinPE
 
imagex /mountrw Winpe.wim 1 mount
 
mkdir mountEmulex
xcopy "setupElxAll-x86.exe" mountEmulex
xcopy /s "Firmware" mountEmulex
del mountWindowsSystem32startnet.cmd
xcopy "startnet.cmd" mountWindowsSystem32startnet.cmd
 
peimg /prep mountWindows
imagex /unmount mount /commit
copy winpe.wim ISOsourcesboot.wim
 
oscdimg -n -betfsboot.com ISO EmulexWinPE.iso

startnet.cmd – This runs on boot and will attempt to update the 10G CNA & the Emulex LPe12000 cards in the system.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
wpeinit
 
EmulexsetupElxAll-x86.exe /q
cd "Program FilesEmulexUtilelxApp"
 
winlpcfg download a=lpe12000-m8 i=emulexlpe12000ud111a5.all
winlpcfg download a=lpe12000-m8 i=emulexlpe12000ub202a2.prg
 
winlpcfg download n=1 i=emulexoce10102s1462001.ufi
winlpcfg download n=2 i=emulexoce10102s1462001.ufi
winlpcfg download n=3 i=emulexoce10102s1462001.ufi
winlpcfg download n=4 i=emulexoce10102s1462001.ufi
 
winlpcfg listhba

Once this script is done running you’ll have a EmulexWinPE.iso that you can mount and boot off of. It will automatically run and upgrade the firmware of the Emulex devices.

This basic setup should allow you to do anything scripting wise you need to do in a Windows environment to update the hardware configuration or run various diagnostics tests outside of ESXi.

Download Locations:
setupElxAll-x86.exe
Windows AIK
Emulex Firmware – Download as needed and update the location you copy it to your WinPE ISO file in the Startnet.cmd and in the CustomEmulexWinPE.cmd.

Related Posts:

9 thoughts on “Upgrading Firmware on ESXi”

  1. Nice trick!

    Eventually if you have HP servers, you could boot up from the HP Firmware CD and upgrade the HBAs but also any other firmware on that server…

  2. You could still use HBAnywhere on ESXi, as the Emulex CIM providers are included in ESXi & the HBAnywhere client contains the CIM components to talk to ESXi …

    1. This didn’t work initially. I will do this test again and see if it works going forward. The issue is now I need a secondary system to apply the updates from when doing a build. That complicates automation quite a bit.

  3. pironet, this only works with hardware that is native to the system…optional hardware Fw update files cannot be added to the HP smart update because they are the incorrect file types that the linux system looks for in the dir structure on the DVD/Cd. for instance the LPE12000 is NOT supported by HP under VMware…they claim that ESX uses the driver that loads the FW and that a FW update is not required(this is total BS). this came directly from the HP storage works website.

    Permalink…this doesn’t work either …because you need a console in order to be able to create the dirs and other comands required to run HBanywhere. the console is not robust enough in ESXi to do this…

    I am working on a solution for this at the moment…However, the one presented here thus far seem to be the best and along the same lines as mine which is installing Windows 2003 server to a USB drive and installing hbanywhere to it..from there I can take Fw files and utilities at will and add them to the USB install and run them..the caveat so far..the usb image has to be the same as the hardware you are updating..this solution can also be used on HP ILO’s as well, by creating an ISO of the USB key and connecting to the ILO and mounting the ISO image and booting the server from it..it is basically the same as this solution with an added function of being able to install other utilities to it without having to repackage the whole image. Franly, Vmware needs to build the console BACK into ESXi, period. They really do not know, or seem to care, how limited systems administration/maintenance is without it..did we really need this added security?

    1. @Eddie Green – One issue with your solution of Windows 2003 server is the licensing issue. WinPE is free for this style usage. Your solution requires a Server License and technically can only be used once every 90 days per license you have due to the reassignment clause unless you assign a license to the physical server which can not then be used in a VM instance.

      The process of creating the WinPE image is fairly quick and automated. I’ve updated the image with new drivers/firmware versions and rebuilt the entire ISO image in a matter of 10 mins. I’m continuing to work on this and improve it to be more hands off than it is today.

  4. What I want to know…is how did you get this to work with the AIK. I have dl’d and reconfigured for my files…and three times now I have come up with the setupElxAll-x86.exe not installing on the PE image. I have tried to install it ma nually and it keeps coming back with a target version check of vista 0 requires vista SP1 or better. Without this winLpconfg does not install.
    so riddle me that one batman?
    My next experiment with this is to try copying the winlpconfig file and running it manually just to see if I can get it to work form the command line.

  5. I am having a hard time creating the ISO using the CustomEmulexWinPE.cmd. Can you e-mail me the script? I am having problems with the spacing and missing backslashes.

    Thanks a bunch !

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>