Skip to content

Instantly share code, notes, and snippets.

@trisharia
Created March 30, 2017 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trisharia/9520ad519aacd383e8c1b78c5544915e to your computer and use it in GitHub Desktop.
Save trisharia/9520ad519aacd383e8c1b78c5544915e to your computer and use it in GitHub Desktop.
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