VMware Cloud Community
Venkatanagesh
Contributor
Contributor
Jump to solution

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

1 Solution

Accepted Solutions
AlexJudge
VMware Employee
VMware Employee
Jump to solution

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

0 Kudos
4 Replies
AlexJudge
VMware Employee
VMware Employee
Jump to solution

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>');


0 Kudos
Venkatanagesh
Contributor
Contributor
Jump to solution

Thanks Alex,

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

0 Kudos
Venkatanagesh
Contributor
Contributor
Jump to solution

Hi Alex,

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

0 Kudos
Andre24680
Contributor
Contributor
Jump to solution

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?

0 Kudos