Dhayaanandh
Contributor
Contributor

How the ServerInfo is being set in com.vmware.vise.usersession.UserSession ?

Hi,

      I am working in Vcenter plugin for Vrops. Can anyone please help me in identifying how the ServerInfo is being populated in  com.vmware.vise.usersession.UserSession?.

In many Cases i see this

"userSessionService.getUserSession().serversInfo[0].name" value is coming as FQDN(i.e hostname.domainname), but i recently saw one case where it is giving only the host name and not the domain part of it. Is it taking from DNS?.How can i check this value?

Kindly help me

Thanks

Dhayaanandh P

Reply
0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi Dhayaanandh,

It could be the vCenter URL or the URL of the service endpoint which could be the same but generally there is no particular format expected.

ServerInfo.name property is just a display value so it can vary, you shouldn't base any logic on it but for showing it somewhere (e.g. vCenter selector). Normally, you need the ServerInfo.serviceUrl property.

Cheers,

Vladi

View solution in original post

Reply
0 Kudos
Dhayaanandh
Contributor
Contributor

Thank you so much Vladi for your answer.

Cheers,

Dhayaanandh P

Reply
0 Kudos
Dhayaanandh
Contributor
Contributor

Hi Vladi,

        Just to understand, Is there any way that I could change/set the ServerInfo.name property manually. I cleared the cache and tried the changing the URL with adding the domain name, but it didn't reflect, the ServerInfo.name is still showing only the host name.

Thanks

Reply
0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi Dhayaanandh,

The getUserSession() return object just contains the information about the currently active session. Setting some fields on it is not expected to modify the behavior in the general case.

It is not really clear what you are trying to achieve. Where do you expect your change to be reflected?

Please elaborate a bit on the use case and include a screenshot if that would help (obfuscating any legally sensitive info).

Cheers,

Vladi

Reply
0 Kudos
Dhayaanandh
Contributor
Contributor

Hi Vladi,

        I was looking at how the server name in the user session is being set. Attached is the screen shot for your reference. In this case it is shown as FQDN , but in some case it is only host name.

Thanks

Dhayaanandh P

Reply
0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi Dhayaanandh,

This is internal implementation. As I mentioned earlier this name might be set to any arbitrary string the core of vSphere Client UI requires.

Let's handle this over private messaging. Thanks.

Cheers,

Vladi

Reply
0 Kudos