VMware Cloud Community
aenagy
Hot Shot
Hot Shot
Jump to solution

Passing values from vRO back to calling vRA request (vRA 7.3 + vRO 7.3)

There are lots of resources about passing values from vRA to vRO by leveraging custom properties and/or payload. My question is how to pass values from vRO back to vRA.

I am working on a requirement to create service accounts at request time (converged blueprint). I have the basics of the workflow figured out -- it calls a PowerShell script which will create the user account name based on parameters passed, generate a password, create a new user account with new password in the domain and store the user account name and password in a database. My workflow will capture output to stdout and stderr to a JavaScript variable. The script will output the name of the new user account. What I haven't been able to figure out is how to pass the user account name back to vRA for later scripts to use.

Reply
0 Kudos
1 Solution

Accepted Solutions
rmav01
Enthusiast
Enthusiast
Jump to solution

To accomplish what you've asked try looking into using the getVirtualMachineEntityFromId and addUpdatePropertyFromVirtualMachineEntity methods. You would place these calls into a blocking event broker subscription that fires prior to you needing the account info. After running your script, you would parse the payload from vRA for the VM's id, run getVirtualMachineEntityFromId to capture its entity (metadata representation of the provisioning box), and then use addUpdatePropertyFromVirtualMachineEntity to update a pre-bound property definition representing your account. This should allow vRO to essentially "update" a vRA machine definition and any payload you scrape in future event broker calls should reflect the new value.

View solution in original post

Reply
0 Kudos
5 Replies
batuhandemirdal
Enthusiast
Enthusiast
Jump to solution

Hi,

I think the best is to export the templates, import the VRA clean and import them, cleaner installation is always better.

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot
Jump to solution

I think the best is to export the templates, import the VRA clean and import them, cleaner installation is always better.

Would you be able to elaborate?

Reply
0 Kudos
filosmith
Enthusiast
Enthusiast
Jump to solution

Are you saying that you want to call an XaaS blueprint (step A) from a converged blueprint, and then consume the output of that in a step later (step B) in the converged blueprint? If so, you can click in the input field of step B in the blueprint designer, change it to Advanced Settings, set the Value to 'Field', click on Define Field Values, and navigate to the output value of step A.

If not, please clarify.

Reply
0 Kudos
rmav01
Enthusiast
Enthusiast
Jump to solution

To accomplish what you've asked try looking into using the getVirtualMachineEntityFromId and addUpdatePropertyFromVirtualMachineEntity methods. You would place these calls into a blocking event broker subscription that fires prior to you needing the account info. After running your script, you would parse the payload from vRA for the VM's id, run getVirtualMachineEntityFromId to capture its entity (metadata representation of the provisioning box), and then use addUpdatePropertyFromVirtualMachineEntity to update a pre-bound property definition representing your account. This should allow vRO to essentially "update" a vRA machine definition and any payload you scrape in future event broker calls should reflect the new value.

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot
Jump to solution

filosmith and rmav01 :

A colleague of mine sent me the link below. The information in this article was crucial in helping me achieve my goal. The goal was for guest scripts to generate some output that was required as input to another script, either in the same EBS subscription workflow or another. There were two parts to the solution:

1) Parse the output of the scripts once a key phrase was detected. In this case is used "#enableAddOrUpdateProperties=true". Any arbitrary string could have been used to trigger the parsing. Parse the remainder of the script output for key-value pairs, e.g. param1=value1, one per line. Create new properties in a temporary variable (tempAddUpdatePropertyFromVirtualMachineEntity) of type "Property".

2) At the end of the workflow copy all entries in my temporary variable (tempAddUpdatePropertyFromVirtualMachineEntity) to addUpdatePropertyFromVirtualMachineEntity.

In my workflow before a script was called the arguments were searched for variable names with the pattern "{variableName}" and the values substituted from the EBS payload.

This allowed ScriptA which generated a username and password to create new vRA properties which could then be passed to ScriptB to perform the application install.

I am marking your answer correct as it identifies "addUpdatePropertyFromVirtualMachineEntity" as the essential piece that allows vRO to pass data back to vRA  even though I didn't see this until afterward. Thanks for your response.

vRealize Event Broker and Extensibility 101

SDDCMASTER.COM: vRealize Event Broker and Extensibility 101

Reply
0 Kudos