VMWare ESX discovery failing

  • KM03294378
  • 28-Nov-2018
  • 29-Oct-2020

Summary

VMWare ESX discovery failing

Question

I'm trying to access our company's VMWare ESX hosts using the VMWare ESX Connection by VIM job. We have worked with the VM team to set up an account with read-only access. I can see the account listed under the permissions tab of several virtual systems within vSphere. Also, when looking at the communication log for the job, the connection appears to be established and then it fails after that with the following message:
Traceback (most recent call last):
File "vmware_vim", line 543, in onConnection
File "vmware_vim", line 602, in discoverConnectedEsx
File "_vmware_vim_base", line 1656, in discover
File "_vmware_vim_base", line 1653, in getEsxHost
ValueError: Failed to retrieve ESX server details
</log>
<log start="09:50:39" severity="debug">VMware VIM: Internal error. Details:
Traceback (most recent call last):
File "vmware_vim", line 543, in onConnection
File "vmware_vim", line 602, in discoverConnectedEsx
File "_vmware_vim_base", line 1656, in discover
File "_vmware_vim_base", line 1653, in getEsxHost
ValueError: Failed to retrieve ESX server details
</log>
<log start="09:50:39" severity="debug">Reporting error code 103 to framework.</log>
<log start="09:50:39" severity="debug">Error message is: VMware VIM: Internal error. Details:
Traceback (most recent call last):
File "vmware_vim", line 543, in onConnection
File "vmware_vim", line 602, in discoverConnectedEsx
File "_vmware_vim_base", line 1656, in discover
File "_vmware_vim_base", line 1653, in getEsxHost
ValueError: Failed to retrieve ESX server details
</log>
<DISCONNECT start="09:50:39" duration="47" CMD="client_disconnect" RESULT="" IS_NULL="Y" type="vmware" credentialsId="76_1_CMS" />
<log start="09:50:39" severity="info">Execution current time:2018/11/06 09:50:39</log>
</execution>
I've verified that we have the vim25.jar file is in the proper folder on the assigned DFP, but still not working.

Answer

The script we need to edit is _vmware_vim_base.py. We can find it under the VMWare package on adapter management.
There is only a little line we need to change:
in def getEsxHost(self):
if results and len(results) == 1:
There we would need to put “if results: “ instead of "results and len(results) == 1".