VMware Cloud Community
barnette08
Expert
Expert

vSphere Client Integration Debugging Issues

I've been working to get my workflows that are working in vRO to now work in vSphere via context actions.  I'm running into a few issues and I'm curious where you all think would be the best logs to look into for this type of information.

1.  Some times when kicking off the workflow from a context action, the start workflow never gets sent to vRO.

2.  There are certain drop-down menus that should provide selections but inside of the vSphere Client they are blank text fields, but works fine in vRO.

3.  There are some URL help links I provided on the question/values pages in the vRO workflows but they only show on 1 page and it's shows directly as the <a href=>.

0 Kudos
6 Replies
iiliev
VMware Employee
VMware Employee

Hi,

1. To troubleshoot this one, the first step is to check if the REST call to start the workflow has reached vRO server or not. It can be found in vRO Tomcat's access log file at /var/log/vco/app-server/localhost_access_log.txt. Look for a record like POST /vco/api/workflows/{workflowid}/executions

If no record appear there, then you should check vSphere Web client log file at /var/log/vmware/vsphere-client/logs/vsphere_client_virgo.log

2. Usually, this happens when your dropdown values are provided by vRO action(s), and this action has either thrown an exception or returned an unexpected value. I'd suggested to instrument the action code with additional System.log() statements to trace what's going on. The most common errors are to not validate action input parameters (in Web client, the presentation action can be called a bit too early and some of the inputs that refer to another presentation fields can still be null or not yet initialized) and to throw exception/return null when the action return type is an array of something (the proper thing to do in this case is to return an empty array instead of null).

3. Could you give examples for such questions/values pages? In general, the presentation in Web client does not support all the features of presentation in vRO Java client; URL / HTML stuff is one of unsupported things.

0 Kudos
barnette08
Expert
Expert

Thanks for the quick reply, it's going to take some time to look into 1. and 2. but for 3.

3. Could you give examples for such questions/values pages? In general, the presentation in Web client does not support all the features of presentation in vRO Java client; URL / HTML stuff is one of unsupported things.

When you kick off a worflow and you must provide all the input values so the workflow can be submitted, there is a link at the top of each of those input presentation screens.  It sounds like based on your response that it's not supported in vSphere.

0 Kudos
barnette08
Expert
Expert

After looking at the logs you pointed out, below is what I've found.  The interesting thing to note is that the workflow run from the a context action does not execute, but the the same test workflow run via the vRO tree within vSphere executes and completes.

localhost_access_log.txt

2018-10-31 22:04:06.371+0000 [https-jsse-nio-0.0.0.0-8281-exec-3] 10.234.148.224 - - "POST /vco/api/workflows/0f94b360-c3e9-4bc4-a8a2-20dcf511f5df/executions/ HTTP/1.1" 400 103 4645

2018-10-31 22:04:06.776+0000 [https-jsse-nio-0.0.0.0-8281-exec-2] 10.234.148.224 - - "GET /vco/api/inventory/System/WorkflowExecutions?sortOrders=%252BstartDate&maxResult=50&conditions=state%5Erunning%7Cfailed%7Ccompleted%7Ccanceled%7Cwaiting-signal&conditions=startDate%253E2018-10-31T21:44:06.519Z HTTP/1.1" 200 430 248

vsphere_client_virgo.log

[2018-10-31T22:04:06.371Z] [WARN ] http-bio-9090-exec-21 70008692 100409 200322 org.springframework.web.client.RestTemplate  POST request for "https://<vRO IP Address>/vco/api/workflows/0f94b360-c3e9-4bc4-a8a2-20dcf511f5df/executions/" resulted in 400 (); invoking error handler

Any ideas why this would happen via a context action and not from the tree?

0 Kudos
iiliev
VMware Employee
VMware Employee

So, the logs show the request is failing with error 400 (Bad Request). This error means the request cannot be processed due to invalid syntax, most likely the problem is with workflow input parameters sent in POST request payload.

Code-wise, there are not much differences between executing a workflow via context menu and executing a workflow from the inventory. The main difference is that when you start it via context menu, it will try to auto-populate the context object you have right-clicked on to a matching input parameter of the workflow.

A few questions:

  • which versions of vRO and vSphere Web client are you using?
  • are you providing the same inputs when starting the workflow via context menu and from the inventory?
  • if possible, could you export your workflow (using vRO Java client) and attach the exported *.workflow file here in order to try to reproduce this error in our lab?

Unfortunately, Tomcat access log file does not log the request payloads, so it is hard to say what exactly is the problem with the payload when this error happens. One option is to use network sniffers like Wireshark to examine the network traffic and see what is the payload content.

0 Kudos
barnette08
Expert
Expert

vSphere 6.5U2 and vRO 7.3.1

Yep, same inputs via vSphere inventory and context menu actions.  The context actions are set for multiple, so they can run at dc, cluster, or host level.   That shouldn’t have an impact right?

Also, PMing you about the workflow file.

0 Kudos
iiliev
VMware Employee
VMware Employee

Yes, single or multiple vCenter object types selection doesn't matter.

0 Kudos