Venkatanagesh
Contributor
Contributor

vRA7 how to use virtualMachineAddOrUpdateProperties to update vRA VM Properties from vRO.

Hi All,

How to use virtualMachineAddOrUpdateProperties  to update vRA VM Properties from vRO?

Example: I need to change the vmname to a custom name decided by vRO workflow at buildingmachine phase.

Regards,

Nagesh

AlexJudge
VMware Employee
VMware Employee

Essentially, the  virtualMachineAddOrUpdateProperties property needs to be an output parameter of your vRO workflow. The workflow would be called via EBS during the BuildingMachine phase. As long as this parameter is an output of the workflow, vRA will pick it up and use it.

In terms of structure, the virtualMachineAddOrUpdateProperties property is a vRO 'properties' object. It holds a set of value key pairs. The code snippet below should help get you started.

virtualMachineAddOrUpdateProperties = new Properties () ;

virtualMachineAddOrUpdateProperties.put(‘MyCloud.OU, 'dc=corp,dc-local') ;


In your case, the .put would look something like:

virtualMachineAddOrUpdateProperties.put('hostname','<your host name>');


View solution in original post

Reply
0 Kudos
Venkatanagesh
Contributor
Contributor

Thanks Alex,

Perfect answer and works fine. Can this property be used in MachineActivate phase as well?

Reply
0 Kudos
Venkatanagesh
Contributor
Contributor

Hi Alex,

It's working in MachineActivate phase as well. Thanks again.

Reply
0 Kudos
Andre24680
Contributor
Contributor

can you use virtualMachineAddOrUpdateProperties in a day2 workflow as well? Just have a vRO workflow with input VC:VirtualMachine & custom property value to update the custom property whenever you want?

Reply
0 Kudos