• Twitter

Scenario: With VMWorld 2014 on it’s way and another ESXi version release inevitably on the horizon what do you do when you have so many hosts that need to be upgraded but each host needs to be manually customized for your infrastructure prior to production use? The hosts could need VIBs for vShield, Cisco VEM, SCSI controller driver or maybe even Trend Micro Filter Drivers but each of these VIB installations could potentially require a reboot and more lost time for those of us managing the deployments.

Enter….ESXi Image Builder for PowerCLI! An easy and simple way to build custom ESXi images for your hosts to perform new installations or upgrades on existing installations.

Let’s Get To Work!: In this example I will be creating an image to upgrade from ESXi 5.1 to ESXi 5.5.  In preparation for building the image we will need PowerCLI version 5.1 or higher which contains the commands we will be using. PowerCLI can be found here at my.vmware.com.

We begin the image creation process by building our Software Depot which is where all of our VIBs and ESXi base images will be stored for later use. The first line adds the VMWare ESXi software repository which contains the base ESXi images that we will use to build the image. The remaining lines of code would be the local file path to the VIBs that you have downloaded which pertain to your specific infrastructure:


Now that we have our Software Depot loaded with base images and VIBs we can begin to build our base image.  You will need to select an image file from the VMWare software repository we added earlier. The image will depend on which version of ESXi you choose to install. The first line will show you all available ESXi version available from the repository. Choose the one you prefer and use the second line to clone the image so we can inject our own custom VIBs and build the image where “ESXi-5.5.0-20131201001s” would be the name of the ESXi image to clone and “ESX5.5Image” would be the name of the image profile that we will reference to inject our VIBs:


At this point all we have to do is inject each of our custom VIBs into the custom image profile we just created. We can first use Get-EsxSoftwarePackage to view the list of available VIBs in our repository and then inject them by name with each command below:


Ok, great! We now have a custom image built with the VIBs we want and the ESXi version we love…what now? Export the image to ISO for deployment with VUM (vSphere Update Manager), mount a virtual drive on your host from your out of band management device or burn it to a CD/DVD:


Closing Thoughts: Working smart and not hard is the key to being an efficient professional in our field. The faster and more accurate we can be the better off our infrastructure will be. eg. we can use our newly create ISO to automate upgrades via VUM which we will cover in a future article. Additionally, you can download a GUI version AutoDeploy here from VMWare labs which will let you point and click to build your custom images however, I prefer to keep my hands on the keyboard 🙂




About the author


Categories: Scripts, Trend Micro

One Response so far.

  1. […] us with some very nifty tools such as ESXi Builder as blogged about by our very own @virtual_cj here.  Additionally with the support of PowerCLI your options are endless with workflow, logic, and […]

Leave a Reply