PowerCLI Image Builder experiments

Two new PowerCLI functions based on Image Builder: Compare-EsxImageProfilePlus and Merge-EsxImageProfile.

Challenge

A custom ISO for Lenovo servers with latest ESXi patches was needed.
It was a good opportunity to experiment with PowerCLI Image Builder with these two requirements:
Compare two EsxImageProfile and generate a report easy to read.
Merge two EsxImageProfile and keep the highest Vib across the two profiles.

Compare two images

The PowerCLI cmdlet “Compare-EsxImageProfile” is limited. It is not possible to identify in one command what has changed and what has not.

esxi-image-creator.ps1” is good but does not fulfil exactly my requirement.

The next step was to build a new function: Compare-EsxImageProfilePlus.
It is actually based on “Compare-EsxImageProfile”.

Compare-EsxImageProfilePlus $LenovoEsxImageProfile $VMwareEsxImageProfile

Name             : brcmfcoe
VendorRef        : EMU
VersionRef       : 11.2.1153.13-1OEM.600.0.0.2768847
CreationDateRef  : 17/11/2016 13:47:18
VendorComp       :
VersionComp      :
CreationDateComp :
Analysis         : OnlyInRef

Name             : sata-sata-sil
VendorRef        : VMware
VersionRef       : 2.3-4vmw.600.0.0.2494585
CreationDateRef  : 06/02/2015 02:37:02
VendorComp       : VMware
VersionComp      : 2.3-4vmw.600.0.0.2494585
CreationDateComp : 06/02/2015 02:37:02
Analysis         : Identical

Name             : scsi-ips
VendorRef        : VMware
VersionRef       : 7.12.05-4vmw.600.0.0.2494585
CreationDateRef  : 06/02/2015 02:37:02
VendorComp       : VMware
VersionComp      : 7.12.05-4vmw.600.0.0.2494585
CreationDateComp : 06/02/2015 02:37:02
Analysis         : Identical

Name             : esx-base
VendorRef        : VMware
VersionRef       : 6.0.0-3.57.5050593
CreationDateRef  : 10/02/2017 07:03:35
VendorComp       : VMware
VersionComp      : 6.0.0-3.69.5572656
CreationDateComp : 17/05/2017 23:28:37
Analysis         : UpgradeFromRef

#Result cut

#The command below provides a better output, but I can't display it on the blog.
#Compare-EsxImageProfilePlus $LenovoEsxImageProfile $VMwareEsxImageProfile | ogv

When the output is in a table, it is easier to see what has changed and what has not.

The following result is interesting:

Name             : net-ixgbe
VendorRef        : Intel
VersionRef       : 4.4.1-1OEM.550.0.0.1331820
CreationDateRef  : 05/02/2016 19:02:18
VendorComp       : VMware
VersionComp      : 3.7.13.7.14iov-20vmw.600.3.57.5050593
CreationDateComp : 10/02/2017 07:03:21
Analysis         : DowngradeFromRef

The Vendor of the VIB is not the same.
The VIB with the latest “CreationDate” is not the newest. The version in the OEM is higher than in the default VMware VIB.
Only the version matters, it is not possible to trust the “CreationDate” to identify the “newest” VIB.

Merge two images

Merging two images prevents the introduction of undesirables VIBs in a software depot “mounted” but not present in any of the two profiles.
The workflow is simple:
Download the latest Lenovo bundle. (Download VMware vSphere> Custom ISOs)
Download the latest ESXi patches bundle.(MyVMware Patch Downloads login required)
Add these two ZIP files as depot and identify the correct image profiles.
For the Image in the “Esx patches” avoid the “s”, security only, to get all latest VIB.

$NewProfile = Merge-EsxImageProfile $Profile1 $Profile2 -AcceptanceLevel PartnerSupported -OverrideProfileWithSameName

Leave a Reply

Your email address will not be published. Required fields are marked *