cancel
Showing results for 
Search instead for 
Did you mean: 

Run a workflow on multiple devices, one after the other

Run a workflow on multiple devices, one after the other

Nealo
New Contributor
Hello,

I have a workflow that finds a given VLAN (with a prompted variable), and duplicates it with another ID if it exists. However, I have two things that I would love to implement, but haven't found anything that shows me it's possible.

1 - Is there a way to start the workflow on multiple devices, but it does them one by one, and not at the same time ?
As I have multiple python scripts or signals, the workflow is executed steps by steps on all the devices. So when storing information in a variable, it mixes between the devices and I don't have the correct result at the end.
Maybe it's possible to create workflow variable from script, but don't know how to play with variable outside of emc_vars.get() and emc_results.put().

I guess I could make a GateWay to make a loop, while checking the list of all the selected devices, and increasing an index until it's out of the devices_list's length. But maybe there is a more practical way.


2 - Is it possible to add a variable (like the Device name) in an Event's message ?
It would be to say "VLAN 3 was correctly added on the device : Device3", or messages like that.


Thanks a lot already for the answers.
Would happily discuss about it more in details.
1 ACCEPTED SOLUTION

Zdeněk_Pala
Extreme Employee
here is example for the device name/nickname NBI call

code:
varDeviceIP = "10.8.255.15"
varQuery = '''query{network{device(ip:"%s"){name,nickName}}}''' %varDeviceIP
varResult = emc_nbi.query(varQuery)
varName = varResult['network']['device']['name']
varNickName = varResult['network']['device']['nickName']
Regards Zdeněk Pala

View solution in original post

7 REPLIES 7

Zdeněk_Pala
Extreme Employee
See two example workflows.
4Nealo = you can see how we can handle variables in Signals.
4Mealo-ConcurrentExecution = you can see how we can pass variables between activities with concurrent execution.

I have not found nice way how to generate more signals in concurrent execution.
Regards Zdeněk Pala

Nealo
New Contributor
I looked at the System workflows' examples to see how to use them in signals.
It's the ${CreatedVarName} that needs to be in the message, isn't it ?

Thank you very much for the help.

Zdeněk_Pala
Extreme Employee
Yes you can add it to the python activity or you can create new python activity. In the activity you can resolv the nickname/name and store it to other variable (scope workflow). This new variable can be used in your signal...
Regards Zdeněk Pala

Nealo
New Contributor


I'm not sure I understand correctly where to insert that.

In the example figure bollow, should I insert your code in the script Activity Create VLAN 111, or in the signals VLAN created / VLAN not created after that ?

8d1e20e4d2f442999c8f5c7c8c292110_6aec6316-f610-4fe3-baa7-56c8b4ebb7bb.png



I guess it's in the script Activity. But it means it prints those informations in the Output of every device that ran the script. Or maybe I'm missing something.

What I'm trying to do is keeping logs of the successes/failures of the script.
Is there a way to affect the signal message from the script directly ? Like :
code:
emc_signal("ID_vlanCreated").put("message", "The VLAN " + id_vlan + " was created successfully.")



I tried looking in the API that was given to me in a previous post, but couldn't find any hint.

Thanks for helping me.
GTM-P2G8KFN