Please provide inputs on fixing this.
Could you please send us the complete logs in order to investigate further.
In addition, what are the versions of the vSphere Client and vCenter that you are using and how can we reproduce this error (what is the scenario).
Vsphere and Vcenter version - Version 6.5
OS and Version running - VMware ESXi 6.5
This is the exact log:
Client received SOAP Fault from server: The session is not authenticated. Please see the server log to find more detail regarding exact cause of the failure.
While trying to add hosts in a cluster for monitoring this error is seen.
Our issue is, is this something to be fixed at code or is issue with the hosts?
For me, it seems like the session is not handled correctly.
It is possible that you are not setting the server thumbprint or the session cookie.
Please have a look at the HTML Sample plug-in's code from vSphere Client SDK 6.7 and search for "VimObjectServiceImpl.java"
Link to the SDK - https://code.vmware.com/web/sdk/67/client
Are you saying that when this line of code gets executed in a single login session, it is not getting the same session but a different one and that's the reason why it is throwing that error.
I mean that it is possible that the server thumbprint or the session cookie are not set correctly or not set at all and when you try to manipulate the vSphere objects, there is an error.
This is why I am suggesting that you look at our HTML Sample plugins which uses vim25 to display a list of hosts. There, you can see how we are doing it and compare it with your code.