Over the past couple weeks our team has encountered a few issues which is impacting our Plugin's usage of UserSession and operation in Linked Mode across multiple VCenter Servers.
The first issue is that we are having the UserSessionService @Autowired injected into our plugin:
@Autowired
protected UserSessionService userSessionService;
We use the userSessionService to get the UserSession:
UserSession userSession = userSessionService.getUserSession();
This works fine for a period of time after the user has logged into the VCenter server and entered our plugin. But after a period of time, say 30 minutes, when we go to get the user session it returns null. Its like the user session has timed out or something. The VSphere UI session is still active, it hasn't timed out and you can enter other parts of the UI to carry out successful actions, so overall things haven't timed out or expired. But we are no longer getting a valid user session back when we request it from the service.
Is there something we are doing wrong in our plugin? Are we supposed to call something or some how trigger the renewal of the user session for our plugin?
----------
The second question has to do with when we are operating in linked mode and need to call from our plugin code running on VCenter A over to VCenter B to perform an action with resources that are controlled by the plugin running over there. When we call over to our code on B, the UserSessonService isn't returning to us a user session, it is null from the start. So how are our plugin instances running on the two servers supposed to handle this cross calls and end up with a valid usersession?
--------
The third question is I have a couple of VCenters in linked mode, say A and B. I reboot the B VCenter server. I don't log into the VCenter B server. At this point it seems that with out having logged in, our plugin has not been redeployed on VCenter B. Thus any cross calls we attempt from our plugin running on A to B will fail with 404 since our plugin isn't running and our REST endpoints are not available. If you do log into VCenter B, then our plugin does get redeployed. However the plugin on B will not have have a valid user session (basically the same state as the previous question).
--------
Any help with the above questions would be greatly appreciate. Is there some calls or other mechanisms we need to be using to get user sessions? Is there something we need to do to trigger the deployment of our plugin on VCenter B from A when the plugin hasn't been deployed as part of a login to a rebooted system?
Thanks for any help/responses.