Starting with VMware PowerCLI 12.0, you can create a custom PXE image by using any software depot and a custom software specification.
Prerequisites
Install VMware PowerCLI 12.0 or later.
Verify that you have access to the software depot that contains the software specification you want to use.
Procedure
- Gather the required information for the software specification that you use to create a custom PXE image.
- Get the base image version for the required patch or upgrade by running the
Get-DepotBaseImages
cmdlet:PS C:\> Get-DepotBaseImages -Depot C:\VMware-ESXi-7.0U2a-17867351-depot.zip
The command output is:Version Vendor Release date ------- ------ ------------ 7.0.2-0.0.17867351 VMware, Inc. 04/29/2021 00:00:00
- Get other packages, such as OEM addons, with cmdlets used with new metadata in software depots. For example:
PS C:\> Get-DepotAddons -Depot C:\addon-depot.zip
The command output is:Name Version ID Vendor Release date ---- ------- -- ------ ------------ testaddonv1 1.0.0-1 testaddonv1:1.0.0-1 ESXLifecycle QE 02/20/2019 18:28:23
You can also list all components in a sofware depot with the Get-DepotComponents cmdlet:The command output is:PS C:\> Get-DepotComponents -Depot C:\Intel-i40en_1.12.3.0-1OEM.700.1.0.15843807_18058526.zip
Name Version ID Vendor ---- ------- -- ------ Intel-i40en 1.12.3.0-1OEM.700.1.0.15843807 Intel-i40en:1.12.3.0-1OEM.700.1.0.15843807 Intel
You can use any number and combination of online and offline software depots. - Get the base image version for the required patch or upgrade by running the
- Create a software specification. For example:
{ "base_image": { "version": "7.0.2-0.0.17867351" }, "add_on": { "name": "testaddonv1", "version": "1.0.0-1" }, "components": { "Intel-i40en": "1.12.3.0-1OEM.700.1.0.15843807" } }
The software specification is a JSON file that contains information about the ESXi base image and additional packages, such as a vendor add-on. - Generate a custom PXE image by running the
New-PxeImage
cmdlet with the parametersDepots
,SoftwareSpec
andDestination
. For example:New-PxeImage -Depots “c:\temp\VMware-ESXi-7.0U1d-17551050-depot.zip” , “c:\temp\HPE-701.0.0.10.6.5.12-Jan2021-Synergy-Addon-depot.zip” -SoftwareSpec “c:\temp\HPE-70U1d-custom.JSON” –Destination “C:\pxe-image”
The depot(s) include the path to the zip files for the supported ESXi version and vendor add-on. The destination include the path and file name for the custom PXE file.You can pass additional kernel options, create a live image, overwrite existing files, or check acceptance levels for individual VIBs used during the creation of the image. For more information about theNew-PxeImage
cmdlet, see https://code.vmware.com/docs/11794/cmdletreference/doc/New-PxeImage.html.
What to do next
You can use the PXE image in remediation workflows of PXE booted ESXi hosts.