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
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>');
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>');
Thanks Alex,
Perfect answer and works fine. Can this property be used in MachineActivate phase as well?
Hi Alex,
It's working in MachineActivate phase as well. Thanks again.
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?