Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

Update IP address of a vm through vRO

$
0
0

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;


Viewing all articles
Browse latest Browse all 179681

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>