VA323
Contributor
Contributor

vRealize Automation 8 Orchestrator - Add computers to group members

vRealize Automation 8 utilizes the embedded vro and built-in workflows.  Trying to figure out how to pass variables from a blueprint to the "Add computers to group members" vro built-in workflow.

The workflow has the following inputs:

     AD:UserGroup

     Array/AD:ComputerAD

Obviously you can publish the workflow as a catalog item, but the point is to integrate this with a blueprint that deploys a VM.

Note:  Obviously, you have to create a subscription and attach this workflow.  One thing that has to happen before, is to add an AD in orchestrator as described here: https://docs.vmware.com/en/vRealize-Orchestrator/8.5/com.vmware.vrealize.orchestrator-use-plugins.do...

(I do understand that there are other options besides orchestrator workflows, but would like to understand how this works with orchestrator)

How can I pass these variables to the workflow?

Any assistance would be appreciated.

Thank you

 

 

 

0 Kudos
4 Replies
emacintosh
Enthusiast
Enthusiast

Add a high-level, you would want to create a workflow that is called from a subscription.  You can't use those existing workflows because they don't have the input that event broker subscription needs.

 

Your workflow should have an input called inputProperties of type Properties.  And then you can reference the server names in the deployment with the inputProperties.resourceNames array.  And then you would call the workflow you reference from your EB workflow.  

 

If you need to specify the AD group somehwere, you can put it in the properties of the server in your Cloud Template.  Those can be referenced with inputProperties.customerProperties["your property"]

 

 

0 Kudos
geoer
Contributor
Contributor

Have you find an solution for this workflow?

I'm trying to build a workflow that do basically the same, take the computer name and AD group from vRA deployment and add that computer object to the Active Directory group based on user input from vRA deployment.

But I could not figure out the correct code to pass the inputProperties to the Add computer workflow

0 Kudos
hhc_rleefyi
Contributor
Contributor

In a workflow I have an script (java)

    System.log("################  Get AD info to add server to LockDownGroup group #####################");
    var vmName = inputProperties.resourceNames[0]; //Name of server
    
    var vm = ActiveDirectory.getComputerADRecursively(vmName);  //Get the computer object from AD
    var group = ActiveDirectory.search("UserGroup", groupName);  //Get the LockDown group from AD
    LockDownGroup =  group[0];  //get the group in the array
 
Then I pass the "group" name and the vm (which is really the AD object vm info) into the built in workflow "Add computers to group members"
 
This adds the vm (computer AD Object to the AD Group I supplied)
 
You just need to make sure you added your domain to the Active Directory Inventory in vRO.
 
Hope this helps.
 
geoer
Contributor
Contributor

*edited*

Thanks a lot! Just got my workflow to work!!

 

0 Kudos