Thursday, September 8, 2016

How to create custom ESXi images using vSphere Image Builder?

Prerequisites : vSphere Power CLI, ESXi Offline Bundle

Image Builder is a set of PowerCLI Cmdlets that lets you build and maintain custom ESXi Images. Using the Image Builder you can;

Create/Edit an Image Profile
Clone an existing image
Add/Remove custom drivers

In this article shows how to clone existing image and add a custom driver to it and export as an iso image or offline bundle for vSphere Auto Deploy.

Add ESXi Offline Bundle to ESX software depot using Add-EsxSoftwareDepot command as shown below.

Check default ESXi images profiles for clone using the Get-EsxImageProfile command as shown bellow.

Choose desired ESXi image profile and clone it for changes as shown bellow.

Now you have completed the cloning image profile. It's time add a software package to cloned image. In my case, I'm going to add QLogic Fibre Channel Adapter driver.

Add QLogic Fibre Channel Adapter to ESX software depot using Add-EsxSoftwareDepot command as shown below.

Check added driver is on the VMware prepackaged-list using the Get-EsxSoftwarePackage command. For the QLogic Fibre Adapter driver, you can see “scsi-bfa” as shown bellow.

Use bellow command to confirm current software packages in the cloned image profile before.
Get-EsxImageProfile | select esxi55-custom-image -ExpandProperty VIBLIST
It will show you above “scsi-bfa” software driver has not added in the cloned image profile yet.

Use bellow command to add software driver to custom cloned image as shown bellow.

Once added use bellow command to verify it is added to the VIB list in the cloned image.
Get-EsxImageProfile | select esxi55-custom-image -ExpandProperty VIBLIST

Now the custom image is ready to export as ISO or as an Offline Bundle and use bellow commands.

Exported images as bellow.

You can verify the added software package with extracting the exported zip file under “vib20” folder for the software driver.

No comments: