Hey all, hoping this is an easy on.
I have an Orchestrator workflow to set the notes/annotation on a VM in vCenter (based on the example in this The workflow only has one scriptable object, content is as follows:
var xml = XMLManager.fromString(vm.toXml());
//System.log("XML is " + xml);
var vimObjectRef = xml.getElementsByTagName("ns9:VmVimObjectRef").item(0);
System.log("vimObjectRef is " + vimObjectRef);
var moRef = vimObjectRef.getElementsByTagName("ns9:MoRef").item(0);
System.log("moRef is " + moRef);
var vmId = moRef.textContent;
System.log("vmId is " + vmId);
// the "conn" object is my SDK on my DEV vCenter server
vcVm = conn.getAllVirtualMachines(null, "xpath:id='"+vmId+"'")[0];
System.log("vcVM is " + vcVm);
var configSummary = vcVm.summary.config;
System.log("configSummary is " + configSummary);
System.log("Old annotation: " + configSummary.annotation);
System.log("New annotation: " + notes);
var configSpec = new VcVirtualMachineConfigSpec();
configSpec.annotation = notes;
var task = vcVm.reconfigVM_Task(configSpec);
System.log(task);
In one of my environments, the workflow works fine. In my DEV environment, the workflow dies with the following error message:
TypeError: Cannot read property "summary" from undefined (Workflow:GEHC Util Change VM Annotation / Scriptable task (item0)#20)
Looking at the workflow, it seems that my getAllVirtualMachines is returning undefined, but can't for the life of me figure out why. I've looked at the Orchestrator logs, but it doesn't provide much beyond what I already saw in the Orchestrator client. I started looking in the vCenter logs, but not sure what to look for.
Any help or direction would be appreciated.