VMware Cloud Community
SteveR123
Enthusiast
Enthusiast

vRO 7 WF problems

Hi. I'm struggling to get a WF running correctly and I'd appreciate any help as always. I've started with the "get custom props" WF from extendingclouds.com which works fine. I then simply want to output a couple of values from there to the "run script in vmguest" WF. We'll call them WF-A & WF-B for now.

If I add WFB to WFA and bind the inputs/outputs it fails, but it causes the first WF to fail (WF-A) with "TypeError: Cannot call method "get" of null (Workflow:Property Collection and Get VM / Get Properties (item1)#1)". The issue is that this seems ot be the problem no matter which way i construct the Workflow.

I then tried to add the "get custom props" (WF-A) to the WF-b workflow. Both working independantly but again this fails with the same error.

Finally I created a 'master' workflow and added both of these to it, set it up and .......same again! I've added some scriptbale tasks to generate logs at each stage of the WF to be sure I'm getting the correct bindings etc and they look ok.

No doubt I'm missing something simple and I'd really appreciate any help you can give.

Thanks in advance and regards

Steve

0 Kudos
13 Replies
iiliev
VMware Employee
VMware Employee

Hi Steve,

Could you attach a vRO package with your workflows? This will help us to troubleshoot what exactly is not working.

0 Kudos
SteveR123
Enthusiast
Enthusiast

Hi , I have attached one of the workflows. I believe it is the "masterWF" option I described, with both previosuly working workflows included. Let m eknow if any questions please.

Thanks for your help

0 Kudos
iiliev
VMware Employee
VMware Employee

Could you also provide the linked workflows 'Property Collection and Get VM' and 'Run script in VM Guest 2'? I don't have them in my environment.

0 Kudos
SteveR123
Enthusiast
Enthusiast

Please see attached.

Thank you

0 Kudos
iiliev
VMware Employee
VMware Employee

OK, the error you see - "TypeError: Cannot call method "get" of null (Workflow:Property Collection and Get VM / Get Properties (item1)#1)" means that the input parameter 'payload' is null/missing.

How exactly do you start the workflow TestWF? Using vRO Workflow Designer, or via REST call?

0 Kudos
SteveR123
Enthusiast
Enthusiast

Hi, I'm triggering it from the event broker in vRA actually. As mentioned though, if I trigger the property collection alone it works fine, the payload is input and the name and UUID (for example) are output ok. The problem is when they are combined as mentioned.

Thanks

0 Kudos
iiliev
VMware Employee
VMware Employee

I have some problems with my vRA appliance so I'll probably have to redeploy a new one and won't be able to test the workflow before next week.

The error message clearly says that the error is thrown in workflow 'Property Collection and Get VM', item 'Get Properties', line 1 . On line 1 of this item there is the following code:

System.log("BlueprintName: " + payload.get("blueprintName")) ;

The only situation when such error could happen at this line is when something is wrong with payload object, either when it is passed by event broken as an input parameter to TestWF workflow execution, or when the object is transferred from TestWF to 'Property Collection and Get VM' workflow and then to 'Get Properties' item.

Could you add some logging to dump payload object in all these places? It should be null/invalid at some point; otherwise I don't see a reason for getting such error at this location.

0 Kudos
SteveR123
Enthusiast
Enthusiast

Hi thanks for this. I agree it looks like there is an issue there however the payload input is fine until I modify the workflow. So if I take the payload from EB and log some properties from the Blueprint it's fine. It's when I add any additional functions to this I get the issue. It's a strange one.

I don't have access now until Tuesday unfortunately. I'll add the logging then after each function,can u explain please how/what I should be looking for please.

Thanks again,

Steve

0 Kudos
iiliev
VMware Employee
VMware Employee

Just add a lot of System.log(payload); to track where exactly the payload parameter loses its value/becomes null.

Also, check log files (under /var/log/vco/app-server/ folder) to see if there are some other errors/exceptions.

drummoau
Enthusiast
Enthusiast

Unless I'm mistaken, the TestWf workflow is the one being called by EBS?

In order to use "payload" with EBS, it can be the only input to the flow that is called by EBS; you will need to remove the inputs "vmPassword" and "scriptVariables". This is documented in the vRA documentation.

If you absolutely need other inputs to the flow called by EBS (I haven't encountered a situation where I needed to) then you can add individual inputs for properties inside the payload; for example, you can add an input called "machine" of type "properties". However, I would advise having only the single payload input and have the workflow do the rest of the smarts.

SteveR123
Enthusiast
Enthusiast

Hi,thanks for the suggestion but I removed the inputs from the master workflow as suggested and it still fails:

Error in (Workflow:Property Collection and Get VM / Get Properties (item1)#39) TypeError: Cannot call method "get" of null

I'll try to add some further logging as suggested earlier and see if that helps.

Thanks

Steve

0 Kudos
SteveR123
Enthusiast
Enthusiast

Hi, in an effort to make this less complex I have removed the "run script in guest" WF.  I have attached the current "TESTWF" which includes workflows to get the custom props from Event Broker,Get Virtual Machine and set attributes appropriately. The 3rd script simpy logs each of the attributes payload, hostname and vms (successfully).

I now need to add the "run script in guest" which I have included here also. I think the mapping of the variables may be where I'm going wrong. Can you advise please? I'd appreciate any guideance you can give.

Thanks in advance

Steve

0 Kudos
SteveR123
Enthusiast
Enthusiast

Ok I have made progress with this one. It's not pretty but for info it works as follows, I'm sure I can consolidate some of the tasks but for now it works.

1) Get custom props from payload, output hostname[string]

2) Get virtual machine from criteria hostname[string], output vms[vc:virtualmachine]

3) Convert vms[vc:virtualmachine] to vm[vc:virtualmachine]

4) Run script in guest with VM[vc:virtualmachine]

Next step is to pass some remaing properties from the payload to the final WF.

Thanks for the repsonses I got here also.

Steve

0 Kudos