VMware Cloud Community

vRO 8.6.2 Rest Host Connection needing to re authenticate daily when using transient hosts.

I'm noticing in my 8.6.2 orchestrators I'm having to re authenticate one of my rest hosts daily.  I have this rest host configured to point to a VIP.  When I get an authentication token back from the vip it includes the host the token was granted from.  These tokens are unique per host behind the load balancer so I point subsequent calls to the api to this host using the token I grabbed.  This has worked flawlessly for years and still working fine in my 7.x environment.  In vRA/vRO 8 though once a day or so I end up getting failures from the api I am accessing saying username or password are incorrect.  If I run the "Update a rest host" workflow and re enter the credentials everything works again for a some period of time.  Not sure exactly how long but not more than a day.  This is the code I'm using to query for the token.  I create a transient host using the rest host I created as my template:

hostResource and restOperation are values I pull in from some config items.

var inParamtersValues = [];
var restHost = RESTHostManager.getHost(hostResource.name);
var transientRestHost = RESTHostManager.createTransientHostFrom(restHost);
// force https for authentication
transientRestHost.url = transientRestHost.url.replace("http:","https:");

var transientOperation = transientRestHost.addOperation(restOperation);
var request = transientOperation.createRequest(inParamtersValues, null);
request.contentType = "";
var response = request.execute();
0 Kudos
0 Replies