4.2

Table Of Contents
var datacenters = rootFolder.datacenter;
if (datacenters != null) {
for (var j = 0; j < datacenters.length; j++) {
var datacenter = datacenters[j];
System.log("--- Datacenter '" + datacenter.id + "'");
}
}
// Method to get all the virtual machines in a vCenter Server host
var vms = sdkConnection.getAllVirtualMachines();
if (vms != null) {
for (var j = 0; j < vms.length; j++) {
var vm = vms[j];
System.log("--- VM '" + vm.id + "'");
System.log("--- VM '" + vm.name + "'");
var guestInfo = vm.guest;
System.log("--- VM guestInfo '" + guestInfo + "'");
if (guestInfo != null) {
System.log("--- VM guestInfo.guestFamily '" + guestInfo.guestFamily + "'");
}
}
}
}
Set vCenter Server Option Values
The following JavaScript example allows Orchestrator to set vCenter VcOptionManager option values.
var myVcOptionValue = new VcOptionValue();
myVcOptionValue.key = VimAdvancedOptionKey;
myVcOptionValue.value_LongValue = VimAdvancedOptionValue;
You can set the following optional value types as VcOptionValue attributes.
value
Attribute is a string value.
value_FloatValue
Attribute value is a float value.
value_IntValue
Attribute value is an integer value.
value_LongValue
Attribute value is a long value.
Using the vCenter Server 4.1 Plug-In Inventory
The vCenter Server plug-in exposes all objects of the connected vCenter Server hosts in the Inventory view.
You can use the Inventory view to add authorization elements or to run workflows on vCenter Server objects.
If the Use contextual menu in inventory option is enabled, all of the workflows that you can run on the selected
inventory object appear in a contextual menu.
Access the vCenter Server 4.1 Plug-In Workflow Library
You must use the Orchestrator client to access the elements from the vCenter Server 4.1 plug-in workflow
library.
Prerequisites
n
The vCenter Server 4.1 plug-in must be enabled and configured in the Orchestrator configuration interface.
Using VMware vCenter Orchestrator Plug-Ins
18 VMware, Inc.