I need to find out the whether an ESX host is managed by a VC or not ?
And I need to find out by querying ESX Host Web Service running on ESX Host by using an HOST SDK API. I do not want to go through via VC SDK Web Service.
I tried to use HostSystem.QueryHostConnectionInfo()[/b] by calling on ESX Host Web Service connection, which returns HostConnectInfo, this object contains a member "serverIp" whose value as explained in VI SDK Reference guide: The IP address of the VirtualCenter already managing this host, if any.",
But this property shows as "Unset" when I queried on ESX Host Web Service connection.
But the same HostSystem.QueryHostConnectionInfo() by calling on VC Web Service connection, returns this property as my VC IP address (serverIp=xx.xx.xx.xxx)
And also even I tried to check HostRuntimeInfo. connectionState, but this is always returning connected on ESX, but returns connected /
"disconnected on VC based on the current state. So even this property from ESX Host Web Service is also not useful to find whether ESX is managed by the VC or not.
Is there any one who knows any other reliable way to find whether ESX is managed by a VC or not by querying directly ESX web service ?
I am not able to access the link you have provided. I am getting the following error message:
"Error: you do not have permission to view the requested forum or category. "
If possible can you please cut & paste the text from that message ?
Ravindra
I took some of my hosts out of the VC and put them back in again. It appears that when a host is added to the VC, you can connect via SDK to the ESX Host and look at the properties for "content->sessionManager". There are two sub properties of interest there:
"content->sessionManager->message" : which shows as empty if host is not in VC and shows as "This host is currently being managed by the VirtualCenter with IP address ..." if host is managed by VC.
"content->sessionManager->sessionList" : which will include the session with the fullName of "VMware VirtualCenter administration account" if the host is managed via VC.
Does this work for you? I can write some specific examples you need more clarity.
BTW, I did not have permission to get to the other links either that were posted previously.
