Use PowerCLI with ESXi-Customizer-PS – Build Custom VMware ESXi ISO Step-by-Step

 Use PowerCLI with ESXi-Customizer-PS – Build Custom VMware ESXi ISO Step-by-Step

Why Use ESXi-Customizer-PS with PowerCLI?

VMware ESXi doesn’t always include drivers for new hardware (network cards, storage adapters, etc.). With ESXi-Customizer-PS, you can easily inject drivers, VIBs, or offline bundles into a standard ESXi ISO, creating a custom installer that works on unsupported hardware.

Pairing it with PowerCLI allows administrators to script and automate ISO creation, saving time and ensuring consistency across deployments.

Many users do not check the compatibility of server network cards before purchasing hardware, or encounter errors when installing ESXi on old servers, with No Network Adapters, preventing ESXi from being installed normally


Some users also find that the RAID card is not recognized during installation, which makes it unable to select storage for the ESXi installation.

At this point, you need to manually try the network card, RAID card driver, or the driver offline package or VIB file that needs to be packaged, and use PowerCLI with the ESXi-Customizer-PS script to package the driver into the ESXi offline installation package. The following describes how to use PowerCLI with ESXi-Customizer-PS to inject VIB packages into ESXi offline bundles.


A: Install PowerCLI

For detailed installation methods of VMware PowerCLI, please refer to my previous article:

VMware PowerCLI Super Detailed Tutorial

B: Package the driver into the ESXi installation package

After installing PowerCLI, an error occurred when trying to package the device driver VIB into the ESXi file. The log shows that the VMware.ImageBuilder module in PowerCLI 13 depends on Python versions 3.7.1-3.12, so the Python environment needs to be installed first.


First: Install Python environment

1. Visit the Python official website to download the Python installation package (versions 3.7.1-3.12). Here, Python 3.9 is taken as an example. Click Install Now, then remember the installation path and check the bottom option "Add Python 3.7 to PATH", automatically configure the environment variables, no manual configuration required

https://www.python.org/downloads/release/python-379/

2. Wait for the installation to complete, and click Close to finish

3. Switch to the Python installation path (replace [python3.7-directory] with the Python installation path), use the following command to upgrade pip online, or download pip offline for installation, which is not demonstrated here

 
[python3.7-directory]\python.exe -m pip install --upgrade pip

4. Install necessary components using the command pip install six psutil lxml pyopenssl

 
[python3.7-directory]\Scripts\pip3.7.exe install six psutil lxml pyopenssl

Wait for the installation to complete


5. Configure the Python 3.7 path in PowerShell using the command Set-PowerCLIConfiguration -PythonPath C:\Users\admin\AppData\Local\Programs\Python\Python37\python.exe -Scope User (where C:\Users\admin\AppData\Local\Programs\Python\Python37\ is replaced with your actual Python installation path)

Second, start encapsulating ESXi

1. Get the latest version of ESXi-Customizer-PS

https://github.com/VFrontDe-Org/ESXi-Customizer-PS

2. Transfer ESXi-Customizer-PSscripts, device drivers, VIB or ZIP files, and ESXi ZIP packages into the same folder (VIB files can be placed in a separate subfolder)

3. Open PowerShell, switch to the folder where the script and driver are placed

4. Run the following command to package the vib file into the ESXi offline package

 
.\ESXi-Customizer-PS-2.9.ps1 -izip .\VMware-ESXi-7.0U3w-24784741-depot.zip -pkgDir .\vib -nsc

Because the vib file of a driver is randomly selected in this experimental environment, there may be some warnings along the way. This article aims to introduce the operating steps. Please download the driver file according to the actual situation.


(If the requirements are different, you can refer to this website https://www.v-front.de/p/esxi-customizer-ps.html#download, query other different usages of ESXi-Customizer-PS)

5. After the program finishes running, a packaged ISO file is generated in the same directory.

6. Validate the Custom ISO

Test deployment in a VMware Workstation VM or lab server before production use.

Best Practices

  • Always use official VMware VIBs and drivers to avoid compatibility issues.

  • Keep a copy of the original ISO for fallback.

  • Document your customization steps for future builds.

  • Regularly update ESXi-Customizer-PS and PowerCLI for compatibility.

Before purchasing or upgrading a server, highly recommended to visit the official VMware by Broadcom website (https://compatibilityguide.broadcom.com/) to check hardware compatibility before proceeding, to avoid creating problems for the future production environment.

No comments:

Post a Comment

Thank you for your comments.