ESXi-Customizer-PS

  ESXi-Customizer-PS is a Powershell script that greatly simplifies and automates the process of creating fully patched and customized ESXi 5.x installation ISOs using the VMware PowerCLI ImageBuilder snapin.


Support Alert!

With the release of ESXi 5.5 Update 2 on Sep 9th 2014 VMware made changes to its Online Depot that triggered a bug in the PowerCLI ImageBuilder cmdlets and lead to intermittent errors in the ESXi-Customizer-PS script.

As a workaround please be sure that you always use exactly one of the switches -v50, -v51 or -v55! If you experience unexpected errors then please close the existing PowerCLI session and start a new one before calling the ESXi-Customizer-PS script again. THANKS!

The issue is currently under investigation by VMware. For more information and updates please refer to this forums thread and this Facebook post.

Requirements
  • A Windows computer (XP or newer) with Powershell 2.0 or newer
  • VMware PowerCLI version 5.0 or newer

Instructions

ESXi-Customizer-PS is a Powershell script that you launch from within a Powershell or a PowerCLI console window. It accepts various command line options. One of them is -help that will display this help screen:

ESXi-Customizer-PS 2.2 Help screen

Basically the script has three different operating modes:
  1. Create an ESXi installation ISO or Offline Bundle from the VMware Online depot (standard mode)
  2. Create an ESXi installation ISO or Offline Bundle from a local ESXi Offline Bundle (-izip mode)
  3. Update a local ESXi Offline Bundle with an ESXi patch bundle from the VMware Online depot (-izip -update mode)
With all three modes you can optionally add bundles from the HP Online Depot, the V-Front Online Depot, any other Online Depot (by URL) or locally stored Offline Bundles (e.g. downloaded drivers or software packages).

Here are some examples to get you going:

a) The simplest use case: Create a vanilla ESXi installation ISO with the latest patch level
.\ESXi-Customizer-PS-v2.2.ps1
Calling the script without any parameters will create an ESXi installation ISO of the latest ESXi version (5.5 as of now) and its latest patch level (GA as of now). The ISO file will be created in the script directory. You can modify this behavior by using one or more of the following parameters:
  • -v50 : Create the latest ESXi 5.0 ISO
  • -v51 : Create the latest ESXi 5.1 ISO
  • -v55 : Create the latest ESXi 5.5 ISO
  • -outDir : Write the ISO file to a different directory
  • -sip : Do not automatically use the latest image profile (= patch level), but display all in a menu and let me select a specific one. The menu will be sorted by date starting with the latest one. It will also list the image profiles that contain only security fixes and/or no VMware Tools.
  • -ozip : Do not output an installation ISO but an ESXi Offline Bundle that you can use for importing into Update Manager, command line patching with esxcli or as input for further customizations
b) Use an ESXi Offline Bundle as input (instead of the VMware Online depot):
.\ESXi-Customizer-PS-v2.2.ps1 -izip .\ESXi510-201310001.zip
ESXi Offline Bundles can be downloaded from the VMware Patch Download portal. Some hardware vendors (e.g. HP) also provide their customized ESXi version as Offline Bundles (these can be found on the vSphere download pages), and you could finally create your own customized ESXi Offline bundle using this script.

The command above will create an ESXi installaton ISO from the ESXi 5.1 Oct 2013 patch bundle. Again you can modify the behavior by using -outDir, -sip and/or -ozip like described under a).

c) Adding software bundles from the HP Online Depot
.\ESXi-Customizer-PS-v2.2.ps1 -v51 -hp -hprel sep2013
This script call will build an ESXi 5.1 installation ISO with the latest ESXi patch level and the HP software bundles (WBEM provider etc., from http://vibsdepot.hp.com/hpq) added. With -hprel you can select a specific edition of the HP bundle instead of the latest one. Again you can also add any parameter mentioned under a).

Please note: This won't add the HP specific device drivers that are part of the HP provided ESXi ISO. You can refer to this post for instructions on how to also add these, but I would recommend using the new -update method described under g) instead!

d) Adding additional packages from connected Online Depots
.\ESXi-Customizer-PS-v2.2.ps1 -load net-r8168,net-r8169,net-sky2
This script call will build an ESXi 5.5 installation ISO with the NIC drivers added that were dropped with ESXi 5.5. These packages are still in the VMware Online Depot, because they are part of all ESXi 5.0 and 5.1 image profiles, and the script just re-adds them to the latest ESXi 5.5 image profile.

Earlier I already posted the manual steps for achieving this.

