Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
System.log("Updating VirtualMachineName to '" + inVM + "'.");
//Get the properties of the vRA VM Entity object
var vmEntityProps = inVMEntity.getProperties();
//Change the VirtualMachineName property by deleting it and re-adding it
vmEntityProps.remove('VirtualMachineName');
vmEntityProps.put('VirtualMachineName', inVM);
//Update the Entity object to save the change
var hostId = inVMEntity.hostId;
var modelName = inVMEntity.modelName;
var entitySetName = inVMEntity.entitySetName;
var entityIdString = inVMEntity.keyString;
var actionResult = System.getModule("com.vmware.library.vcac").updateVCACEntity(hostId,modelName,entitySetName,entityIdString,vmEntityProps,null,null);
System.log("Update of VirtualMachineName finished.");
return actionResult;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.