Last Week I had to analyze a huge VMware vSphere environment regarding configuration issues and risks. One of the challenges was to Compare installed VMware ESXi VIBs, to make sure not only the kernel but all packages are identical on the Hosts within the Cluster. Different packages on the VMware ESXi hosts are not necessarily a problem but a huge risk. An unused (not loaded) driver VIB for example is no risk, but different NIC driver versions on the Hosts in a VMware NSX enabled Cluster are a huge problem.
To get deeper insight in to the used NIC driver and firmware there is another PowerShell function available: Get-NICDetails.psm1 (Blog Post: Script – Get ESXi NIC Firmware and Driver Details).
The Function - Compare installed VMware ESXi VIBs
The comparison of the installed VIBs is based on the PowerShell Cmdlet Compare-Object:
The
Compare-Object
cmdlet compares two sets of objects. One set of objects is the “reference set,” and the other set is the “difference set.”
The data (Array of VIB IDs) for the comparison is simply gathered via the VMware PowerCLI Cmdlet Get-ESXCLI -V2.
My function only accepts a single vSphere Cluster object as input. If you need to verify multiple clusters against the reference host, the cluster input can also be piped: Get-Cluster | Validate-ESXiPackages -RefernceHost $(Get-VMHost "<Hostname>")
In all of the above examples, the VibDiffSideIndicator property is missing. This additional property should indicate if the package is missing on the reference host or the verified host. Explanation from the Compare-Object documentation:
The result of the comparison indicates whether a property value appeared only in the object from the reference set (indicated by the <= symbol), only in the object from the difference set (indicated by the
=>
symbol) or, …
In my example is the NSX-V VIB not installed on the reference host but on the verified host:
|
|
Get the Function
The Function is part of my vSphere-Modules GitHub Repository. Direct Link to the Function: Validate-ESXiPackages.psm1
If my pull request will be accepted, the Function is also available in the VMware PowerCLI-Example-Scripts GitHub Repository.