Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Rename a vRA IaaS virtual machine
// VMware vRealize Orchestrator action sample
// Rename a vRA IaaS VM
// For vRO/VRA 6.0+
// Action Inputs:
// vm - vCAC:VirtualMachine - vRA IaaS VM
// vmName - New name of VM
// Return type: void
var properties = new Properties();
properties.put("VirtualMachineName", vmName);
var vmEntity = vm.getEntity();
vCACEntityManager.updateModelEntityBySerializedKey(vmEntity.hostId, vmEntity.modelName, vmEntity.entitySetName, vmEntity.keyString, properties, null);
System.log("VM successfully renamed to '" + vmName + "'");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment