-
1. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
Manish Patil Mar 7, 2018 1:13 AM (in response to amipatil)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.
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
-
3. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
amipatil Mar 7, 2018 7:20 PM (in response to Manish Patil)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.
-
4. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
Manish Patil Mar 7, 2018 10:38 PM (in response to amipatil)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
-
5. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
amipatil Mar 8, 2018 9:35 PM (in response to Manish Patil)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();
-
6. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
Manish Patil Mar 8, 2018 10:20 PM (in response to amipatil)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
-
7. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
amipatil Mar 11, 2018 2:46 PM (in response to Manish Patil)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. -
8. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
Manish Patil Mar 11, 2018 11:13 PM (in response to amipatil)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?
-
9. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
amipatil Mar 12, 2018 3:33 PM (in response to Manish Patil)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.
-
10. Re: Error while requesting a virtual machine for provisioning from Servicenow to VMware
Manish Patil Mar 12, 2018 10:44 PM (in response to 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.