Original Message:
Sent: Jul 29, 2024 02:36 PM
From: Carl Power
Subject: Get VMtools component version from Single Image Cluster
I have since found a script from William Lam (Broadcom), and singled out the lines I needed:
vmware-scripts/powershell/Get-vLCMClusterImageInformation.ps1 at master · lamw/vmware-scripts
Resulting script looks like this:
# Discover the VMtools version in the source single image cluster image$SrcClusMoRef = (Get-Cluster -Name $SrcClusName).ExtensionData.MoRef.Value$SrcClusSw = Invoke-GetClusterSoftware -Cluster $SrcClusMoRef$SrcClusVMt = $SrcClusSw.components.'VMware-VM-Tools'.versionWrite-Host "VMtools version: $SrcClusVMt"
Original Message:
Sent: Jul 28, 2024 10:33 PM
From: Carl Power
Subject: Get VMtools component version from Single Image Cluster
Hi coders,
I am developing a script to automate updating our single image clusters (as we have over 160 clusters with the same hardware!), but I am looking for a means to skip a cluster if the target cluster is the same as my source cluster.
I have tried a means to compare clusters, but that does not appear to be a thing, so I seem to need to dig deeper and compare the JSON images.
Unfortunatey you cannot simply export the single image settings to an array without saving a file, so instead of saving over 160 meaningless JSON files every time I run the script, I figure the most often changed component for us is the VMtools component, so I want to use a combination of the VMtools version and base image version to check if my cluster needs to be updated.
I don't want to check the version installed on the host, as my parity for the clusters should be the image itself.
I can easily get the cluster base image version, but for the life of me I cannot get the component version for the VMware Tools Async Release - the nearest I can get is a Get-Cluster command...
Get-Cluster -Name $SrcClusName | Select-Object -Property @{n='Components'; e={$_.Components.Name}}Components ---------- {Cisco Ethernet native driver, Cisco Fibre Channel native driver, Network driver for Intel(R) X722 and E810 based RDMA Adapters, VMware Tools Async Release}
Does anyone know how I can discover the VMtools component version of a Single Image Clusters image?