I am trying to update the IP address of a VM through vRO. When I attempt to use the function updateVCACEntity I get a Java null pointer error.
Here is the action I am using to update the IP address:
System.log(workflow.currentWorkflow.name+": Updating VirtualMachine IP Address to '" + IPAddress + "'.");
//Get the properties of the vCAC VM Entity object (different than vCAC custom properties)
var vmEntityProps = virtualMachineEntity.getProperties();
for each( var Prop in vmEntityProps)
{
System.log(Prop);
}
//Change the VirtualMachine.Network0.Address property by deleting it and re-adding it
vmEntityProps.remove('VirtualMachine.Network0.Address');
vmEntityProps.put('VirtualMachine.Network0.Address', IPAddress);
//Update the Entity object to save the change
var hostId = virtualMachineEntity.hostId;
var modelName = virtualMachineEntity.modelName;
var entitySetName = virtualMachineEntity.entitySetName;
var entityIdString = virtualMachineEntity.keyString;
var actionResult = System.getModule("com.vmware.library.vcac").updateVCACEntity(hostId,modelName,entitySetName,entityIdString,vmEntityProps,null,null);
System.log(workflow.currentWorkflow.name+": Update of VirtualMachine.Network0.Address finished.");
return actionResult;