5.5.1

Table Of Contents
Create Snapshot? Custom Decision Element
The Create Snapshot? custom decision element determines whether to take snapshots of virtual machines,
depending on the disk modes of the virtual machines. The following table shows the bindings that the
Create Snapshot? custom decision element requires.
Table 120. Bindings of the Create Snapshot? Decision Element
Parameter Name Binding Type
Bind to Existing
or Create
Parameter? Binding Values
vmDisksMode
IN Bind
n
Local parameter: vmDisksMode
n
Source parameter:
vmDisksMode[attribute]
n
Type: Array/String
n
Description:
The current Disks Modes of
the virtual machine
vm
IN Bind
n
Local parameter: vm
n
Source parameter:
vm[attribute]
n
Type: VC:VirtualMachine
n
Description:
The current virtual machine
having a snapshot taken
The Create Snapshot? custom decision element custom decision element performs the following scripted
function.
//A snapshot cannot be taken if one of its disks is in independent mode
// (independent-persistent or independent-nonpersistent)
var containsIndependentDisks = false;
if (vmDisksModes!=null && vmDisksModes.length>0) {
for (i in vmDisksModes) {
if (vmDisksModes[i].charAt(0)=="i") {
containsIndependentDisks = true;
}
}
} else {
//if no disk found no need to try to snapshot the VM
System.warn("Won't snapshot '"+vm.name+"', no disks found");
return false;
}
if (containsIndependentDisks) {
System.warn("Won't snapshot '"+vm.name+"', independent disk(s) found");
return false;
} else {
System.log("Snapshoting '"+vm.name+"'");
return true;
}
Create a snapshot Workflow Element
The Create a snapshot workflow element takes snapshots of virtual machines. The following table shows the
bindings that the Create a snapshot workflow element requires.
Developing with VMware vCenter Orchestrator
114 VMware, Inc.