Get vmId by vmName in Cloupia Script

How to get the Virtual Machine Identity (vmId) with its name.

Create a custom task with this code:

Inputs:

  • VMname (Virtual machine Name) in a string
  • accountName (vCenter Account Name in UCS Director)

Outputs:

  • vmId (Virtual Machine Identity for UCS Director)

Cisco UCS Director – Hello World in Cloupia script

Cloupia script is THE scripting language from Cisco UCS Director.

Cloupia is a mix between Javascript and Java. The code is interpreted by Nashorn (the Javascript engine from JRE/JDK).

imporPackage has the same role as import from a pure Java code.

import java.lang.*  is in cloupia importPackage(java.lang);