VMware Cloud Community
amipatil
Contributor
Contributor
Jump to solution

Error while requesting a virtual machine for provisioning from Servicenow to VMware

The vRA plugin for VMWare has been installed in Servicenow and we are able to pull in Catalog items and CIs from VMware into Servicenow.However we are receiving following error after submitting the catalog item ( for provisioning ) within Servicenow

1) Servicenow Jakarta.

2) VMWare plugin installed. ( version compatible )

3) Able to pull in catalog items and CMDB Cis from the vra ( VMWare Infrastructure )

4) After submitting a catalog item , I get the error as attached.

--------- Error Log from Servicenow ------

REST call error found inside VRASNRequestUtil.getTemplateViaRest: Method failed: (/catalog-service/api/consumer/entitledCatalogItems/14a239ef-7c12-49f9-9003-bb534a7fbb94/requests/template) with code: 401 - Invalid username/password combo

pastedImage_0.png

Reply
0 Kudos
1 Solution

Accepted Solutions
amipatil
Contributor
Contributor
Jump to solution

Thanks Manish.

I have fixed this issue for now by updating the Business Rule : VRA Map access token to Requests

Root cause was that the token was not getting set as there is nothing from client side which sets the 'VRA_AUTH_TOKEN' mentioned in the Business Rule.

Fix :

// Commented following line

//var token =  gs.getSession().getClientData('VRA_AUTH_TOKEN');

// Added following line

var token = (new VRASNAuthGenerator()).getAuthToken();

View solution in original post

Reply
0 Kudos
10 Replies
CalsoftTechie
Enthusiast
Enthusiast
Jump to solution

Hi amipatil​,

I will suggest you to run client registration once again.

Before that you need to clear previously set ClientId and secret.

Below is the link to clear values of these 2 properties.

https://<YOUR INSTANCE>.service-now.com/sys_properties_list.do?sysparm_query=nameINvrasn.clientID%2Cvrasn.clientSecret&sysparm_first_row=1&sysparm_view=

Once done, logout from servicenow, re-login to ServiceNow. Page redirection to vRA happens, enter credentials and you should redirect to ServiceNow back.

Once you are done with these steps, clear specific property value from below table and run scheduled jobs once again to re-import data.

https://<YOUR INSTANCE>.service-now.com/u_vra_sn_properties_list.do?sysparm_query=u_active%3Dtrue&sysparm_first_row=1&sysparm_view=

Regards

Reply
0 Kudos
amipatil
Contributor
Contributor
Jump to solution

Hi Manish,

Thanks for the reply .

I cleared the properties and now running the client registration again.

I am not able to set the client ID and client secret due to following error

pastedImage_5.png

Reply
0 Kudos
amipatil
Contributor
Contributor
Jump to solution

Please ignore the previous message >

I have set up Client ID and Client secret and followed the steps you mentioned although still getting the same error.

I believe it is related to the userToken variable being passed from Servicenow to VMWare.

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast
Jump to solution

Hi amipatil​,

I see you are getting an error, but as you confirmed that clientId and clientSecret are being set, Can you try logging out of ServiceNow and relogin and perform import job run once again.

Let me know if you see any error in ServiceNow logs.

Regards,

Manish

Reply
0 Kudos
amipatil
Contributor
Contributor
Jump to solution

Thanks Manish.

I have fixed this issue for now by updating the Business Rule : VRA Map access token to Requests

Root cause was that the token was not getting set as there is nothing from client side which sets the 'VRA_AUTH_TOKEN' mentioned in the Business Rule.

Fix :

// Commented following line

//var token =  gs.getSession().getClientData('VRA_AUTH_TOKEN');

// Added following line

var token = (new VRASNAuthGenerator()).getAuthToken();

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast
Jump to solution

Hi amipatil

The tokens which you are talking about are different.

i)VRA_AUTH_TOKEN is used to maintain specific user session and is stored in session.

ii)new VRASNAuthGenerator().getAuthToken() is used while making REST call to vRA platform.

I doubt you will be able to successfully provision a request as your session token is missing here.

Let me know if all good here.

Regards

Manish Patil

Reply
0 Kudos
amipatil
Contributor
Contributor
Jump to solution

Hi Manish ,

I followed the steps that you mentioned although that didn’t resolve the issue . We have not set up ADFS yet. Any idea whether the VRA_AUTH_TOKEN is set only after the ADFS is set up ? I found out that the root cause is the token variable not bing set on the requested item in Servicenow. Any idea how this variable is set ? I can see the line ---  var token =  gs.getSession().getClientData('VRA_AUTH_TOKEN') --- everywhere in the scripts however nothing to set the VRA_AUTH_TOKEN itself from client or server

We are testing only with one user whose credentials are same in Servicenow as well as VMware and this user is Admin in vRA.Therefore it works for this user.

Let me know your throughts.

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast
Jump to solution

If ADFS is not there then vRA re-direction and authentication should happen post this authentication you should be redirected back to ServiceNow instance.

Is this happening in your case without ADFS?

Reply
0 Kudos
amipatil
Contributor
Contributor
Jump to solution

Hi Manish , I have disabled the redirection as it was impacting all the other users irrespective of whether they wanted to request a machine for provisioning or not. They were being redirected to vRA for login. This is as designed although the plan was to test the functionality for POC and then enable ADFS.

Reply
0 Kudos
CalsoftTechie
Enthusiast
Enthusiast
Jump to solution

Hi amipatil,amipatil

If redirection is disabled then token won't be generated. Token generation is step happens during re-direction process.

Enable vRA re-direction and try again.

Reply
0 Kudos