VMware Aria Automation Orchestrator

 View Only

 Tagging VMs as part of VRA deployment

Stuart MacPherson's profile image
Stuart MacPherson posted Jul 09, 2025 04:56 AM

Hi, I'm trying to use the built in "Update Machine Tags" workflow attached to an Event Subscription on Post Compute Deployment, to tag newly built VMs

It takes in a VRA:Machine Input called "machine"   and the Tags you want to add and an Output called "actionResult", but I'm struggling with how to give it the VRA:Machine part. (I have added the Tags as a variable for now)

If I run the raw workflow it lets me search for the VM and works as it should.

The issue is with how to give it the Input when called from the Subscription. I have tried adding a Scriptable task at the beginning that takes in the "inputProperties" and then extracts the resourceName from it (but thats a string). I cant seem to pass that to the updateTags Workflow element as its expecting the "machine" input value? So maybe my issue is knowing how to pass one variable to the next workflow item, or should it get it another way?

Has anyone used this before? I feel like I'm missing a piece of the puzzle that will also help me use any other built in Workflows with pre-defined Inputs.

Thanks

Stuart MacPherson's profile image
Stuart MacPherson

Actually my issue seems to be elsewhere. (I have managed to link the variable machinevra as an Input to the "update machine tags" item.)

My current issue is in trying to get the VRA:Machine from this command in my scriptable task:

machinevra = Server.findForType("VRA:Machine","stu124");  //simplified to test
It errors out with:
Server error : ch.dunes.model.sdk.SDKFinderException: Unable to perform operation 'find('Machine', 'stu124')' on plugin 'VRA' : java.lang.RuntimeException: Host is a mandatory field. Please pass a valid host.
So I cant get a VRA:Machine type variable to pass to the update machine tags item. I do have a managed Vm in VRA called stu124
mayank_goyal's profile image
mayank_goyal

Not sure need to check what missing in machinevra = Server.findForType("VRA:Machine","stu124");

But for time being, this works:

var machinevra = "";
var allVraMachines = Server.findAllForType("VRA:Machine")
for(var i in allVraMachines){
    if(allVraMachines[i].name = "stu124")
    var machinevra = allVraMachines[i]
}
Stuart MacPherson's profile image
Stuart MacPherson

Thanks, that sort of works. Runs through every VM but then seems to pick the very last one and updates it?. I can work with that next week though.