e) Connect the V-Front Online Depot and other depots
.\ESXi-Customizer-PS-v2.2.ps1 -vft -load sata-xahci,cpu-microcode
This will make the script connect to the V-Front Online Depot and add the sata-xahci and cpu-microcode packages from there to the latest ESXi 5.5 image profile.

.\ESXi-Customizer-PS-v2.2.ps1 -dpt http://vibsdepot.hp.com/hpq/sep2013-550/ -load hp-smx-provider
This will build the latest ESXi 5.5 ISO with the HP WBEM Provider package from HP's Online Depot of Sep 2013.

f) Adding local Offline Bundles
.\ESXi-Customizer-PS-v2.2.ps1 -obDir C:\temp\zip
This command will add all Offline bundles that are stored in the directory C:\temp\zip. This way you can add 3rd party or community supported device drivers and software packages.

g) Updating an ESXi Offline bundle from the VMware Online depot
.\ESXi-Customizer-PS-v2.2.ps1 -v51 -izip .\VMware-ESXi-5.1.0-Update1-1065491-HP-5.61.2-Sep2013-depot.zip -update
With this script call you update a local ESXi Offline bundle (in this example: the HP customized version of ESXi 5.1 U1) with the latest ESXi 5.1 patch from the VMware Online depot. Once a patch for ESXi 5.5 comes out this will of course also work for updating the HP Customized version of ESXi 5.5 GA (omit the -v51 switch then).

h) Advanced options

For the sake of completeness here are the remaining optional parameters:
-test : this is for testing the validity and effect of the specified parameters without actually building the output file. Can save a lot of time, because it also skips most downloads from the VMware Online depot.
-nsc : Use the -noSignatureCheck option with the export function. Try this if you get an error message like "Could not find trusted signer." because of packages with missing or invalid electronic signatures.
-ipname
-ipdesc
-ipvendor : Override the image profile's name, description and vendor attributes. By default the name and description are derived from the original image profile by adding the string "customized", and the vendor is kept as is.


Licensing

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License is available at http://www.gnu.org/licenses/.


Support

Please check the "Known Bugs and Issues" section first to see if your issue is covered there!

If you have trouble using the script then please send an email to ESXi-Customizer-PS@v-front.de. Be sure to include a transcript of the script execution (create it by using the Start-Transcript cmdlet before calling the script). Otherwise I might just ignore your message.


Download

Donate
  • If you find ESXi-Customizer-PS useful consider donating a small amount to motivate the author and support the further development. I recommend 4 EUR (approx. 5 US-$, use an Online Exchange rate calculator), but any lower or higher amount is highly appreciated.

Known Bugs and Issues

None so far.


Change History

Version 2.2 (2014-02-12)
  • Fixed the -update -izip logic to correctly update only existing packages
  • Reverted the change to the add VIB logic introduced in 2.1
Version 2.1 (2014-02-11)
  • Fixed the add VIB logic to never downgrade a package
  • Added -load switch to add additional VIBs from any connected Online Depot
  • Added -vft switch to connect the V-Front Online Depot
  • Added -dpt switch to connect additional Online Depots by URL
  • Added -v55 switch to limit image profile selection to ESXi 5.5
Version 2.0 (2013-11-23)
  • Added -update switch to update a local ESXi Offline bundle with an ESXi patch from the VMware Online Depot
  • Added -v51 switch to limit the focus to ESXi 5.1 (and ignore newer releases)
  • Added -ipdesc option to set custom ImageProfile description
  • Added -ipvendor option to set custom ImageProfile vendor
  • Added console window re-sizing and coloring
Version 1.4.3 (2012-10-01)
  • Fixed ImageProfile sorting and detection of recent release
Version 1.4.2 (2012-09-28)
  • Added -force switch when adding packages (to prevent dependency checks)
Version 1.4.1 (2012-09-27)
  • Added PowerCLI version check and compatibility to PowerCLI 5.1
Version 1.4 (2012-09-17)
  • Added -v50 to limit the focus to ESXi 5.0 (and ignore newer releases)
  • Added -ozip option to create an Offline Bundle instead of an ISO file
  • Renamed -isoDir parameter to -outDir
  • Added logic to export only the orig. VMware profile if -obDir and -hp are both not specified
  • Added -nsc (-NoSignatureCheck) parameter for ISO export
  • Added -izip option to use an ESXi Offline bundle (instead of the Online depot) for input
  • Added electronic signature to script
Version 1.2 (2012-06-27)
  • Added manual selection of ImageProfile to clone (-sip), naming of custom profile (-ipname) and HP Depot release selection (-hprel). Added cleanup at end of script.
Version 1.1 (2012-06-07)
  • Fixed HP Online depot handling
  • Introduced -test parameter to skip download and build
Version 1.0 (2012-05-31)
  • Initial version