If you don’t have one under /Devices by Type, create a dynamic group for ESX hosts and another dynamic group for vCenter. We called ours “VMware Hosts” (AppliesTo system.virtualization =~ "VMware ESX host") and “VMware vCenters” (AppliesTo system.virtualization =~ "VMware ESX vcenter") respectively.
Then create a Resource Inventory report where the Resource Group is “Devices by Type/VMware*”. Add the system.virtualization, auto.vcenter.version, and system.version properties and run it.
Voila, you now know the version numbers of your ESX and vCenter resources and you can compare that to the versions in the VMware Advisory.
LM User
Posted 3 years ago·Last reply 3 years ago
3 comments
LM User
OP3 years ago
And here’s another reason for LM to document their Groovy libraries. That’s definitely simpler and I’ll probably be pulling it in to go alongside or replace mine.
Shack
·3 years ago
I needed this as well some time ago, probably for the very same reason. Did it this way.
import com.santaba.agent.groovyapi.esx.ESX<br/>import com.vmware.vim25.mo.*<br/><br/>def host = hostProps.get("system.hostname")<br/>def user = hostProps.get("esx.user")<br/>def pass = hostProps.get("esx.pass")<br/>def addr = hostProps.get("esx.url") ?: "https://${host}/sdk"<br/><br/>def svc = new ESX()<br/>svc.open(addr, user, pass, 10 * 1000) // timeout in 10 seconds<br/><br/>def si = svc.getServiceInstance()<br/>def rootFolder = si.getRootFolder()<br/><br/>// Get resource clusters<br/>HostSystem esxHost = new InventoryNavigator(rootFolder).searchManagedEntities("HostSystem").first()<br/><br/><br/>println "auto.vcenter.fullname=${si.aboutInfo.fullName}"<br/>println "auto.vcenter.build=${si.aboutInfo.build}"<br/>println "auto.vcenter.licenseproductname=${si.aboutInfo.licenseProductName}"<br/>println "auto.vcenter.os.type=${si.aboutInfo.osType}"<br/>println "auto.vcenter.product.line=${si.aboutInfo.productLineId}"<br/>println "auto.vcenter.version=${si.aboutInfo.version}"<br/><br/><br/>return 0
LM User
OP3 years agoAnd here’s another reason for LM to document their Groovy libraries. That’s definitely simpler and I’ll probably be pulling it in to go alongside or replace mine.
Shack
·3 years agoI needed this as well some time ago, probably for the very same reason. Did it this way.
LM User
OP3 years agoThanks @Stefan W: https://github.com/cisagov/ESXiArgs-Recover