VMware Cloud Community
pizzle85
Expert
Expert

Returning vRO errors to vRA

I haven't been able to find any documentation relating to returning vRO error outputs to vRA. I would like to present the user with information more relevant to their resource deployment when it fails. Right now they just get the text "Request failed: <VM> not found, and possibly deleted before provisioning finished." Does anyone know if i'm able to capture the real vRO error (or custom error) and return that to vRA to be displayed instead? I would want to do this on IaaS and ASD operations.

17 Replies
ransalman
Contributor
Contributor

You can try to use throw in javascript scriptable task.

just use throw "error message you want the user to see).

You can also use try and catch in javascript, this supposed to reflect the error to the user in the request details once failed.

See JavaScript Errors Try Catch Throw

Reply
0 Kudos
pizzle85
Expert
Expert

I added in a try catch clause that throws the error capture in the try clause like:

try {

  var networkManager = ipamConnection.getNetworkManager();


  var result = networkManager.getNetwork(netaddr, cidr, networkView);


  System.log("Network [" + netaddr + "/"+ cidr + "] was received successfully.");

  return result;

}

catch (Exception) {

  throw Exception;

}

I see the error in vRO but i still see the same generic error in vRA:

Status Details

Request failed: <VM> not found, and possibly deleted before provisioning finished.

Reply
0 Kudos
nubronco
Enthusiast
Enthusiast

pizzle - this is something I have wondered also. I am very interested to see what happens with this.Just out of curiosity what version of vRA are you running?

Reply
0 Kudos
pizzle85
Expert
Expert

im running vRA 6.2 and vRO 5.5.2.

Reply
0 Kudos
nubronco
Enthusiast
Enthusiast

So, I stumbled across something the other day. I have some vRO workflows published as services using Advance Services. For some reason one failed the other day. The exception was actually included in the status details of the request. The message is below. I would like this level of detail to be displayed for all task failures.Is this the level you are looking for also?

Error - Could not find existing prefixEntity for machinename{###}. (Workflow:UpdateMachinePrefixNextNumber / Scriptable task (item2)#13)

Pizzle - I believe I was told that in 6.2 you could configure either vRA or maybe it is vRO to just pause a request if it runs into an error instead of removing the progress that was made. This would allow me to then go check the error try and resolve it and then resume the build. Have you seen/heard about this? I am still running 6.0.1 hope to upgrade late next month and hope this feature is there.

Reply
0 Kudos
pizzle85
Expert
Expert

Yes, that's the functionality i'm looking for. I'm not surprised it works in ASD but not IaaS.

I've never heard of the pause option. I suppose you could catch each workflow error and on error go to a pause statement or user input state to allow resuming the workflow. You would have to put those everywhere though.

Reply
0 Kudos
SeanKohler
Expert
Expert


This would be easy to do in the Machine Build or Machine Provision Workflow.  You would be checking in vRO for the "continue" step however.  You can use the "User Interaction" mechanism in vRO to actually make it a prompt out.  I use a similar process in my Delete Business Group Workflow (and AD Groups) from ASD... but it would work fine from the workflow machine stubs as well...

You would set your condition for failure to call out User Interaction put all your "fix it" variables in External Inputs so you can update whatever needs to be updated and then loop back through the workflow for continuation.  Basically... you gotta build it, but the capability does exist in that form.   If there is some *other* capability new to 6.2, I am not sure what it is yet.

Reply
0 Kudos
SeanKohler
Expert
Expert


>>  I would like to present the user with information more relevant to their resource deployment when it fails.


Edit:  I see where you are talking about.

In the Request, correct? I would like to be able to do this as well.

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot

Me too. Our vCO workflows are complex and sending back a proper error message would help users greatly.

Reply
0 Kudos
SeanKohler
Expert
Expert

Confirmed vRA 6.2 ASD returns error thrown...

RequestErrorWF.jpg

RequestError.jpg

Reply
0 Kudos
blanket
Enthusiast
Enthusiast

Bump... still looking on how to do this... even in vRA 7.1.

I do throws in MachineProvisioned WF, but what vRA reports is just: "The following component requests failed: Machine. Request failed: xxx not found, and possibly deleted before provisioning finished."

Has anyone come up with something useful or can point me in the right direction?

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot

I second that bump. Orchestrator is the biggest source of pain for our vRA environment.

Reply
0 Kudos
pizzle85
Expert
Expert

When i moved from the Workflow Stubs to Event Subscriptions the vRO errors I throw are shown in vRA as expected.

pizzle85
Expert
Expert

FWIW i also created a workflow that grabs all the exact same data that the WFStubs did so i didn't have to change any of my existing WFStub workflows to have them work with the Event Broker. If you want the workflow i can post it here. It would have been cleaner and more efficient to just rewrite my provisioning workflows but time dictated that i put in a shim. Smiley Wink

nubronco
Enthusiast
Enthusiast

This doesn't directly solve your issue. But in vRA 7.2 I do see some nice improvements. In the attached files, if you look at wfErr0, it shows a failed request that had a Event Broker subscription that failed. If you hover over the 'Details' area it shows you some details about the workflow failure. Also, if you click on 'View Details' over on the left where I placed an arrow, it will pop up a box with the details. An example of this box is in wfErr1.

You might not be on 7.2 but this could help justify looking into an upgrade. Hope this helps some.

wfErr0.PNG

wfErr1.PNG

Reply
0 Kudos
blanket
Enthusiast
Enthusiast

Hi pizzle85, that is good information! Could you please post your WFs? Much appreciated!

Reply
0 Kudos
patso
Contributor
Contributor

I had an issue to return the thrown vRO error in Requested PRE state. It appear in the Infrastructure events log but in the Request details I had "The following component requests failed: vSphere_Machine_1. Request failed: VMname not found, and possibly deleted before provisioning finished"

So I decided to use BuildingMachine PRE state and now I can view the vRO thrown error message in both Infrastructure events & Request details

The vRA version is 7.2

Reply
0 Kudos