første xml update
authorSafet Amedov <amedov@usit.uio.no>
Mon, 26 Jan 2015 13:21:29 +0000 (14:21 +0100)
committerSafet Amedov <amedov@usit.uio.no>
Mon, 26 Jan 2015 13:21:29 +0000 (14:21 +0100)
118 files changed:
vFLOWER/content/Actions/com.vmware.library.microsoft.activeDirectory/setUserEnable.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.basic/WaitTaskEndOrVMQuestion.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.basic/getDatacenterForVimObject.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.basic/getVimHostForVimObject.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.basic/vim3WaitTaskEnd.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.cluster/getAllClusterComputeResourceForVimHost.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllAvaiblableHostForVM.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllDatastoreOnVimHost.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllDatastores.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.datastore/getDatastoreForHostAndResourcePool.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.datastore/getValidDatastoreForNetwork.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.network/getNetworkForResourcePoolHostVm.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.network/getNetworksForVimHost.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.networking/getVirtualEthernetCardDvPortgroupBackingInfo.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.resourcePool/getAllChildResourcePool.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.resourcePool/getValidResourcePoolForNetwork.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.network/getNetworkForGivenNic.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.network/getNicByNumber.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.network/isSupportedNic.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.power/shutdownVM.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.power/startVM.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device.backing.device/getVirtualEthernetCardNetworkBackingInfo.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/createVirtualDiskFlatVer2ConfigSpec.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/createVirtualScsiControllerConfigSpec.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualDevice.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualE1000.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualE1000e.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualEthernetCard.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualPCNet32.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualSriovEthernetCard.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet2.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet3.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationFixedName.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationGuiRunOnce.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationGuiUnattended.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationIdentificationFromCredential.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationLicenseFilePrintData.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationLinuxPrep.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationPassword.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationPrefixName.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationSysprep.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationUserData.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationAdapterMapping.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationDhcpIpGenerator.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationFixedIp.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationIPSettings.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationUnknownIpGenerator.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/checkVMwareInput.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCloneSpec.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getConfigSpecSimple.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettings.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettingsWithDomainAsString.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationSpec.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getRelocateSpec.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.tools/vim3WaitDnsNameInTools.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm.tools/vim3WaitToolsStarted.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm/changeVMRAM.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm/changeVMvCPU.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm/cloneVM.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.library.vc.vm/getAllVMsMatchingRegexp.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/com.vmware.pso.cryptojs/base64Encode.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/no.uio/CheckPidInVM.action.xml [new file with mode: 0644]
vFLOWER/content/Actions/no.uio/createVirtualEthernetCardDvNetworkConfigSpec.action.xml [new file with mode: 0644]
vFLOWER/content/Packages/no.uio.virtprov-20150126-01.package.xml [new file with mode: 0644]
vFLOWER/content/Resources/Library/Configuration/_Icons/certificate.gif [new file with mode: 0644]
vFLOWER/content/Resources/Library/Configuration/_Icons/server.gif [new file with mode: 0644]
vFLOWER/content/Resources/Library/Configuration/_Icons/troubleshooting.gif [new file with mode: 0644]
vFLOWER/content/Resources/ikoner/cerebrum.png [new file with mode: 0644]
vFLOWER/content/Resources/ikoner/cfengine.jpeg [new file with mode: 0644]
vFLOWER/content/Workflows/Library/Microsoft/Active Directory/User/Disable a user.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/Microsoft/Active Directory/User/Enable a user.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/SQL/Execute a custom query on a database.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/SQL/Read a custom query from a database.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/SSH/Run SSH command.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/Tagging/Tag workflow.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/Tagging/Untag workflow.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/Check for file in guest.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/Create directory in guest.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/List path in guest.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Guest operations/Processes/Run program in guest.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Basic/Mark as template.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Basic/Wait for task and answer virtual machine question.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get Linux customization.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get NIC setting map.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get Windows customization, Sysprep with credentials.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get a VirtualEthernetCard to change the network.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Device Management/Add disk.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Power Management/Shut down guest OS and wait.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Power Management/Start virtual machine and wait.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/VirtProv/ clone VM from DB + linux 2.0.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/VirtProv/clone_vm_from_rest.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/etc/global_parameters.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/ad/generate_password.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/ad/get_ad_computer.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/ad/get_ad_passwd.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/ad/get_project.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/bofh/get_ad_password.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/bofh/host_add.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/bofh/host_add_nonvm.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/bofh/host_roles.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/log/error.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/log/info.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/log/set_db_state.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/log/vm_ready_email.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/ post_linux.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/add_cpu_memory.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/clone_lin_win.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/copy_files_to_vm.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/disable_and_untag_tsduser.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/exec_post_scipts.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/get_optimal_datastore.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/get_template.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/mk_kickstart.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/tools/post_windows.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/vm/Clone, Linux with single NIC.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/vm/clone_vm.workflow.xml [new file with mode: 0644]
vFLOWER/content/Workflows/uio/lib/vm/create_vm.workflow.xml [new file with mode: 0644]

diff --git a/vFLOWER/content/Actions/com.vmware.library.microsoft.activeDirectory/setUserEnable.action.xml b/vFLOWER/content/Actions/com.vmware.library.microsoft.activeDirectory/setUserEnable.action.xml
new file mode 100644 (file)
index 0000000..d170213
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="setUserEnable" result-type="void" api-version="3.1.0" id="99544f0f-9ebe-4032-a611-2886d2387e14" version="1.1.0" allowed-operations="fv">
+    <description>Allow to enable or disable a computer in the Active Directory</description>
+
+    <param n="user" t="AD:User">User to enable / disable</param>
+
+    <param n="enable" t="boolean">Enable or disable?</param>
+
+    <script encoded="false">
+user.enabled = enable;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.basic/WaitTaskEndOrVMQuestion.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.basic/WaitTaskEndOrVMQuestion.action.xml
new file mode 100644 (file)
index 0000000..d9394c5
--- /dev/null
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="WaitTaskEndOrVMQuestion" result-type="Any" api-version="3.1.0" id="a5bffcea-58d8-4b12-b40e-0e3f15dee82d" version="0.1.0" allowed-operations="fv">
+    <description>
+Wait for a VC Task to end or for the VM to ask a question.
+Return the task result or the question asked.
+    </description>
+
+    <param n="task" t="VC:Task">Task to Wait for</param>
+
+    <param n="progress" t="boolean">Log progess while waiting for the task</param>
+
+    <param n="pollRate" t="number">Polling rate for the task state [seconds]</param>
+
+    <param n="vm" t="VC:VirtualMachine"/>
+
+    <script encoded="false">
+if (task == null) {
+       throw "VC Task is null";
+}
+if (vm == null) {
+       throw "VM is null";
+}
+
+var taskEnd = false;
+var error;
+
+while (task != null) {
+       if (task.info == null) {
+               throw "VC Task info is null";
+       }
+       if (task.info.state == null) {
+               throw "VC Task state is null";
+       }       
+
+       var state = task.info.state.value;
+       if (state == "success") {
+               break;
+       }
+       else if (state == "error") {
+               if (task.info.error.localizedMessage == null) {
+                       throw "Task '" + task.info.name + "' has encountered an unknown error";
+               }
+               else {
+                       throw "Task '" + task.info.name + "' error: "+task.info.error.localizedMessage;
+               }
+       }
+       else if ((progress) &amp;&amp; (state == "running")) {
+               if (task.info.progress == null) {
+                       System.log(task.info.name+" Queued or In Progress...");
+               }
+               else {
+                       System.log(task.info.name+" "+task.info.progress+" %");
+               }
+       }
+               // VM question
+       if (vm &amp;&amp; vm.runtime.question){
+               System.log("The VM requires an answer to a question");
+               return vm.runtime.question;
+       }
+       System.sleep(pollRate*1000);
+}
+
+if (task == null) {
+       throw "VIM Task is null";
+}
+else if (progress) {
+       System.log(task.info.name+" end");
+}
+
+// Return the Task Result
+if (task != null &amp;&amp; task.info != null &amp;&amp; task.info.result != null) {
+       return VcPlugin.convertToVimManagedObject(task , task.info.result);
+}
+else {
+       return null;
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.basic/getDatacenterForVimObject.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.basic/getDatacenterForVimObject.action.xml
new file mode 100644 (file)
index 0000000..7355dcb
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getDatacenterForVimObject" result-type="VC:Datacenter" api-version="3.1.0" id="6e4e9ced-de28-4565-aed9-e9839d1422fe" version="0.2.0" allowed-operations="fv">
+    <description>
+Return the Datacenter for any Vim object.
+Return null if not in a datacenter (Datacenter folder)
+    </description>
+
+    <param n="object" t="Any"/>
+
+    <script encoded="false">
+var parent = object;
+
+while (parent != null &amp;&amp; ! (parent instanceof VcDatacenter)) {
+       parent = parent.parent;
+}
+return parent;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.basic/getVimHostForVimObject.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.basic/getVimHostForVimObject.action.xml
new file mode 100644 (file)
index 0000000..c439083
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVimHostForVimObject" result-type="VC:SdkConnection" api-version="3.1.0" id="2af834d2-acaa-4594-95b2-437d05780133" version="0.3.0" allowed-operations="fv">
+    <description>Return the VimHost (Virtual Center) for any Vim object</description>
+
+    <param n="object" t="Any"/>
+
+    <script encoded="false">
+return object.sdkConnection;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.basic/vim3WaitTaskEnd.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.basic/vim3WaitTaskEnd.action.xml
new file mode 100644 (file)
index 0000000..1b2a3ab
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="vim3WaitTaskEnd" result-type="Any" api-version="3.1.0" id="83cc409d-547b-4c8c-9ba4-29c886b1b3ba" version="0.3.0" allowed-operations="fv">
+    <description>
+Wait for a VC Task to end.
+When task ended, return the task result if any.
+    </description>
+
+    <param n="task" t="VC:Task">Task to Wait for</param>
+
+    <param n="progress" t="boolean">Log progess while waiting for the task</param>
+
+    <param n="pollRate" t="number">Polling rate for the task state [seconds]</param>
+
+    <script encoded="false">
+var taskEnd = false;
+var error;
+
+while (task != null) {
+       if (task.info == null) {
+               throw "VIM Task info is null";
+       }
+       if (task.info.state == null) {
+               throw "VIM Task state is null";
+       }       
+
+       var state = task.info.state.value;
+       if (state == "success") {
+               break;
+       }
+       else if (state == "error") {
+               if (task.info.error.localizedMessage == null) {
+                       throw "Task '" + task.info.name + "' has encountered an unknown error";
+               }
+               else {
+                       throw "Task '" + task.info.name + "' error: "+task.info.error.localizedMessage;
+               }
+       }
+       else if ((progress) &amp;&amp; (state == "running")) {
+               if (task.info.progress == null) {
+                       System.log(task.info.name+" Queued or In Progress...");
+                       }
+               else {
+                       System.log(task.info.name+" "+task.info.progress+" %");
+               }
+       }
+       System.sleep(pollRate*1000);
+}
+
+if (task == null) {
+       throw "VIM Task is null";
+}
+else if (progress) {
+       System.log(task.info.name+" end");
+}
+
+// Return the Task Result
+if (task != null &amp;&amp; task.info != null &amp;&amp; task.info.result != null) {
+       return VcPlugin.convertToVimManagedObject(task , task.info.result);
+}
+else {
+       return null;
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.cluster/getAllClusterComputeResourceForVimHost.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.cluster/getAllClusterComputeResourceForVimHost.action.xml
new file mode 100644 (file)
index 0000000..c16f1dd
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getAllClusterComputeResourceForVimHost" result-type="Array/VC:ClusterComputeResource" api-version="3.1.0" id="423f39fc-fcf2-46cc-9fff-8e2ef86baf91" version="0.3.0" allowed-operations="fv">
+    <description>Get all the ClusterComputeResource in a VimHost</description>
+
+    <param n="vimHost" t="VC:SdkConnection"/>
+
+    <script encoded="false">
+var result = new Array();
+findComputeResourceInDataCenterFolder(vimHost.rootFolder);
+return result;
+
+
+function findComputeResourceInDataCenterFolder(hostFolder) {
+       for each (var dc in hostFolder.childEntity) {
+               if (dc instanceof VcDatacenter) {
+                       findComputeResourceInDataCenter(dc);
+               }
+       }
+       
+       for each (var folder in hostFolder.childEntity) {
+               if (folder instanceof VcFolder) {
+                       findComputeResourceInDataCenterFolder(folder);
+               }
+       }
+}
+
+function findComputeResourceInDataCenter (datacenter) {
+       findComputeResourceInHostFolder(datacenter.hostFolder);
+}
+
+function findComputeResourceInHostFolder (hostFolder) {
+       for each (var item in hostFolder.childEntity) {
+               if (item instanceof VcClusterComputeResource) {
+                       result.push(item);
+               }
+       }
+               
+       for each (var folder in hostFolder.childEntity) {
+               if (folder instanceof VcFolder) {
+                       findComputeResourceInHostFolder(folder);
+               }
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllAvaiblableHostForVM.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllAvaiblableHostForVM.action.xml
new file mode 100644 (file)
index 0000000..1e4d3b4
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getAllAvaiblableHostForVM" result-type="Array/VC:HostSystem" api-version="3.1.0" id="8cec318b-bb81-41df-b13e-bdeb3c6d58aa" version="0.2.0" allowed-operations="fv">
+    <description>
+[DEPRECATED] Return all hosts "viewing" the VM.
+    </description>
+
+    <param n="vm" t="VC:VirtualMachine"/>
+
+    <script encoded="false">
+return vm.vimHost.getAllHostSystems();
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllDatastoreOnVimHost.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllDatastoreOnVimHost.action.xml
new file mode 100644 (file)
index 0000000..8501e6b
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getAllDatastoreOnVimHost" result-type="Array/VC:Datastore" api-version="3.1.0" id="c968b77a-b583-4a43-bcbc-4452e5a84b8f" version="0.3.0" allowed-operations="fv">
+    <description>Return all datastores on an ESX host</description>
+
+    <param n="vimHost" t="VC:SdkConnection"/>
+
+    <script encoded="false">
+var keys = new Properties();
+var result = new Array();
+try {
+       searchInFolder(vimHost.rootFolder);
+       //System.log(result.length + " datastores found");
+       return result;
+}
+catch (ex) {
+       if (vimHost != null)
+               throw "Error getting datastore on " + vimHost.name + ". " + ex;
+       else
+               throw "Error getting datastore on null vimHost. " + ex;
+}
+
+
+
+function searchInFolder(folder) {
+       //System.log("searchInFolder(" + folder.name + ")");
+       if (folder.datacenter != null) {
+               var childs = folder.childEntity;
+               for (var i in childs) {
+                       if (childs[i] instanceof VcFolder) {
+                               System.log("a folder: " + childs[i].name);
+                               searchInFolder(childs[i]);
+                       }
+                       if (childs[i] instanceof VcDatacenter) {
+                               System.log("a datacenter: " + childs[i].name);
+                               addDatastore(childs[i]);
+                       }
+               }
+       }       
+}
+
+function addDatastore(datacenter) {
+       var allDS = datacenter.datastore;
+       for (var i in allDS) {
+               if (keys.get(allDS[i].sdkId) == null) { 
+                       System.log(allDS[i].name + " found!");
+                       result.push(allDS[i]);
+                       keys.put(allDS[i].sdkId, allDS[i].sdkId);
+               }
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllDatastores.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getAllDatastores.action.xml
new file mode 100644 (file)
index 0000000..0a72cd7
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getAllDatastores" result-type="Array/VC:Datastore" api-version="3.1.0" id="e0a4d65f-1ebb-49df-b5db-a599a1909bf2" version="0.1.0" allowed-operations="fv">
+    <description>Return all the datastores</description>
+
+    <script encoded="false">
+return VcPlugin.getAllDatastores();
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getDatastoreForHostAndResourcePool.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getDatastoreForHostAndResourcePool.action.xml
new file mode 100644 (file)
index 0000000..e45ee9c
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getDatastoreForHostAndResourcePool" result-type="Array/VC:Datastore" api-version="3.1.0" id="1305f8d8-b3b5-4f06-a8d6-d11629b188cc" version="0.3.0" allowed-operations="fv">
+    <description>Return all available Datastore on host and pool (sum of each). If host and pool are null, return the available datastore to relocate the vm (in fact, all datastore in the same Virtual Center)</description>
+
+    <param n="host" t="VC:HostSystem"/>
+
+    <param n="pool" t="VC:ResourcePool"/>
+
+    <param n="vm" t="VC:VirtualMachine"/>
+
+    <script encoded="false">
+var result = new Array();
+var keys = new Properties();
+if (host == null &amp;&amp; pool == null) {
+       result = System.getModule("com.vmware.library.vc.datastore").getAllDatastoreOnVimHost(vm.sdkConnection);
+}
+else {
+       if (host != null) {
+               addDatastore(host.datastore);
+       }
+       if (pool != null) {
+               computeResource = pool.parent;
+               while ( ! ((computeResource instanceof VcClusterComputeResource) || (computeResource instanceof VcComputeResource))) {
+                       computeResource = computeResource.parent;
+               }
+               addDatastore(computeResource.datastore);
+       }
+}
+return result;
+
+
+
+function addDatastore(datastores) {
+       for (var i in datastores) {
+               if (keys.get(datastores[i].sdkId) == null) {
+                       keys.put(datastores[i].sdkId, datastores[i].sdkId);
+                       result.push(datastores[i]);
+               }
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getValidDatastoreForNetwork.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.datastore/getValidDatastoreForNetwork.action.xml
new file mode 100644 (file)
index 0000000..5caf08f
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getValidDatastoreForNetwork" result-type="Array/VC:Datastore" api-version="3.1.0" id="0e0dc068-af83-41db-bb50-4b779c3aafe3" version="0.2.0" allowed-operations="fv">
+    <description>Get all valid datastores for a network.</description>
+
+    <param n="network" t="VC:Network"/>
+
+    <script encoded="false">
+var hosts = network.host;
+var datastores =  new Properties();
+for(var i in hosts){
+       var datastores2 = hosts[i].datastore;
+       for(j in datastores2) {
+               datastores.put(datastores2[j].name, datastores2[j]);
+       }
+}
+
+var result = new Array();
+for(var i in datastores.keys){
+       result.push(datastores.get(datastores.keys[i]));
+}
+return result;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.network/getNetworkForResourcePoolHostVm.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.network/getNetworkForResourcePoolHostVm.action.xml
new file mode 100644 (file)
index 0000000..097262e
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getNetworkForResourcePoolHostVm" result-type="Array/VC:Network" api-version="3.1.0" id="3fafdce0-dd72-4f9d-b1aa-94b4628403c4" version="0.2.0" allowed-operations="fv">
+    <description>
+Retrun available network for a resource pool, a host (if cluster is null) or for a vm (if cluster and host are null).
+Used for the networks list in the clone presentations.
+
+If called with a parameter of the wrong type (and not null), this action might return an "undefined" value.
+    </description>
+
+    <param n="pool" t="VC:ResourcePool"/>
+
+    <param n="host" t="VC:HostSystem"/>
+
+    <param n="vm" t="VC:VirtualMachine"/>
+
+    <script encoded="false">
+if (pool != null) {
+       var parent = pool.parent;
+       while (! (parent instanceof VcClusterComputeResource || parent instanceof VcComputeResource)) {
+               parent = parent.parent;
+       }
+       return parent.network;
+}
+if (host != null) {
+       return host.network;
+}
+if (vm != null) {
+       return System.getModule("com.vmware.library.vc.network").getNetworksForVimHost(vm.vimHost);
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.network/getNetworksForVimHost.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.network/getNetworksForVimHost.action.xml
new file mode 100644 (file)
index 0000000..b5e916a
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getNetworksForVimHost" result-type="Array/VC:Network" api-version="3.1.0" id="ccf4a83a-1893-4c73-b22f-5cae1b26346e" version="0.3.0" allowed-operations="fv">
+    <description>Return all existing networks in a VimHost</description>
+
+    <param n="vimHost" t="VC:SdkConnection"/>
+
+    <script encoded="false">
+var result = new Properties();
+var hosts = vimHost.getAllHostSystems();
+for (var i in hosts) {
+       var networks = hosts[i].network;
+       for (var j in networks) {
+               result.put(networks[j].sdkId , networks[j]);
+       }
+}
+var arr = new Array();
+var keys = result.keys;
+for (var i in keys) {
+       arr.push(result.get(keys[i]));
+}
+return arr;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.networking/getVirtualEthernetCardDvPortgroupBackingInfo.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.networking/getVirtualEthernetCardDvPortgroupBackingInfo.action.xml
new file mode 100644 (file)
index 0000000..a92a0ca
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualEthernetCardDvPortgroupBackingInfo" result-type="Any" api-version="3.1.0" id="ab9f91c2-4a4b-4b7c-b7b1-aca3b32ff087" version="0.1.1" allowed-operations="fv">
+    <description>The virtual Ethernet card backing class. (uses Distributed Virtual Portgroup as input instead of VC:Network object)</description>
+
+    <param n="deviceName" t="string">The name of the device on the host system.</param>
+
+    <param n="network" t="VC:DistributedVirtualPortgroup">Reference to the network managed object to which this backing applies. This is not used during configuration.</param>
+
+    <script encoded="false">
+if (deviceName == null) {
+       deviceName = network.name;
+}
+var connection = new VcDistributedVirtualSwitchPortConnection();
+connection.PortgroupKey = network.id;
+connection.SwitchUuid = network.config.distributedVirtualSwitch.uuid;
+backing = new VcVirtualEthernetCardDistributedVirtualPortBackingInfo();
+backing.Port = connection;
+
+return backing;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.resourcePool/getAllChildResourcePool.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.resourcePool/getAllChildResourcePool.action.xml
new file mode 100644 (file)
index 0000000..e34f64b
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getAllChildResourcePool" result-type="Array/VC:ResourcePool" api-version="3.1.0" id="a9e966ff-d1f6-42a0-8949-785216c01922" version="0.2.0" allowed-operations="fv">
+    <description>Return all resource pool of the given resource pool</description>
+
+    <param n="resourcePool" t="VC:ResourcePool"/>
+
+    <script encoded="false">
+var result = new Array();
+
+getRPfromRP(resourcePool);
+return result;
+
+
+function getRPfromRP(rp) {
+       result = result.concat(rp.resourcePool);
+       for (var i in rp.resourcePool) {
+               getRPfromRP(rp.resourcePool[i]);
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.resourcePool/getValidResourcePoolForNetwork.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.resourcePool/getValidResourcePoolForNetwork.action.xml
new file mode 100644 (file)
index 0000000..d5f5a9c
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getValidResourcePoolForNetwork" result-type="Array/VC:ResourcePool" api-version="3.1.0" id="824faaf4-383c-4224-919a-18dbece89ce6" version="0.2.0" allowed-operations="fv">
+    <description>Get valid resourcePools for a network</description>
+
+    <param n="network" t="VC:Network"/>
+
+    <script encoded="false">
+var hosts = network.host;
+var resourcePools = new Array();
+for(var i in hosts){
+       var parent = hosts[i].parent;
+       while(! (parent instanceof VcComputeResource || parent instanceof VcClusterComputeResource)){
+               parent = parent.parent;
+       }
+       
+       var pool = parent.resourcePool;
+       resourcePools.push(pool);
+       var childs = System.getModule("com.vmware.library.vc.resourcePool").getAllChildResourcePool(pool);
+       for(var j in childs){
+               resourcePools.push(childs[j]);
+       }
+       
+}
+
+return resourcePools;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.network/getNetworkForGivenNic.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.network/getNetworkForGivenNic.action.xml
new file mode 100644 (file)
index 0000000..fbbc648
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getNetworkForGivenNic" result-type="VC:Network" api-version="3.1.0" id="43191800-13b2-4ec6-814f-3de5f07252d6" version="0.3.1" allowed-operations="fv">
+    <description>Retrun the network for a given VM nic</description>
+
+    <param n="vm" t="VC:VirtualMachine">VM to get the first network</param>
+
+    <param n="nicNumber" t="number">1 to 4: the nic number</param>
+
+    <script encoded="false">
+var devices = vm.config.hardware.device;
+
+for (var i in devices) {
+       if (System.getModule("com.vmware.library.vc.vm.network").isSupportedNic(devices[i])) {
+               if (--nicNumber == 0) {
+                       if (devices[i].backing instanceof VcVirtualEthernetCardNetworkBackingInfo) {
+                               return VcPlugin.convertToVimManagedObject(vm ,devices[i].backing.network);
+                       } else if (devices[i].backing instanceof VcVirtualEthernetCardDistributedVirtualPortBackingInfo) {
+                               var moRef = new VcManagedObjectReference();
+                               moRef.type = "DistributedVirtualPortgroup";
+                               moRef.value = devices[i].backing.port.portgroupKey;
+                               return VcPlugin.convertToVimManagedObject(vm ,moRef);
+                       } else {
+                               return null;
+                       }
+               }
+       }
+}
+return null;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.network/getNicByNumber.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.network/getNicByNumber.action.xml
new file mode 100644 (file)
index 0000000..410b29a
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getNicByNumber" result-type="Any" api-version="3.1.0" id="52572177-7426-4652-9477-a3f38dc1b6b9" version="0.2.0" allowed-operations="fv">
+    <description>Return a Network card device (VimVirtualE1000, VimVirtualVmxnet, VimVirtualPCNet32). The network position let you choose if you want to get the 1st, 2nd... 5th network card.</description>
+
+    <param n="vm" t="VC:VirtualMachine">VM from which to get the network card</param>
+
+    <param n="nicPosition" t="number">Let you choose if you want to get the 1st, 2nd... 5th network card. If no valid value, 1st if used.</param>
+
+    <script encoded="false">
+var devices = vm.config.hardware.device;
+if (nicPosition &lt;= 0 || nicPosition &gt; 5) nicPosition = 1;
+var actualPos = 1;
+for (var i in devices) {
+       if (System.getModule("com.vmware.library.vc.vm.network").isSupportedNic(devices[i])) {
+               if (actualPos++ == nicPosition) {
+                       System.log("Found a Virtual Ethernet card at " + i + ". Key: " + devices[i].key);
+                       return devices[i];
+               }
+       }
+
+}
+return null
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.network/isSupportedNic.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.network/isSupportedNic.action.xml
new file mode 100644 (file)
index 0000000..3703631
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="isSupportedNic" result-type="boolean" api-version="3.1.0" id="1a602835-21c5-4420-baa0-52a5559edf87" version="0.1.2" allowed-operations="fv">
+    <description>Checks whether the given object is instance of supported Network interface controller</description>
+
+    <param n="nic" t="Any">Object to test</param>
+
+    <script encoded="false">
+return (nic instanceof VcVirtualE1000
+    || nic instanceof VcVirtualE1000e
+    || nic instanceof VcVirtualPCNet32
+    || nic instanceof VcVirtualVmxnet
+    || nic instanceof VcVirtualVmxnet2
+    || nic instanceof VcVirtualVmxnet3
+    || nic instanceof VcVirtualSriovEthernetCard);
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.power/shutdownVM.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.power/shutdownVM.action.xml
new file mode 100644 (file)
index 0000000..9fbbfa5
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="shutdownVM" result-type="void" api-version="3.1.0" id="cf810eef-158a-49bd-8ee9-7f9616b7519b" version="0.2.0" allowed-operations="fv">
+    <description>Shutdown the VM guest and wait for a given time before throwing an error if the VM is still not powered off. If timeout is set to 0, the action don't wait</description>
+
+    <param n="vm" t="VC:VirtualMachine"/>
+
+    <param n="timeout" t="number">Timeout in minutes [min]</param>
+
+    <param n="polling" t="number">Polling rate in seconds [s]</param>
+
+    <script encoded="false">
+if (timeout == null || timeout &lt; 0) {
+       timeout = 0
+}
+timeout = timeout * 60;
+var status = vm.runtime.powerState.value;
+vm.shutdownGuest() ;
+while(timeout &gt; 0){
+       var status = vm.runtime.powerState.value;
+       if(status == "poweredOff"){
+               break;
+       }
+       timeout -= polling;
+       if (timeout &lt;= 0) {
+               throw "Timeout: VM " + vm.name + "is still power on";
+       }
+       System.sleep(polling * 1000);
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.power/startVM.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.power/startVM.action.xml
new file mode 100644 (file)
index 0000000..3669bfc
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="startVM" result-type="VC:Task" api-version="3.1.0" id="d16d3729-a26c-453d-9819-2f82c9f0a368" version="0.2.0" allowed-operations="fv">
+    <description>Start / Resume a VM. Return the start task</description>
+
+    <param n="vm" t="VC:VirtualMachine">VM to start or resume</param>
+
+    <param n="host" t="VC:HostSystem">[Optional] The host where the virtual machine is to be powered on. If no host is specified, the current associated host is used. This field must specify a host that is part of the same compute resource that the virtual machine is currently associated with. If this host is not compatible, the current host association is used.</param>
+
+    <script encoded="false">
+return vm.powerOnVM_Task(host);
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device.backing.device/getVirtualEthernetCardNetworkBackingInfo.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device.backing.device/getVirtualEthernetCardNetworkBackingInfo.action.xml
new file mode 100644 (file)
index 0000000..bda72c3
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualEthernetCardNetworkBackingInfo" result-type="Any" api-version="3.1.0" id="fe1c822f-9003-47b9-a675-9075cf569fdd" version="0.2.0" allowed-operations="fv">
+    <description>The virtual Ethernet card backing class.</description>
+
+    <param n="deviceName" t="string">The name of the device on the host system.</param>
+
+    <param n="network" t="VC:Network">Reference to the network managed object to which this backing applies. This is not used during configuration.</param>
+
+    <script encoded="false">
+if (deviceName == null) 
+       deviceName = network.name;
+       
+var backing = new VcVirtualEthernetCardNetworkBackingInfo();
+backing.deviceName = deviceName;
+//backing.network = network.reference; Not used during configuration
+return backing;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/createVirtualDiskFlatVer2ConfigSpec.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/createVirtualDiskFlatVer2ConfigSpec.action.xml
new file mode 100644 (file)
index 0000000..f5f36f8
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="createVirtualDiskFlatVer2ConfigSpec" result-type="Any" api-version="3.1.0" id="0f6cb7b9-92fc-41af-beb3-5349322f0b19" version="0.3.0" allowed-operations="fv">
+    <description>
+Create a new VimVirtualDeviceConfigSpec for a VimVirtualDiskFlatVer2BackingInfo.
+The VirtualDisk.FlatVer2BackingInfo data object type contains information about backing a virtual disk using a virtual disk file on the host, in the flat file format used by GSX Server 3.x, ESX Server 2.x, and ESX Server 3.x. Flat disks are allocated when created, unlike sparse disks, which grow as needed.
+    </description>
+
+    <param n="sizeInGB" t="Any"/>
+
+    <param n="datastore" t="VC:Datastore"/>
+
+    <param n="controllerKey" t="number"/>
+
+    <param n="diskIndex" t="number"/>
+
+    <param n="diskMode" t="VC:VirtualDiskMode"/>
+
+    <param n="thinProvisioned" t="boolean"/>
+
+    <script encoded="false">
+// Create Disk BackingInfo
+var diskBackingInfo = new VcVirtualDiskFlatVer2BackingInfo();
+diskBackingInfo.diskMode = diskMode.value;
+var datastorePath = "[" + datastore.info.name + "]";
+diskBackingInfo.fileName = datastorePath;
+diskBackingInfo.thinProvisioned = thinProvisioned;
+// Create VirtualDisk
+var disk = new VcVirtualDisk();
+disk.backing = diskBackingInfo;
+disk.controllerKey = controllerKey;
+disk.key = -2;
+// Index 0 is not valid since Vi 4.0 (probably a bug)
+disk.unitNumber = diskIndex;
+disk.capacityInKB = parseInt( "" + (sizeInGB*1024*1024) );
+// Create Disk ConfigSpec
+deviceConfigSpec = new VcVirtualDeviceConfigSpec();
+deviceConfigSpec.device = disk;
+deviceConfigSpec.fileOperation = VcVirtualDeviceConfigSpecFileOperation.create;
+deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
+
+return deviceConfigSpec;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/createVirtualScsiControllerConfigSpec.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/createVirtualScsiControllerConfigSpec.action.xml
new file mode 100644 (file)
index 0000000..8bc3e2a
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="createVirtualScsiControllerConfigSpec" result-type="Any" api-version="3.1.0" id="35a5af26-2afb-484e-a107-b2cbcd8b3984" version="0.2.0" allowed-operations="fv">
+    <description>
+Create a new VimVirtualDeviceConfigSpec for a VimVirtualSCSIController
+The VirtualSCSIController data object type represents a SCSI controller in a virtual machine.
+    </description>
+
+    <param n="type" t="string">Controller type ("LSI" ,"PARA","SAS"or "BUS")</param>
+
+    <script encoded="false">
+// Create SCSI controller
+var controller = null;
+if ( type != null  &amp;&amp;  "LSI".equalsIgnoreCase( type.toUpperCase() ) == true )  {
+       controller = new VcVirtualLsiLogicController();
+}else if(type != null  &amp;&amp;  "PARA".equalsIgnoreCase( type.toUpperCase() ) == true){
+       controller = new VcParaVirtualSCSIController();
+}else if(type != null  &amp;&amp;  "SAS".equalsIgnoreCase( type.toUpperCase() ) == true){
+       controller = new VcVirtualLsiLogicSASController();
+}
+else  {
+       controller = new VcVirtualBusLogicController();
+}
+controller.key = 0;
+controller.device = new Array(0);
+controller.busNumber = 0;
+controller.sharedBus = VcVirtualSCSISharing.noSharing;
+// Create SCSI controller ConfigSpec
+var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
+deviceConfigSpec.device = controller;
+deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
+
+return deviceConfigSpec;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualDevice.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualDevice.action.xml
new file mode 100644 (file)
index 0000000..d52f486
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualDevice" result-type="Any" api-version="3.1.0" id="b91481c1-f5e9-4e99-8bdf-daaf77bf4ea0" version="0.3.0" allowed-operations="fv">
+    <description>
+Set values common to all Virtual Device. Should not be called directly to create a VirtualDevice!!!
+
+VirtualDevice is the base data object type for devices in a virtual machine. This type contains enough information about a virtual device to allow clients to display devices they do not recognize. For example, a client with an older version than the server to which it connects may see a device without knowing what it is.
+    </description>
+
+    <param n="device" t="Any">Virtual Device to set values.</param>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optioanl] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <script encoded="false">
+if (device == null) throw "ReferenceError: device cannot be null. getVirtualDevice must be called from another getVirtual[device] action";
+if (backing != null) {
+       if (checkBackingType(backing) == true) {
+               device.backing = backing;
+       }
+}
+if (connectable != null) {
+       if (connectable instanceof VcVirtualDeviceConnectInfo) {
+               device.connectable = connectable;
+       }
+       else {
+               throw "ReferenceError: connectable must be of type 'VcVirtualDeviceConnectInfo'";
+       }
+}
+if (deviceInfo != null) {
+       if (deviceInfo instanceof VcDescription) {
+               device.deviceInfo = deviceInfo;
+       }
+       else {
+               throw "ReferenceError: deviceInfo must be of type 'VcDescription'";
+       }
+}
+if (key != null) {
+       device.key = key;
+}
+else {
+       device.key = 0;
+       System.log("Device key not set. Force to 0");
+}
+if (unitNumber != null) {
+       device.unitNumber = unitNumber;
+}
+
+return device;
+
+
+function checkBackingType(backing) {
+       if (backing instanceof VcVirtualCdromAtapiBackingInfo) return true;
+       if (backing instanceof VcVirtualCdromPassthroughBackingInfo) return true;
+       if (backing instanceof VcVirtualDiskRawDiskVer2BackingInfo) return true;
+       if (backing instanceof VcVirtualDiskPartitionedRawDiskVer2BackingInfo) return true;
+       if (backing instanceof VcVirtualEthernetCardLegacyNetworkBackingInfo) return true;
+       if (backing instanceof VcVirtualEthernetCardNetworkBackingInfo) return true;
+       if (backing instanceof VcVirtualEthernetCardDistributedVirtualPortBackingInfo) return true;
+       if (backing instanceof VcVirtualFloppyDeviceBackingInfo) return true;
+       if (backing instanceof VcVirtualParallelPortDeviceBackingInfo) return true;
+       if (backing instanceof VcVirtualPointingDeviceDeviceBackingInfo) return true;
+       if (backing instanceof VcVirtualSCSIPassthroughDeviceBackingInfo) return true;
+       if (backing instanceof VcVirtualSerialPortDeviceBackingInfo) return true;
+       if (backing instanceof VcVirtualSoundCardDeviceBackingInfo) return true;
+       if (backing instanceof VcVirtualDeviceFileBackingInfo) return true;
+       if (backing instanceof VcVirtualDevicePipeBackingInfo) return true;
+       if (backing instanceof VcVirtualDeviceRemoteDeviceBackingInfo) return true;
+       
+       if (backing instanceof VcVirtualCdromIsoBackingInfo) return true;
+       if (backing instanceof VcVirtualDiskFlatVer1BackingInfo) return true;
+       if (backing instanceof VcVirtualDiskFlatVer2BackingInfo) return true;
+       if (backing instanceof VcVirtualDiskRawDiskMappingVer1BackingInfo) return true;
+       if (backing instanceof VcVirtualDiskSparseVer1BackingInfo) return true;
+       if (backing instanceof VcVirtualDiskSparseVer2BackingInfo) return true;
+       if (backing instanceof VcVirtualFloppyImageBackingInfo) return true;
+       if (backing instanceof VcVirtualParallelPortFileBackingInfo) return true;
+       if (backing instanceof VcVirtualSerialPortFileBackingInfo) return true;
+
+       if (backing instanceof VcVirtualSerialPortPipeBackingInfo) return true;
+       
+       if (backing instanceof VcVirtualCdromRemoteAtapiBackingInfo) return true;
+       if (backing instanceof VcVirtualCdromRemotePassthroughBackingInfo) return true;
+       if (backing instanceof VcVirtualFloppyRemoteDeviceBackingInfo) return true;
+       throw ("TypeError: backing is not of a valide type. type is: " + System.getObjectClassName(backing));
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualE1000.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualE1000.action.xml
new file mode 100644 (file)
index 0000000..edfe34e
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualE1000" result-type="Any" api-version="3.1.0" id="9989df5b-6787-4aaf-ad59-1481a29375dd" version="0.2.0" allowed-operations="fv">
+    <description>The VirtualE1000 data object type represents an instance of the E1000 virtual Ethernet adapter attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualE1000();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualE1000e.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualE1000e.action.xml
new file mode 100644 (file)
index 0000000..837d8ed
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualE1000e" result-type="Any" api-version="3.1.0" id="5296e6f1-1656-445d-8a6d-46c7672ff78c" version="0.1.0" allowed-operations="fv">
+    <description>The VirtualE1000 data object type represents an instance of the E1000 virtual Ethernet adapter attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualE1000e();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualEthernetCard.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualEthernetCard.action.xml
new file mode 100644 (file)
index 0000000..8f97b92
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualEthernetCard" result-type="Any" api-version="3.1.0" id="03146120-2495-4e6d-ad1d-47304e674540" version="0.2.0" allowed-operations="fv">
+    <description>VirtualController is the base data object type for a device controller in a virtual machine. VirtualController extends VirtualDevice to inherit general information about a controller (such as name and description), and to allow controllers to appear in a generic list of virtual devices.</description>
+
+    <param n="device" t="Any">One of the VirtualController types.</param>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualDevice(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber);
+if (addressType != null) {
+       if (addressType == "Manual" || addressType == "Generated" || addressType == "Assigned") {
+               device.addressType = addressType;
+       }
+       else {
+               throw "EvalError: addressType value must be 'Manual', 'Generated' or 'Assigned'";
+       }       
+}
+if (macAddress != null) {
+       device.macAddress = macAddress;
+}
+if (wakeOnLanEnabled != null) {
+       device.wakeOnLanEnabled = wakeOnLanEnabled;
+}
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualPCNet32.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualPCNet32.action.xml
new file mode 100644 (file)
index 0000000..a4386d9
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualPCNet32" result-type="Any" api-version="3.1.0" id="0e9f1f57-260f-4dd1-9976-b1fd1a2bfa68" version="0.2.0" allowed-operations="fv">
+    <description>This data object type defines the properties of an AMD Lance PCNet32 Ethernet card attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualPCNet32();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualSriovEthernetCard.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualSriovEthernetCard.action.xml
new file mode 100644 (file)
index 0000000..441861c
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualSriovEthernetCard" result-type="Any" api-version="3.1.0" id="a3739b91-83f6-4688-8e66-135bdc8ff332" version="0.1.0" allowed-operations="fv">
+    <description>The VcVirtualSriovEthernetCard data object defines the properties of an SR-IOV enabled Ethernet card attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualSriovEthernetCard();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet.action.xml
new file mode 100644 (file)
index 0000000..e60ae49
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualVmxnet" result-type="Any" api-version="3.1.0" id="5b09227a-a86c-4d08-aee0-ba9cfea4a3ee" version="0.2.0" allowed-operations="fv">
+    <description>The VirtualVmxnet data object type represents an instance of the Vmxnet virtual Ethernet adapter attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualVmxnet();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet2.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet2.action.xml
new file mode 100644 (file)
index 0000000..1623863
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualVmxnet2" result-type="Any" api-version="3.1.0" id="c0ff93ed-4d78-4d28-a2e9-b165098b0862" version="0.1.0" allowed-operations="fv">
+    <description>The VirtualVmxnet data object type represents an instance of the Vmxnet virtual Ethernet adapter attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualVmxnet2();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet3.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet3.action.xml
new file mode 100644 (file)
index 0000000..80061c5
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getVirtualVmxnet3" result-type="Any" api-version="3.1.0" id="23a9d942-c887-4c5b-bee1-e8d1fe262aad" version="0.1.0" allowed-operations="fv">
+    <description>The VirtualVmxnet data object type represents an instance of the Vmxnet virtual Ethernet adapter attached to a virtual machine.</description>
+
+    <param n="backing" t="Any">[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</param>
+
+    <param n="connectable" t="Any">[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</param>
+
+    <param n="controllerKey" t="number">[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</param>
+
+    <param n="deviceInfo" t="Any">[Optional] VimDescription: This property provides a label and summary information for the device.</param>
+
+    <param n="key" t="number">[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</param>
+
+    <param n="unitNumber" t="number">[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</param>
+
+    <param n="addressType" t="string">[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</param>
+
+    <param n="macAddress" t="string">[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</param>
+
+    <param n="wakeOnLanEnabled" t="boolean">[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</param>
+
+    <script encoded="false">
+var device = new VcVirtualVmxnet3();
+device = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualEthernetCard(device,backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled);
+return device;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationFixedName.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationFixedName.action.xml
new file mode 100644 (file)
index 0000000..21ce8c8
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationFixedName" result-type="Any" api-version="3.1.0" id="5f8aff88-2ff0-4d06-91c9-bc1da279089d" version="0.3.0" allowed-operations="fv">
+    <description>A fixed name.</description>
+
+    <param n="name" t="string">The virtual machine name specified by the client.</param>
+
+    <script encoded="false">
+if (name == null) {
+       throw "Unable to create VcCustomizationFixedName. Reason: name cannot be null";
+}
+var fixedName = new VcCustomizationFixedName();
+fixedName.name = name;
+return fixedName;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationGuiRunOnce.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationGuiRunOnce.action.xml
new file mode 100644 (file)
index 0000000..021e952
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationGuiRunOnce" result-type="Any" api-version="3.1.0" id="32185e33-6255-4b5a-af06-6de06ea64628" version="0.2.0" allowed-operations="fv">
+    <description>The commands listed in the GuiRunOnce data object type are executed when a user logs on the first time after customization completes. The logon may be driven by the AutoLogon setting.</description>
+
+    <param n="commandList" t="Array/string">A list of commands to run at first user logon, after guest customization.</param>
+
+    <script encoded="false">
+if (commandList == null) {
+       throw "Unable to create VcCustomizationGuiRunOnce. Reason: commandList cannot be null";
+}
+var result =  new VcCustomizationGuiRunOnce();
+result.commandList = commandList;
+return result;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationGuiUnattended.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationGuiUnattended.action.xml
new file mode 100644 (file)
index 0000000..ade7994
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationGuiUnattended" result-type="Any" api-version="3.1.0" id="5f422021-72f3-41ea-8d99-c9b7a00fcb20" version="0.2.0" allowed-operations="fv">
+    <description>The GuiUnattended type maps to the GuiUnattended key in the sysprep.inf answer file. These values are plugged directly into the sysprep.inf file that VirtualCenter stores on the target virtual disk.</description>
+
+    <param n="autoLogon" t="boolean">Flag to determine whether or not the machine automatically logs on as Administrator</param>
+
+    <param n="autoLogonCount" t="number">If the AutoLogon flag is set, then the AutoLogonCount property specifies the number of times the machine should automatically log on as Administrator</param>
+
+    <param n="password" t="Any">[Optional] VimCustomizationPassword: The new administrator password for the machine. To specify that the password should be set to blank (that is, no password), set the password value to NULL. Because of encryption, "" is NOT a valid value.</param>
+
+    <param n="timeZone" t="number">The time zone for the new virtual machine. Numbers correspond to time zones listed in sysprep documentation</param>
+
+    <script encoded="false">
+var guiUnattended;
+
+try {
+       checkParams();
+       guiUnattended = new VcCustomizationGuiUnattended();
+       affectParams();
+       return guiUnattended;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationGuiUnattended: " + ex;
+}
+
+
+function affectParams() {
+       guiUnattended.autoLogon = autoLogon;
+       guiUnattended.autoLogonCount = autoLogonCount;
+       guiUnattended.password = password;
+       guiUnattended.timeZone = timeZone;
+}
+
+function checkParams() {
+       if (autoLogon == null) throw "autologon cannot be null";
+       if (autoLogonCount == null) autoLogonCount = 0;
+       if (autoLogon &amp;&amp; autoLogonCount &lt; 1) throw "autoLogonCount cannot be lesser or equal to 0 if autoLogon is set to true";
+       if (password != null &amp;&amp; ((password instanceof VcCustomizationPassword) == false)) throw "password must be of type VcCustomizationPassword";
+       if (timeZone == null) throw "timezone cannot be null";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationIdentificationFromCredential.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationIdentificationFromCredential.action.xml
new file mode 100644 (file)
index 0000000..cbfc34c
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationIdentificationFromCredential" result-type="Any" api-version="3.1.0" id="b542b6a6-84ea-4222-a9a8-547a3aab8efe" version="0.2.1" allowed-operations="fv">
+    <description>The Identification data object type provides information needed to join a workgroup or domain</description>
+
+    <param n="domainAdmin" t="Credential">[Optional] This is the domain user account used for authentication if the virtual machine is joining a domain. The user does not need to be a domain administrator, but the account must have the privileges required to add computers to the domain.</param>
+
+    <param n="joinDomain" t="string">[Optional] The domain that the virtual machine should join. If this value is supplied, then domainAdmin and domainAdminPassword must also be supplied, and the workgroup name must be empty.</param>
+
+    <param n="joinWorkgroup" t="string">[Optional] The workgroup that the virtual machine should join. If this value is supplied, then the domain name and authentication fields must be empty.</param>
+
+    <script encoded="false">
+var identification;
+try {
+       checkParam();
+       if(joinDomain==null &amp;&amp; joinWorkgroup==null){
+               joinWorkgroup="WORKGROUP";
+       }
+       identification = new VcCustomizationIdentification();
+       affectParam();
+       return identification;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationIdentification: " + ex;
+}
+
+function affectParam() {
+       if (joinWorkgroup == null || joinWorkgroup == "") {
+               identification.domainAdmin = domainAdmin.username;
+               identification.domainAdminPassword = VcPlugin.createCustomizationPasswordFromCredentials(domainAdmin, true);
+
+               identification.joinDomain = joinDomain;
+               identification.joinWorkgroup = joinWorkgroup;
+       }
+       else {
+               identification.joinWorkgroup = joinWorkgroup;
+               identification.joinDomain = null;
+       }               
+}
+
+function checkParam() {
+       if (joinDomain != null &amp;&amp; joinDomain == "") joinDomain = null;
+       if (joinWorkgroup != null &amp;&amp; joinWorkgroup == "") joinWorkgroup = null;
+       
+       if (joinDomain != null &amp;&amp; joinWorkgroup != null) throw "joinDomain and joinWorkgroup cannot be set together";
+       if (joinDomain != null &amp;&amp; (domainAdmin == null)) throw "joinDomain is set, but domainAdmin or domainAdminPassword is not set";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationLicenseFilePrintData.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationLicenseFilePrintData.action.xml
new file mode 100644 (file)
index 0000000..09e0173
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationLicenseFilePrintData" result-type="Any" api-version="3.1.0" id="45ce6046-66f1-48d0-85c5-eed4679711c3" version="0.2.0" allowed-operations="fv">
+    <description>The LicenseFilePrintData type maps directly to the LicenseFilePrintData key in the sysprep.inf answer file.</description>
+
+    <param n="autoMode" t="VC:CustomizationLicenseDataMode">Server licensing mode</param>
+
+    <param n="autoUsers" t="number">This key is valid only if AutoMode = PerServer.</param>
+
+    <script encoded="false">
+var license;
+try {
+       checkParam();
+       license = new VcCustomizationLicenseFilePrintData();
+       affectParam();
+       return license;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationLicenseFilePrintData: " + ex;
+}
+
+function affectParam() {
+       //if (autoMode != null)
+       license.autoMode = VcCustomizationLicenseDataMode.fromString(autoMode.name);
+       if (autoUsers != null &amp;&amp; autoUsers &gt;= 0)
+               license.autoUsers = autoUsers;
+       else
+               System.debug("autoUsers is " + autoUsers);
+}
+
+function checkParam() {
+       if (autoMode == null) throw "autoMode cannot be null";
+       if (autoMode == VcCustomizationLicenseDataMode.perServer &amp;&amp; autoUsers == null) throw "autoMode is set to perServer, autoUsers cannot be null";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationLinuxPrep.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationLinuxPrep.action.xml
new file mode 100644 (file)
index 0000000..1b2007c
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationLinuxPrep" result-type="Any" api-version="3.1.0" id="060b0c32-d8b0-4726-882c-64ee9ef70cfa" version="0.2.0" allowed-operations="fv">
+    <description>This is the Linux counterpart to the Windows Sysprep object. LinuxPrep contains machine-wide settings that identify a Linux machine in the same way that the Sysprep type identifies a Windows machine.</description>
+
+    <param n="domain" t="string">The fully qualified domain name.</param>
+
+    <param n="hostName" t="Any">The network host name of the (Linux) virtual machine.</param>
+
+    <script encoded="false">
+var linuxPrep;
+try {
+       checkParams();
+       linuxPrep = new VcCustomizationLinuxPrep();
+       affectParams();
+       return linuxPrep;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationLinuxPrep: " + ex;
+}
+
+function affectParams() {
+       linuxPrep.domain = domain;
+       linuxPrep.hostName = hostName;
+}
+
+function checkParams() {
+       if (domain == null) domain = "";
+       if (hostName == null) throw "hostname cannot be null";
+       if (((hostName instanceof VcCustomizationCustomName) || (hostName instanceof VcCustomizationFixedName) ||
+                (hostName instanceof VcCustomizationPrefixName) || (hostName instanceof VcCustomizationUnknownName) ||
+                (hostName instanceof VcCustomizationVirtualMachineName)) == false) {
+               throw "hostName must be of type VcCustomizationCustomName, VcCustomizationFixedName, VcCustomizationPrefixName, VcCustomizationUnknownName, VcCustomizationVirtualMachineName";
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationPassword.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationPassword.action.xml
new file mode 100644 (file)
index 0000000..b472a8d
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationPassword" result-type="Any" api-version="3.1.0" id="77fd7bab-20ff-45b9-a959-4a4e365df0eb" version="0.2.0" allowed-operations="fv">
+    <description>Contains a password string and a flag that specifies whether the string is in plain text or encrypted.</description>
+
+    <param n="plainText" t="boolean">Flag to specify whether or not the password is in plain text, rather than encrypted.</param>
+
+    <param n="value" t="string">The password string. It is encrypted if the associated plainText flag is false.</param>
+
+    <script encoded="false">
+try {
+       if (plainText == null) throw "plainText cannot be null";
+//     if (value == null) throw "value cannot be null";
+if (value == null) value = "";
+//     return new VcCustomizationPassword(plainText, value);
+       var password = new VcCustomizationPassword();
+       password.plainText = plainText;
+       password.value = value;
+       return password;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationPassword: " + ex;
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationPrefixName.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationPrefixName.action.xml
new file mode 100644 (file)
index 0000000..07ec645
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationPrefixName" result-type="Any" api-version="3.1.0" id="5effe5b3-d8d4-4109-a2fa-7680a1b5e98e" version="0.2.0" allowed-operations="fv">
+    <description>
+Specifies that a unique name should be generated by concatenating the base string with a number. 
+Virtual machine names are unique across the set of hosts and virtual machines known to the VirtualCenter instance. VirtualCenter tracks the network names of virtual machines as well as hosts. VMware Tools runs in a guest operating system and reports information to VirtualCenter, including the network name of the guest.
+    </description>
+
+    <param n="base" t="string">Base prefix, to which a unique number is appended.</param>
+
+    <script encoded="false">
+try {
+       if (base == null) throw "base cannot be null";
+       return new VcCustomizationPrefixName(base);
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationPrefixName: " + ex;
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationSysprep.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationSysprep.action.xml
new file mode 100644 (file)
index 0000000..6d58d02
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationSysprep" result-type="Any" api-version="3.1.0" id="812f97c9-6d2f-4172-852f-fd7d5938be5d" version="0.2.0" allowed-operations="fv">
+    <description>An object representation of a Windows sysprep.inf answer file. The sysprep type encloses all the individual keys listed in a sysprep.inf file. For more detailed information, see the document Windows 2000 Unattended Setup Guide.</description>
+
+    <param n="guiRunOnce" t="Any">[Optional] VimCustomizationGuiRunOnce: An object representation of the sysprep GuiRunOnce key.</param>
+
+    <param n="guiUnattended" t="Any">VimCustomizationGuiUnattended: An object representation of the sysprep GuiUnattended key. VimCustomizationGuiUnattended:</param>
+
+    <param n="identification" t="Any">VimCustomizationIdentification: An object representation of the sysprep Identification key.</param>
+
+    <param n="licenseFilePrintData" t="Any">[Optional] VimCustomizationLicenseFilePrintData: An object representation of the sysprep LicenseFilePrintData key. Required only for Windows 2000 Server and Windows Server 2003.</param>
+
+    <param n="userData" t="Any">VimCustomizationUserData: An object representation of the sysprep UserData key.</param>
+
+    <script encoded="false">
+var sysprep;
+try {
+       checkParams();
+       sysprep = new VcCustomizationSysprep();
+       affectParams();
+       return sysprep;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationSysprep: " + ex;
+}
+
+function affectParams() {
+       sysprep.guiRunOnce = guiRunOnce;
+       sysprep.guiUnattended = guiUnattended;
+       sysprep.identification = identification;
+       sysprep.licenseFilePrintData = licenseFilePrintData;
+       sysprep.userData = userData;
+}
+
+function checkParams() {
+       if (guiRunOnce != null &amp;&amp; ((guiRunOnce instanceof VcCustomizationGuiRunOnce) == false)) throw "guiRunOnce must be of type VcCustomizationGuiRunOnce";
+       if (guiUnattended == null) throw "guiUnattended cannot be null"; 
+       if ((guiUnattended instanceof VcCustomizationGuiUnattended) == false) throw "guiUnattended must be of type VcCustomizationGuiUnattended";
+       if (identification == null) throw "identification cannot be null"; 
+       if ((identification instanceof VcCustomizationIdentification) == false) throw "identification must be of type VcCustomizationIdentification";
+       if (licenseFilePrintData != null &amp;&amp; ((licenseFilePrintData instanceof VcCustomizationLicenseFilePrintData) == false)) throw "licenseFilePrintData must be of type VcCustomizationLicenseFilePrintData";
+       if (userData == null) throw "userData cannot be null"; 
+       if ((userData instanceof VcCustomizationUserData) == false) throw "userData must be of type VcCustomizationUserData";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationUserData.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.identity/getCustomizationUserData.action.xml
new file mode 100644 (file)
index 0000000..8334a29
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationUserData" result-type="Any" api-version="3.1.0" id="815294fd-ba3e-474e-ac34-ee1319459495" version="0.2.0" allowed-operations="fv">
+    <description>
+Personal data pertaining to the owner of the virtual machine.
+    </description>
+
+    <param n="computerName" t="Any">VimCustomizationName: The computer name of the (Windows) virtual machine.</param>
+
+    <param n="fullName" t="string">User's full name.</param>
+
+    <param n="orgName" t="string">User's organization.</param>
+
+    <param n="productId" t="string">Microsoft Sysprep requires that a valid serial number be included in the answer file when mini-setup runs. This serial number is ignored if the original guest operating system was installed using a volume-licensed CD.</param>
+
+    <script encoded="false">
+var userData;
+try {
+       checkParams();
+       userData = new VcCustomizationUserData();
+       affectParams();
+       return userData;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationUserData: " + ex;
+}
+
+function affectParams() {
+       userData.computerName = computerName;
+       userData.fullName = fullName;
+       userData.orgName = orgName;
+       userData.productId = productId;
+}
+
+function checkParams() {
+       if (computerName == null) throw "hostname cannot be null";
+       if (((computerName instanceof VcCustomizationCustomName) || (computerName instanceof VcCustomizationFixedName) ||
+                (computerName instanceof VcCustomizationPrefixName) || (computerName instanceof VcCustomizationUnknownName) ||
+                (computerName instanceof VcCustomizationVirtualMachineName)) == false) {
+               throw "computerName must be of type VcCustomizationCustomName, VcCustomizationFixedName, VcCustomizationPrefixName, VcCustomizationUnknownName, VcCustomizationVirtualMachineName";
+       }
+       if (fullName == null) throw "fullName cannot be null";
+       if (orgName == null) throw "orgName cannot be null";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationAdapterMapping.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationAdapterMapping.action.xml
new file mode 100644 (file)
index 0000000..b8e6eac
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationAdapterMapping" result-type="Any" api-version="3.1.0" id="6ff3c370-0be5-4220-b0fa-a30589c25da7" version="0.2.0" allowed-operations="fv">
+    <description>Define Data object type to associate a virtual network adapter with its IP settings.</description>
+
+    <param n="adapter" t="Any">VimCustomizationIPSettings: The IP settings for the associated virtual network adapter.</param>
+
+    <param n="macAddress" t="string">[Optional] The MAC address of a network adapter being customized. If it is not included, the customization process maps the settings from the virtual machine's network adapters, in PCI slot order.</param>
+
+    <script encoded="false">
+try {
+       checkParams();
+       var mapping = new VcCustomizationAdapterMapping();
+       mapping.adapter = adapter;
+       if (macAddress != null &amp;&amp; macAddress != "")
+               mapping.macAddress = macAddress;
+       return mapping;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationAdapterMapping: " + ex;
+}
+
+function checkParams() {
+       if (adapter == null) throw "adapter cannot be null";
+       if ((adapter instanceof VcCustomizationIPSettings) == false) throw "adapter must be of type VcCustomizationIPSettings";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationDhcpIpGenerator.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationDhcpIpGenerator.action.xml
new file mode 100644 (file)
index 0000000..5e52610
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationDhcpIpGenerator" result-type="Any" api-version="3.1.0" id="feb34f2d-6779-42cb-ae27-0d5c8f3ef51a" version="0.2.0" allowed-operations="fv">
+    <description>Use a DHCP server to configure the virtual network adapter.</description>
+
+    <script encoded="false">
+return new VcCustomizationDhcpIpGenerator();
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationFixedIp.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationFixedIp.action.xml
new file mode 100644 (file)
index 0000000..d42a5d8
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationFixedIp" result-type="Any" api-version="3.1.0" id="edaf362c-ac98-48ad-89fb-7875b052489e" version="0.2.0" allowed-operations="fv">
+    <description>Use a static IP Address for the virtual network adapter.</description>
+
+    <param n="ipAddress" t="string">A Fixed valid IP Address</param>
+
+    <script encoded="false">
+var fixedIp = new VcCustomizationFixedIp();
+fixedIp.ipAddress = ipAddress;
+return fixedIp;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationIPSettings.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationIPSettings.action.xml
new file mode 100644 (file)
index 0000000..387cea9
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationIPSettings" result-type="Any" api-version="3.1.0" id="8e6d65f2-5f54-4c90-b553-00448b577f83" version="0.2.0" allowed-operations="fv">
+    <description>Define IP settings for a virtual network adapter.</description>
+
+    <param n="dnsDomain" t="string">[Optional] A DNS domain suffix such as dunes.ch.</param>
+
+    <param n="dnsServerList" t="Array/string">[Optional] A list of server IP addresses to use for DNS lookup in a Windows guest operating system.</param>
+
+    <param n="gateway" t="Array/string">[Optional] List of gateways, in order of preference.</param>
+
+    <param n="ip" t="Any">VimCustomizationIpGenerator: Specification to obtain a unique IP address for this virtual network adapter.</param>
+
+    <param n="netBIOS" t="VC:CustomizationNetBIOSMode">[Optional] NetBIOS setting for Windows.</param>
+
+    <param n="primaryWINS" t="string">[Optional] The IP address of the primary WINS server. This property is ignored for Linux guest operating systems.</param>
+
+    <param n="secondaryWINS" t="string">[Optional] The IP address of the secondary WINS server. This property is ignored for Linux guest operating systems.</param>
+
+    <param n="subnetMask" t="string">[Optional] Subnet mask for this virtual network adapter.</param>
+
+    <script encoded="false">
+var ipSettings;
+checkParams();
+ipSettings = new VcCustomizationIPSettings();
+affectParams();
+return ipSettings;
+
+function affectParams() {
+       ipSettings.dnsDomain = dnsDomain;
+       ipSettings.dnsServerList = dnsServerList;
+       ipSettings.gateway = gateway;
+       ipSettings.ip = ip;
+       if (netBIOS != null)
+               ipSettings.netBIOS = VcCustomizationNetBIOSMode.fromString(netBIOS.name) ;
+       ipSettings.primaryWINS = primaryWINS;
+       ipSettings.secondaryWINS = secondaryWINS;
+       ipSettings.subnetMask = subnetMask;
+}
+
+function checkParams() {
+       if (ip == null) throw  "ReferenceError: ip cannot be null";
+
+       if (((ip instanceof VcCustomizationCustomIpGenerator) || (ip instanceof VcCustomizationDhcpIpGenerator) ||
+                (ip instanceof VcCustomizationFixedIp) || (ip instanceof VcCustomizationUnknownIpGenerator)) == false)
+               throw "ReferenceError: ip must be of type VcCustomizationCustomIpGenerator, VcCustomizationDhcpIpGenerator, VcCustomizationFixedIp or VcCustomizationUnknownIpGenerator";
+       if (ip instanceof VcCustomizationFixedIp) {
+               if (subnetMask == null || subnetMask == "") {
+                       throw "ReferenceError: SubnetMask is not set";
+               }
+               if (gateway == null || gateway.length==0) {
+                       throw "ReferenceError: Gateway is not set";
+               }
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationUnknownIpGenerator.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec.nic/getCustomizationUnknownIpGenerator.action.xml
new file mode 100644 (file)
index 0000000..a1ee1e9
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationUnknownIpGenerator" result-type="Any" api-version="3.1.0" id="0e502114-8fa6-481c-818a-cb6f2bcf8e87" version="0.2.0" allowed-operations="fv">
+    <description>The IP address is left unspecified. The user must be prompted to supply an IP address.</description>
+
+    <script encoded="false">
+return new VcCustomizationUnknownIpGenerator();
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/checkVMwareInput.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/checkVMwareInput.action.xml
new file mode 100644 (file)
index 0000000..9232acb
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="checkVMwareInput" result-type="void" api-version="3.1.0" id="38d856a0-c7b4-48b0-ab86-5666e298a302" version="0.2.0" allowed-operations="fv">
+    <description>Check that basics inputs parameters of a Clone workflows are all part of the same vimHost (Virutal Center)</description>
+
+    <param n="vm" t="VC:VirtualMachine">VM to clone</param>
+
+    <param n="folder" t="VC:VmFolder">Target folder</param>
+
+    <param n="datastore" t="VC:Datastore">Target datastore</param>
+
+    <param n="host" t="VC:HostSystem">Target host</param>
+
+    <param n="pool" t="VC:ResourcePool">Target pool</param>
+
+    <script encoded="false">
+if (vm != null) {
+       var vcenter = vm.vimHost;
+}
+if (folder != null &amp;&amp; folder.vimHost != vcenter) throw "Target folder is not part of the same VI Server as the source VM";
+if (datastore != null &amp;&amp; datastore.vimHost != vcenter) throw "Target datastore is not part of the same VI Server as the source VM";
+if (host != null &amp;&amp; host.vimHost != vcenter) throw "Target host is not part of the same VI Server as the source VM";
+if (pool != null &amp;&amp; pool.vimHost != vcenter) throw "Target pool is not part of the same VI Server as the source VM";
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCloneSpec.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCloneSpec.action.xml
new file mode 100644 (file)
index 0000000..d887fe9
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCloneSpec" result-type="Any" api-version="3.1.0" id="7f64fab4-0051-4b64-a8cb-9a4c3a683b50" version="0.2.0" allowed-operations="fv">
+    <description>Specification for a virtual machine cloning operation.</description>
+
+    <param n="config" t="Any">[optional] VirtualMachineConfigSpec: An optional specification of changes to the virtual hardware.</param>
+
+    <param n="customization" t="Any">[optional] CustomizationSpec: An optional guest operating system customization specification.</param>
+
+    <param n="location" t="Any">VirtualMachineRelocateSpec: A type of RelocateSpec that specifies the location of resources the newly cloned virtual machine will use</param>
+
+    <param n="powerOn" t="boolean">Specifies whether or not the new VirtualMachine should be powered on after creation</param>
+
+    <param n="template" t="boolean">Specifies whether or not the new virtual machine should be marked as a template.</param>
+
+    <script encoded="false">
+try {
+       checkParam();
+       var cloneSpec = new VcVirtualMachineCloneSpec();
+       affectParam();
+       return cloneSpec;
+}
+catch (ex) {
+       throw "Unable to create CloneSpec: " + ex;
+}
+
+function affectParam() {
+       cloneSpec.config = config;
+       cloneSpec.customization = customization;
+       cloneSpec.location = location;
+       cloneSpec.powerOn = powerOn;
+       cloneSpec.template = template;
+}
+
+function checkParam() {
+       if (config != null &amp;&amp; (config instanceof VcVirtualMachineConfigSpec) == false) throw "config must be of type 'VcVirtualMachineConfigSpec'";
+       if (customization != null &amp;&amp; (customization instanceof VcCustomizationSpec) == false)   throw "customization must be of type 'VcCustomizationSpec'";
+       if (location == null) throw "location must be defined (type: VcVirtualMachineRelocateSpec)";
+       if ((location instanceof VcVirtualMachineRelocateSpec) == false) throw "location must be of type 'VcVirtualMachineRelocateSpec'";
+       if (powerOn == null) throw "powerOn must be defined (type: boolean)";
+       if (template == null) throw "template must be defined (type: boolean)";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getConfigSpecSimple.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getConfigSpecSimple.action.xml
new file mode 100644 (file)
index 0000000..226e5d6
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getConfigSpecSimple" result-type="Any" api-version="3.1.0" id="7a2f1a94-b487-4af3-be72-ed776ec029ab" version="0.2.1" allowed-operations="fv">
+    <description>
+The ConfigSpec data object type encapsulates configuration settings when creating or reconfiguring a virtual machine. To support incremental changes, these properties are all optional. 
+Basic Version
+    </description>
+
+    <param n="deviceChange" t="Array/Any">[optional] Array of VirtualDeviceConfigSpec: Set of virtual devices being modified by the configuration operation.</param>
+
+    <param n="files" t="Any">[optional] VirtualMachineFileInfo: Information about virtual machine files</param>
+
+    <param n="flags" t="Any">[optional] VirtualMachineFlagInfo: Additional flags for a virtual machine.</param>
+
+    <param n="memoryMB" t="number">[optional] Size of a virtual machine's memory, in MB.</param>
+
+    <param n="name" t="string">[optional] Display name of the virtual machine.</param>
+
+    <param n="numCPUs" t="number">[optional] Number of virtual processors in a virtual machine.</param>
+
+    <script encoded="false">
+try {
+       checkParam();
+       var configSpec = new VcVirtualMachineConfigSpec();
+       affectParam();
+       return configSpec;
+}
+catch (ex) {
+       throw "Unable to create VcVirtualMachineConfigSpec: " + ex;
+}
+
+
+function affectParam() {
+       configSpec.deviceChange = deviceChange;
+       configSpec.files = files;
+       configSpec.flags = flags;
+       configSpec.memoryMB = memoryMB;
+       configSpec.name = name;
+       configSpec.numCPUs = numCPUs;
+}
+
+function checkParam() {
+       if (deviceChange != null) {
+               for (var i in deviceChange) {
+                       if ((deviceChange[i] instanceof VcVirtualDeviceConfigSpec) == false) throw "deviceChange must be of type 'Array of VcVirtualDeviceConfigSpec'";
+               }
+       }
+       if (files != null &amp;&amp; (files instanceof VcVirtualMachineFileInfo) == false) throw "files must be of type 'VcVirtualMachineFileInfo'";
+       if (flags != null &amp;&amp; (flags instanceof VcVirtualMachineFlagInfo) == false) throw "flags must be of type 'VcVirtualMachineFlagInfo'";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettings.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettings.action.xml
new file mode 100644 (file)
index 0000000..a87bd0c
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationGlobalIPSettings" result-type="Any" api-version="3.1.0" id="9aeae868-7645-4839-a53d-071f57300e2e" version="0.2.0" allowed-operations="fv">
+    <description>A collection of global IP settings for a virtual network adapter. In Linux, DNS server settings are global. The settings can either be statically set or supplied by a DHCP server.</description>
+
+    <param n="dnsServerList" t="Array/string">[Optional] List of DNS servers, for a virtual network adapter with a static IP address</param>
+
+    <param n="dnsSuffixList" t="Array/string">[Optional] List of name resolution suffixes for the virtual network adapter</param>
+
+    <script encoded="false">
+var globalIPSettings = new VcCustomizationGlobalIPSettings();
+globalIPSettings.dnsServerList = dnsServerList;
+globalIPSettings.dnsSuffixList = dnsSuffixList;
+return globalIPSettings;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettingsWithDomainAsString.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettingsWithDomainAsString.action.xml
new file mode 100644 (file)
index 0000000..3557c5a
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationGlobalIPSettingsWithDomainAsString" result-type="Any" api-version="3.1.0" id="f6adc44f-0be3-44ca-abe6-dd06e84b3223" version="0.2.0" allowed-operations="fv">
+    <description>A collection of global IP settings for a virtual network adapter. In Linux, DNS server settings are global. The settings can either be statically set or supplied by a DHCP server.</description>
+
+    <param n="dnsServerList" t="Array/string">[Optional] List of DNS servers, for a virtual network adapter with a static IP address</param>
+
+    <param n="dnsSuffix" t="string">[Optional] List of name resolution suffixes for the virtual network adapter</param>
+
+    <script encoded="false">
+var globalIPSettings = new VcCustomizationGlobalIPSettings();
+globalIPSettings.dnsServerList = dnsServerList;
+var dnsSuffixList = new Array();
+dnsSuffixList.push(dnsSuffix);
+globalIPSettings.dnsSuffixList = dnsSuffixList;
+return globalIPSettings;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationSpec.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getCustomizationSpec.action.xml
new file mode 100644 (file)
index 0000000..aa45185
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getCustomizationSpec" result-type="Any" api-version="3.1.0" id="83fb285c-7f3a-44e4-877b-437d0bcfec25" version="0.2.0" allowed-operations="fv">
+    <description>The Specification data object type contains information required to customize a virtual machine when deploying it or migrating it to a new host.</description>
+
+    <param n="globalIPSettings" t="Any">VimCustomizationGlobalIPSettings: Global IP settings constitute the IP settings that are not specific to a particular virtual network adapter.</param>
+
+    <param n="identity" t="Any">VimCustomizationIdentitySettings: Network identity and settings, similar to Microsoft's Sysprep tool. This is a Sysprep, LinuxPrep, or SysprepText object.</param>
+
+    <param n="nicSettingMap" t="Array/Any">[Optional] Array of VimCustomizationAdapterMapping: IP settings that are specific to a particular virtual network adapter.</param>
+
+    <param n="options" t="Any">[Optional] VimCustomizationOptions: Optional operations (either LinuxOptions or WinOptions).</param>
+
+    <script encoded="false">
+var customSpec
+try {
+       checkParams();
+       customSpec = new VcCustomizationSpec();
+       affectParams();
+       return customSpec;
+}
+catch (ex) {
+       throw "Unable to create VcCustomizationSpec: " + ex;
+}
+
+function affectParams() {
+       customSpec.globalIPSettings = globalIPSettings;
+       customSpec.identity = identity;
+       customSpec.nicSettingMap = nicSettingMap;
+       customSpec.options = options;
+}
+
+function checkParams() {
+       if (globalIPSettings == null) throw "globalIPSettings cannot be null";
+       if ((globalIPSettings instanceof VcCustomizationGlobalIPSettings) == false) throw "globalIPSettings must be of type VcCustomizationGlobalIPSettings";
+       if (identity == null) throw "identity cannot be null";
+       if (((identity instanceof VcCustomizationLinuxPrep) || (identity instanceof VcCustomizationSysprep) || (identity instanceof VcCustomizationSysprepText)) == false )
+               throw "identity must be of type VcCustomizationLinuxPrep, VcCustomizationSysprep or VcCustomizationSysprepText";
+       if (nicSettingMap != null) {
+               for (var i in nicSettingMap) {
+                       if ((nicSettingMap[i] instanceof VcCustomizationAdapterMapping) == false) {
+                               throw "nicSettingMap must be of type VcCustomizationAdapterMapping";
+                       }
+               }
+       }
+       if (options != null &amp;&amp; ((options instanceof VcCustomizationLinuxOptions) || (options instanceof VcCustomizationWinOptions)) == false) throw "options must be of type VcCustomizationOptions";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getRelocateSpec.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.spec/getRelocateSpec.action.xml
new file mode 100644 (file)
index 0000000..f4c6f64
--- /dev/null
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getRelocateSpec" result-type="Any" api-version="3.1.0" id="a12e3fb9-94f1-4c99-9e3b-709e44a639cc" version="0.2.1" allowed-operations="fv">
+    <description>Specification for moving or copying a virtual machine to a different datastore or host.</description>
+
+    <param n="datastore" t="VC:Datastore">[optional] The datastore where the virtual machine should be located. If not specified, the current datastore is used</param>
+
+    <param n="disk" t="Array/Any">[optional] Array of VirtualMachineRelocateSpecDiskLocator: An optional list that allows specifying the datastore location for each virtual disk.</param>
+
+    <param n="host" t="VC:HostSystem">[optional] The target host for the virtual machine.</param>
+
+    <param n="pool" t="VC:ResourcePool">[optional] The resource pool to which this virtual machine should be attached.</param>
+
+    <param n="transform" t="VC:VirtualMachineRelocateTransformation">[optional] Transformation to perform on the disks.</param>
+
+    <script encoded="false">
+try {
+       simpleCheckParams();
+       consistencyCheckParams();
+       var relocateSpec = new VcVirtualMachineRelocateSpec();
+       affectParams();
+       return relocateSpec;
+}
+catch (ex) {
+       throw "Unable to create VcVirtualMachineRelocateSpec: " + ex;
+}
+
+function consistencyCheckParams() {
+       //if resource pool is not specified, current host is used. 
+       if (pool == null &amp;&amp; host == null) return; // throw "pool and host cannot be all two set to null";
+       if (pool == null) {
+               // host is not null
+               pool = host.parent.resourcePool;
+               checkDatastoreAccessOkFromHost(host);
+       }
+       else {
+               cluster = pool.parent;
+               while (! (cluster instanceof VcComputeResource) &amp;&amp; ! (cluster instanceof VcClusterComputeResource)) {
+                       cluster = cluster.parent;
+               }
+               //if resource pool is specified, and the target pool represents a stand-alone host, the host is used. 
+               if (cluster instanceof VcComputeResource) {
+                       if (host != null &amp;&amp; (cluster != host.parent)) {
+                               throw "pool and host do not represent the same compute resource";
+                       }
+               }
+               else if (cluster instanceof VcClusterComputeResource) {
+                       if (cluster.configuration.drsConfig.enabled ) {
+                               //if resource pool is specified, and the target pool represents a DRS-enabled cluster, a host selected by DRS is used. 
+                               if (host != null &amp;&amp; (cluster != host.parent)) {
+                                       throw "pool and host do not represent the same compute resource";                                               
+                               }
+                       }
+                       else {
+                       //if resource pool is specified and the target pool represents a cluster without DRS enabled, an InvalidArgument exception be thrown.   
+                               if (host == null) {
+                                       throw "pool is in a cluster without drs. You must define host";
+                               }
+                       }
+               }
+       }
+}
+
+function checkDatastoreAccessOkFromHost(myHost) {
+       var allDS = myHost.datastore;
+       var found = false;
+       
+       if (datastore == null) {
+               return;
+       }
+       
+       for (var i in allDS) {
+               if (allDS[i] == datastore) {
+                       found = true;
+                       break;
+               }
+       }
+       if (found == false) {
+               var hostName = myHost == null ? "Unknown Host" : myHost.name;
+               var datastoreName = datastore == null ? "Unknown Datastore" : datastore.name;
+               throw "host " + hostName + " have no access to datastore " + datastoreName;
+       }
+}
+
+function checkDatastoreAccessOkFromCluster(myCluster) {
+       var allDS = myCluster.datastore;
+       var found = false;
+       
+       if (datastore == null) {
+               return;
+       }
+       
+       for (var i in allDS) {
+               if (allDS[i] == datastore) {
+                       found = true;
+                       break;
+               }
+       }
+       if (found == false) {
+               var clusterName = myCluster == null ? "Unknown Cluster" : myCluster.name;
+               var datastoreName = datastore == null ? "Unknown Datastore" : datastore.name;           
+               throw "cluster " + clusterName + " have no access to datastore " + datastoreName;
+       }
+}
+
+function affectParams() {
+       if (datastore != null)
+               relocateSpec.datastore = datastore.reference;
+       if (disk != null &amp;&amp; disk.length &gt; 0) 
+               relocateSpec.disk = disk;
+       if (host != null)
+               relocateSpec.host = host.reference;
+       if (pool != null)
+               relocateSpec.pool = pool.reference;
+       if (transform != null)
+               relocateSpec.transform = VcVirtualMachineRelocateTransformation.fromString(transform.name);
+}
+
+
+function simpleCheckParams() {
+       if (disk != null) {
+               for (var i in disk) {
+                       if ((disk[i] instanceof VcVirtualMachineRelocateSpecDiskLocator) == false) {
+                               throw "disk must be of type 'Array of VcVirtualMachineRelocateSpecDiskLocator'";
+                       }
+               }
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.tools/vim3WaitDnsNameInTools.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.tools/vim3WaitDnsNameInTools.action.xml
new file mode 100644 (file)
index 0000000..a828a61
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="vim3WaitDnsNameInTools" result-type="void" api-version="3.1.0" id="32dec77f-76bd-438d-b6e4-3ea01296ca0b" version="0.2.0" allowed-operations="fv">
+    <description>
+Wait for a given name in the DNS guest informations (VMware tools).
+
+Exception:
+- Timeout: When timeout is reached
+    </description>
+
+    <param n="vm" t="VC:VirtualMachine">VM in which the action look to get the new DNS Name</param>
+
+    <param n="pollingRate" t="number">Time between all request information on the tools [seconds]</param>
+
+    <param n="dnsNameToWait" t="string">Define a specific DNS name to wait for (either in compute.dunes.ch or compute form)</param>
+
+    <param n="timeout" t="number">Timeout before throwing a timeout exception [minutes]</param>
+
+    <param n="addNumberToName" t="boolean">Specify if the DNS name has an automatically number added at end (not known at clone time)</param>
+
+    <script encoded="false">
+if (vm == null) throw "ReferenceError: vm is not defined for waiting for the DNS name";
+if (vm.name == null) throw "ReferenceError: vm is not initialized for waiting for the DNS name";
+
+timeout = timeout * 60;
+
+while (true) {
+       if (vm.guest != null) {
+               if (vm.guest.toolsStatus == VcVirtualMachineToolsStatus.toolsOk || vm.guest.toolsStatus == VcVirtualMachineToolsStatus.toolsOld) {
+                       if (vm.guest.guestState == "running") {
+                               hostname = vm.guest.hostName;
+                               if (hostname.indexOf(".") &gt; 0) {
+                                       if (dnsNameToWait.indexOf(".") &gt; 0 &amp;&amp; hostname.toLowerCase() == dnsNameToWait.toLowerCase()) {
+                                               break;
+                                       }
+                                       if (dnsNameToWait.indexOf(".") &lt; 0) {
+                                               if (hostname.substring(0, hostname.indexOf(".")).toLowerCase() == dnsNameToWait.toLowerCase()) {
+                                                       break;
+                                               }
+                                       }
+                               }
+                               else {
+                                       if (dnsNameToWait.indexOf(".") &gt; 0 ) {
+                                               if (dnsNameToWait.substring(0, dnsNameToWait.indexOf(".")).toLowerCase() == hostname.toLowerCase()) {
+                                                       break;
+                                               }
+                                       }
+                                       if (dnsNameToWait.indexOf(".") &lt; 0 &amp;&amp; hostname.toLowerCase() == dnsNameToWait.toLowerCase()) {
+                                               break;
+                                       }
+                               }
+                       }
+               }
+       }
+       // wait the poolingRate
+       System.sleep(pollingRate * 1000);
+       // test timeout
+       timeout -= pollingRate;
+       if (timeout &lt;= 0) {
+               throw "Timeout: Unable to get a DNS name for the VM before reaching the Timeout";
+       }
+}
+
+System.log("Found name '" + hostname + "' for VM '" + vm.name + "'");
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm.tools/vim3WaitToolsStarted.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm.tools/vim3WaitToolsStarted.action.xml
new file mode 100644 (file)
index 0000000..9c3bc97
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="vim3WaitToolsStarted" result-type="void" api-version="3.1.0" id="498e2443-f2a4-416c-b3ff-066e793f1b4e" version="0.2.0" allowed-operations="fv">
+    <description>
+Wait for the VMware tools to be up and the guest running
+
+Exception:
+- Timeout: When timeout is reached
+- ReferenceError: When vm is not set correctly
+    </description>
+
+    <param n="vm" t="VC:VirtualMachine">VM in which the action look to get the new DNS Name</param>
+
+    <param n="pollingRate" t="number">Time between all request information on the tools [seconds]</param>
+
+    <param n="timeout" t="number">Timeout before throwing a timeout exception [minutes]</param>
+
+    <script encoded="false">
+if (vm == null) throw "ReferenceError: vm is not defined for waiting for the DNS name";
+if (vm.name == null) throw "ReferenceError: vm is not initialized for waiting for the DNS name";
+
+timeout = timeout * 60;
+
+while (true) {
+       if (vm.guest != null) {
+               if (vm.guest.toolsStatus != null &amp;&amp; vm.guest.toolsStatus == VcVirtualMachineToolsStatus.toolsOk) {
+                       System.log("toolsOK");
+               }
+               if (vm.guest.toolsStatus != null &amp;&amp; vm.guest.toolsStatus == VcVirtualMachineToolsStatus.toolsOld) {
+                       System.log("toolsOld");
+               }
+               if (vm.guest.toolsStatus != null &amp;&amp; (vm.guest.toolsStatus == VcVirtualMachineToolsStatus.toolsOk || vm.guest.toolsStatus == VcVirtualMachineToolsStatus.toolsOld)) {
+                       if (vm.guest.guestState == "running") {
+                               break;
+                       }
+               }
+       }
+       else {
+               System.log("vm.guest is null");
+       }       
+
+       // wait the poolingRate
+       System.sleep(pollingRate*1000);
+       // test timeout
+       timeout -= pollingRate;
+       if (timeout &lt;= 0) {
+               throw "Timeout: Timout waiting for tools to be started on a running OS";
+       }
+}
+
+System.log("VMware tools on VM " + vm.name + " are in state: " + vm.guest.toolsStatus.value + " and guest is " + vm.guest.guestState);
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm/changeVMRAM.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm/changeVMRAM.action.xml
new file mode 100644 (file)
index 0000000..873995c
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="changeVMRAM" result-type="VC:Task" api-version="3.1.0" id="385834ae-1544-4c98-84c1-434bd54c377a" version="0.1.0" allowed-operations="fv">
+    <description>Change the VM memory size.</description>
+
+    <param n="vm" t="VC:VirtualMachine">The VM to change</param>
+
+    <param n="memory" t="number">New memory value</param>
+
+    <script encoded="false">
+var configSpec = new VcVirtualMachineConfigSpec();
+configSpec.memoryMB = memory;
+var task = vm.reconfigVM_Task( configSpec );
+return task;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm/changeVMvCPU.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm/changeVMvCPU.action.xml
new file mode 100644 (file)
index 0000000..02d70d6
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="changeVMvCPU" result-type="VC:Task" api-version="3.1.0" id="a13e6055-0e74-40b4-acd0-57ad9f946d3c" version="0.1.0" allowed-operations="fv">
+    <description>Change the number of vCPUs in the VM.</description>
+
+    <param n="vm" t="VC:VirtualMachine">The VM to change</param>
+
+    <param n="vcpu" t="number">New vCPU number</param>
+
+    <script encoded="false">
+var configSpec = new VcVirtualMachineConfigSpec();
+configSpec.numCPUs = vcpu;
+var task = vm.reconfigVM_Task( configSpec );
+return task;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm/cloneVM.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm/cloneVM.action.xml
new file mode 100644 (file)
index 0000000..e3dd643
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="cloneVM" result-type="VC:Task" api-version="3.1.0" id="26dfcb1a-5f7c-48d9-b481-747eaca2b9db" version="0.2.0" allowed-operations="fv">
+    <description>
+Try to clone a VM.
+    </description>
+
+    <param n="vm" t="VC:VirtualMachine">VM to clone</param>
+
+    <param n="folder" t="VC:VmFolder">The location of the new virtual machine.</param>
+
+    <param n="name" t="string">The name of the new virtual machine.</param>
+
+    <param n="spec" t="Any">VimVirtualMachineCloneSpec: Specifies how to clone the virtual machine.</param>
+
+    <script encoded="false">
+try {
+       checkParams();
+       return vm.cloneVM_Task(folder, name, spec);
+}
+catch (ex) {
+       throw "Unable to start clone operation: " + ex;
+}
+
+function checkParams() {
+       if (vm == null) throw "vm cannot be null";
+       if (folder == null) throw "folder cannot be null";
+       if (name == null || name == "") throw "name cannot be null";
+       if (spec == null) throw "spec cannot be null";
+       if ((spec instanceof VcVirtualMachineCloneSpec) == false) throw "spec must be of type VcVirtualMachineCloneSpec";
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.library.vc.vm/getAllVMsMatchingRegexp.action.xml b/vFLOWER/content/Actions/com.vmware.library.vc.vm/getAllVMsMatchingRegexp.action.xml
new file mode 100644 (file)
index 0000000..f7a50b8
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="getAllVMsMatchingRegexp" result-type="Array/VC:VirtualMachine" api-version="3.1.0" id="b37d567e-4fc0-45c4-8211-b7176025dc8e" version="0.1.0" allowed-operations="fv">
+    <param n="regexp" t="string"/>
+
+    <script encoded="false">
+// Get all Virtual Machines for all vCenter connections defined for this plugin
+var allVms = VcPlugin.getAllVirtualMachines();
+var vms = new Array();
+// Check if the VM match the regexp
+for (var i in allVms) {
+       if (allVms[i].name.match(regexp)) {
+               vms.push(allVms[i]);
+       }
+}      
+return vms;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/com.vmware.pso.cryptojs/base64Encode.action.xml b/vFLOWER/content/Actions/com.vmware.pso.cryptojs/base64Encode.action.xml
new file mode 100644 (file)
index 0000000..b075b9f
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="base64Encode" result-type="string" api-version="3.1.0" id="c6c94b25-55fa-4d47-9d2b-97292fdcfe57" version="0.0.2" allowed-operations="fve">
+    <description>
+Encodes a message with Base64
+
+Pure Javascript and self contained.  Uses code.google.com/p/crypto-js version 3.1.2
+    </description>
+
+    <param n="input" t="string">Message to encode with Base64</param>
+
+    <script encoded="false">
+/*
+CryptoJS v3.1.2
+code.google.com/p/crypto-js
+(c) 2009-2013 by Jeff Mott. All rights reserved.
+code.google.com/p/crypto-js/wiki/License
+*/
+/* components/core-min.js */
+var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;a&amp;&amp;b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&amp;&amp;(this[b]=a[b]);a.hasOwnProperty("toString")&amp;&amp;(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
+j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var e=0;e&lt;a;e++)b[c+e&gt;&gt;&gt;2]|=(d[e&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(e%4)&amp;255)&lt;&lt;24-8*((c+e)%4);else if(65535&lt;d.length)for(e=0;e&lt;a;e+=4)b[c+e&gt;&gt;&gt;2]=d[e&gt;&gt;&gt;2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b&gt;&gt;&gt;2]&amp;=4294967295&lt;&lt;
+32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d&lt;a;d+=4)b.push(4294967296*h.random()|0);return new j.init(b,a)}}),m=k.enc={},s=m.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c&lt;a;c++){var e=b[c&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(c%4)&amp;255;d.push((e&gt;&gt;&gt;4).toString(16));d.push((e&amp;15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c&lt;b;c+=2)d[c&gt;&gt;&gt;3]|=parseInt(a.substr(c,
+2),16)&lt;&lt;24-4*(c%8);return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c&lt;a;c++)d.push(String.fromCharCode(b[c&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(c%4)&amp;255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c&lt;b;c++)d[c&gt;&gt;&gt;2]|=(a.charCodeAt(c)&amp;255)&lt;&lt;24-8*(c%4);return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},
+q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&amp;&amp;(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;c=h.min(4*a,c);if(a){for(var g=0;g&lt;a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a);b.sigBytes-=c}return new j.init(g,c)},clone:function(){var a=f.clone.call(this);
+a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&amp;&amp;this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,d){return(new a.init(d)).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return(new u.HMAC.init(a,
+d)).finalize(b)}}});var u=k.algo={};return k}(Math);
+
+/* components/enc-base64-min.js */
+(function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a&lt;f;a+=3)for(var d=(e[a&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(a%4)&amp;255)&lt;&lt;16|(e[a+1&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*((a+1)%4)&amp;255)&lt;&lt;8|e[a+2&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*((a+2)%4)&amp;255,g=0;4&gt;g&amp;&amp;a+0.75*g&lt;f;g++)b.push(c.charAt(d&gt;&gt;&gt;6*(3-g)&amp;63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&amp;&amp;(c=b.indexOf(c),-1!=c&amp;&amp;(e=c));for(var c=[],a=0,d=0;d&lt;
+e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))&lt;&lt;2*(d%4),h=f.indexOf(b.charAt(d))&gt;&gt;&gt;6-2*(d%4);c[a&gt;&gt;&gt;2]|=(g|h)&lt;&lt;24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
+
+var words = CryptoJS.enc.Utf8.parse(input);
+return CryptoJS.enc.Base64.stringify(words);
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/no.uio/CheckPidInVM.action.xml b/vFLOWER/content/Actions/no.uio/CheckPidInVM.action.xml
new file mode 100644 (file)
index 0000000..ff5540b
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="CheckPidInVM" result-type="boolean" api-version="3.1.0" id="965ff7b4-1631-4153-a767-b4e227ed5003" version="1.0.0" allowed-operations="fve">
+    <param n="pid" t="number"/>
+
+    <param n="vm" t="VC:VirtualMachine"/>
+
+    <param n="vmUsername" t="string"/>
+
+    <param n="vmPassword" t="SecureString"/>
+
+    <script encoded="false">
+var host = vm.sdkConnection;
+
+var guestOperationsManager = host.guestOperationsManager;
+var guestAuth = new VcNamePasswordAuthentication();
+guestAuth.username = vmUsername;
+guestAuth.password = vmPassword;
+
+//var pid=result.split(".");
+var processManager = guestOperationsManager.processManager;
+var guestProcessInfo = processManager.listProcessesInGuest(vm , guestAuth , [pid]);
+
+for each (var p in guestProcessInfo) {
+       if (! p.startTime) {
+               return true;
+       }
+       if (p.endTime) {
+               return true;
+       } else {
+               trow("Process still running");
+               return false;
+       }
+}
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Actions/no.uio/createVirtualEthernetCardDvNetworkConfigSpec.action.xml b/vFLOWER/content/Actions/no.uio/createVirtualEthernetCardDvNetworkConfigSpec.action.xml
new file mode 100644 (file)
index 0000000..3e4c7f1
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dunes-script-module name="createVirtualEthernetCardDvNetworkConfigSpec" result-type="Any" api-version="3.1.0" id="a6ec564a-c18b-4b40-abc1-4270d7fd4a4d" version="2.0.0" allowed-operations="fve">
+    <description>
+Create a new VimVirtualDeviceConfigSpec for a VimVirtualEthernetCardNetworkBackingInfo
+The virtual Ethernet card backing class.
+    </description>
+
+    <param n="dvPortgroup" t="VC:DistributedVirtualPortgroup"/>
+
+    <param n="macAddress" t="string"/>
+
+    <script encoded="false">
+// Create connectable info for dvPortgroup
+var connectInfo = new VcVirtualDeviceConnectInfo();
+connectInfo.allowGuestControl = false;
+connectInfo.connected = false;
+connectInfo.startConnected = true;
+// Create Network BackingInfo
+var dvsPortConnection = new VcDistributedVirtualSwitchPortConnection();
+var dvSwitch = VcPlugin.convertToVimManagedObject(dvPortgroup, dvPortgroup.config.distributedVirtualSwitch);
+dvsPortConnection.switchUuid = dvSwitch.uuid;
+dvsPortConnection.portgroupKey = dvPortgroup.key;
+
+var netBackingInfo = new VcVirtualEthernetCardDistributedVirtualPortBackingInfo() ;
+netBackingInfo.port = dvsPortConnection;
+
+//new VimVirtualEthernetCardNetworkBackingInfo();
+//netBackingInfo.deviceName = dvPortGroup.name;
+
+// Create VirtualNetwork
+//var vNetwork = new VcVirtualPCNet32();
+var vNetwork = new VcVirtualVmxnet3();
+vNetwork.backing = netBackingInfo;
+vNetwork.key = 0;
+vNetwork.unitNumber = 0;
+if ( macAddress != null  &amp;&amp;  macAddress != "" )  {
+       vNetwork.addressType = "Manual";
+       vNetwork.macAddress = macAddress;
+}
+else  {
+       vNetwork.addressType = "Generated";
+}
+vNetwork.connectable = connectInfo;
+// Create Network ConfigSpec
+var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
+deviceConfigSpec.device = vNetwork;
+deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
+
+return deviceConfigSpec;
+    </script>
+</dunes-script-module>
diff --git a/vFLOWER/content/Packages/no.uio.virtprov-20150126-01.package.xml b/vFLOWER/content/Packages/no.uio.virtprov-20150126-01.package.xml
new file mode 100644 (file)
index 0000000..eb5c501
--- /dev/null
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package id="ff80808149e2bfb7014a09ff98a01bc3">
+    <name>no.uio.virtprov-20150126-01</name>
+    <description/>
+    <workflows>
+        <id-028080808080808080808080808080809F808080013264596926189e8150e1493 path="Library/SQL/Execute a custom query on a database.workflow.xml"/>
+        <id-048080808080808080808080808080808F808080013264596926189e8150e1493 path="Library/SQL/Read a custom query from a database.workflow.xml"/>
+        <id-0d2ce070-c285-4a7f-9ec0-71f769d07114 path="uio/lib/tools/copy_files_to_vm.workflow.xml"/>
+        <id-0ef918a9-8fc7-4efd-b556-59a32f96bae5 path="Library/Tagging/Tag workflow.workflow.xml"/>
+        <id-13f152b9-bdfe-43ca-9399-47e61cb74022 path="uio/VirtProv/ clone VM from DB + linux 2.0.workflow.xml"/>
+        <id-1877a3a5-e5cc-45fe-b752-677bf91a6e7f path="uio/lib/bofh/host_roles.workflow.xml"/>
+        <id-1f0fc470-006c-4c15-a3b9-95e2e7540f22 path="uio/etc/global_parameters.workflow.xml"/>
+        <id-1f459776-8603-4336-ae18-85672d369909 path="uio/lib/tools/get_optimal_datastore.workflow.xml"/>
+        <id-21827d8d-4e4b-4094-a41f-f2c5b8a3375e path="uio/lib/ad/get_ad_passwd.workflow.xml"/>
+        <id-25832524-da3e-407e-a64a-d4418bcb3174 path="uio/lib/log/info.workflow.xml"/>
+        <id-2b5cccb5-e2f5-4d3b-8a05-c0d3fdc61e3c path="uio/lib/bofh/get_ad_password.workflow.xml"/>
+        <id-2cc2c18b-d313-495e-9636-b960ee816507 path="uio/lib/tools/ post_linux.workflow.xml"/>
+        <id-2cdac1c6-1c4b-4fd4-aa62-a2736a71f7e7 path="uio/lib/log/error.workflow.xml"/>
+        <id-569edb26-b0dc-4ae0-802e-f90394e2084b path="uio/lib/vm/Clone, Linux with single NIC.workflow.xml"/>
+        <id-5a067901-2ced-47ef-8973-ea49ceb60d5d path="Library/Tagging/Untag workflow.workflow.xml"/>
+        <id-6ba8217c-e631-4bfb-80fc-16cec2e5c369 path="uio/lib/ad/get_ad_computer.workflow.xml"/>
+        <id-7f97fbb6-daf1-41dc-ae0c-a24388a77fa4 path="uio/lib/bofh/host_add.workflow.xml"/>
+        <id-8986a211-6aae-404a-8586-374d658fbee8 path="uio/lib/tools/exec_post_scipts.workflow.xml"/>
+        <id-90808080808080808080808080808080D28080800120523434428525559a3425f path="Library/SSH/Run SSH command.workflow.xml"/>
+        <id-958080808080808080808080808080803381808001175609873343b6bbd2e3eea path="Library/Microsoft/Active Directory/User/Disable a user.workflow.xml"/>
+        <id-958080808080808080808080808080803881808001175609873343b6bbd2e3eea path="Library/Microsoft/Active Directory/User/Enable a user.workflow.xml"/>
+        <id-B8808080808080808080808080808080C480808001231146624761b79546544c2 path="Library/vCenter/Virtual Machine management/Basic/Wait for task and answer virtual machine question.workflow.xml"/>
+        <id-BD8080808080808080808080808080801BC280800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Device Management/Add disk.workflow.xml"/>
+        <id-BD80808080808080808080808080808039C280800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Clone/Tools/Get Linux customization.workflow.xml"/>
+        <id-BD80808080808080808080808080808075C280800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Power Management/Shut down guest OS and wait.workflow.xml"/>
+        <id-BD8080808080808080808080808080808AC280800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Clone/Tools/Get a VirtualEthernetCard to change the network.workflow.xml"/>
+        <id-BD80808080808080808080808080808093C380800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Basic/Mark as template.workflow.xml"/>
+        <id-BD80808080808080808080808080808094C280800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Clone/Tools/Get NIC setting map.workflow.xml"/>
+        <id-BD808080808080808080808080808080CCC280800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Power Management/Start virtual machine and wait.workflow.xml"/>
+        <id-BD808080808080808080808080808080FEC180800122528313869552e41805bb1 path="Library/vCenter/Virtual Machine management/Clone/Tools/Get Windows customization, Sysprep with credentials.workflow.xml"/>
+        <id-C28080808080808080808080808080808180808001322751030482b80adf61e7c path="Library/vCenter/Guest operations/Files/List path in guest.workflow.xml"/>
+        <id-C3808080808080808080808080808080AA80808001322751030482b80adf61e7c path="Library/vCenter/Guest operations/Files/Check for file in guest.workflow.xml"/>
+        <id-C88080808080808080808080808080809880808001322751030482b80adf61e7c path="Library/vCenter/Guest operations/Files/Create directory in guest.workflow.xml"/>
+        <id-C98080808080808080808080808080805E80808001322751030482b80adf61e7c path="Library/vCenter/Guest operations/Processes/Run program in guest.workflow.xml"/>
+        <id-a5c7285f-1b6c-45e6-a4cb-3b2881b54cb0 path="uio/lib/ad/get_project.workflow.xml"/>
+        <id-b967157c-21a9-478d-8260-f9fa86ac3687 path="uio/lib/vm/create_vm.workflow.xml"/>
+        <id-bb56f2b9-97b8-4c32-829f-b92a9a0fd53e path="uio/lib/tools/get_template.workflow.xml"/>
+        <id-d37cd9f5-2d4a-4ec1-ae1f-d2df8496c5b4 path="uio/lib/bofh/host_add_nonvm.workflow.xml"/>
+        <id-e15f70a1-d461-45ab-ad7c-5218bf750fbd path="uio/lib/vm/clone_vm.workflow.xml"/>
+        <id-e606a877-eb2a-4ff8-ba1c-2e48aba0e869 path="uio/lib/ad/generate_password.workflow.xml"/>
+        <id-e7764fb3-d858-4336-af95-2295aca15ce8 path="uio/VirtProv/clone_vm_from_rest.workflow.xml"/>
+        <id-e8ecbc5e-964e-4811-84d6-76ff12d69d72 path="uio/lib/log/vm_ready_email.workflow.xml"/>
+        <id-eb00c75d-3403-4fb9-a3ae-a07e45c20bf0 path="uio/lib/tools/clone_lin_win.workflow.xml"/>
+        <id-edb09c46-fd03-405a-b1a5-948eb9b887e3 path="uio/lib/tools/disable_and_untag_tsduser.workflow.xml"/>
+        <id-f9934087-646a-4a21-97ab-032a2663c0eb path="uio/lib/tools/mk_kickstart.workflow.xml"/>
+        <id-fac19258-528f-4e75-a341-6242a16246b6 path="uio/lib/log/set_db_state.workflow.xml"/>
+        <id-fdc80ec4-b7c5-4a34-8b46-4ef411021844 path="uio/lib/tools/post_windows.workflow.xml"/>
+        <id-fe9631e6-8706-4a86-b8c2-898da0ce747d path="uio/lib/tools/add_cpu_memory.workflow.xml"/>
+    </workflows>
+    <actions>
+        <id-03146120-2495-4e6d-ad1d-47304e674540 path="com.vmware.library.vc.vm.spec.config.device/getVirtualEthernetCard.action.xml"/>
+        <id-060b0c32-d8b0-4726-882c-64ee9ef70cfa path="com.vmware.library.vc.vm.spec.identity/getCustomizationLinuxPrep.action.xml"/>
+        <id-0e0dc068-af83-41db-bb50-4b779c3aafe3 path="com.vmware.library.vc.datastore/getValidDatastoreForNetwork.action.xml"/>
+        <id-0e502114-8fa6-481c-818a-cb6f2bcf8e87 path="com.vmware.library.vc.vm.spec.nic/getCustomizationUnknownIpGenerator.action.xml"/>
+        <id-0e9f1f57-260f-4dd1-9976-b1fd1a2bfa68 path="com.vmware.library.vc.vm.spec.config.device/getVirtualPCNet32.action.xml"/>
+        <id-0f6cb7b9-92fc-41af-beb3-5349322f0b19 path="com.vmware.library.vc.vm.spec.config.device/createVirtualDiskFlatVer2ConfigSpec.action.xml"/>
+        <id-1305f8d8-b3b5-4f06-a8d6-d11629b188cc path="com.vmware.library.vc.datastore/getDatastoreForHostAndResourcePool.action.xml"/>
+        <id-1a602835-21c5-4420-baa0-52a5559edf87 path="com.vmware.library.vc.vm.network/isSupportedNic.action.xml"/>
+        <id-23a9d942-c887-4c5b-bee1-e8d1fe262aad path="com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet3.action.xml"/>
+        <id-26dfcb1a-5f7c-48d9-b481-747eaca2b9db path="com.vmware.library.vc.vm/cloneVM.action.xml"/>
+        <id-2af834d2-acaa-4594-95b2-437d05780133 path="com.vmware.library.vc.basic/getVimHostForVimObject.action.xml"/>
+        <id-32185e33-6255-4b5a-af06-6de06ea64628 path="com.vmware.library.vc.vm.spec.identity/getCustomizationGuiRunOnce.action.xml"/>
+        <id-32dec77f-76bd-438d-b6e4-3ea01296ca0b path="com.vmware.library.vc.vm.tools/vim3WaitDnsNameInTools.action.xml"/>
+        <id-35a5af26-2afb-484e-a107-b2cbcd8b3984 path="com.vmware.library.vc.vm.spec.config.device/createVirtualScsiControllerConfigSpec.action.xml"/>
+        <id-385834ae-1544-4c98-84c1-434bd54c377a path="com.vmware.library.vc.vm/changeVMRAM.action.xml"/>
+        <id-38d856a0-c7b4-48b0-ab86-5666e298a302 path="com.vmware.library.vc.vm.spec/checkVMwareInput.action.xml"/>
+        <id-3fafdce0-dd72-4f9d-b1aa-94b4628403c4 path="com.vmware.library.vc.network/getNetworkForResourcePoolHostVm.action.xml"/>
+        <id-423f39fc-fcf2-46cc-9fff-8e2ef86baf91 path="com.vmware.library.vc.cluster/getAllClusterComputeResourceForVimHost.action.xml"/>
+        <id-43191800-13b2-4ec6-814f-3de5f07252d6 path="com.vmware.library.vc.vm.network/getNetworkForGivenNic.action.xml"/>
+        <id-45ce6046-66f1-48d0-85c5-eed4679711c3 path="com.vmware.library.vc.vm.spec.identity/getCustomizationLicenseFilePrintData.action.xml"/>
+        <id-498e2443-f2a4-416c-b3ff-066e793f1b4e path="com.vmware.library.vc.vm.tools/vim3WaitToolsStarted.action.xml"/>
+        <id-52572177-7426-4652-9477-a3f38dc1b6b9 path="com.vmware.library.vc.vm.network/getNicByNumber.action.xml"/>
+        <id-5296e6f1-1656-445d-8a6d-46c7672ff78c path="com.vmware.library.vc.vm.spec.config.device/getVirtualE1000e.action.xml"/>
+        <id-5b09227a-a86c-4d08-aee0-ba9cfea4a3ee path="com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet.action.xml"/>
+        <id-5effe5b3-d8d4-4109-a2fa-7680a1b5e98e path="com.vmware.library.vc.vm.spec.identity/getCustomizationPrefixName.action.xml"/>
+        <id-5f422021-72f3-41ea-8d99-c9b7a00fcb20 path="com.vmware.library.vc.vm.spec.identity/getCustomizationGuiUnattended.action.xml"/>
+        <id-5f8aff88-2ff0-4d06-91c9-bc1da279089d path="com.vmware.library.vc.vm.spec.identity/getCustomizationFixedName.action.xml"/>
+        <id-6e4e9ced-de28-4565-aed9-e9839d1422fe path="com.vmware.library.vc.basic/getDatacenterForVimObject.action.xml"/>
+        <id-6ff3c370-0be5-4220-b0fa-a30589c25da7 path="com.vmware.library.vc.vm.spec.nic/getCustomizationAdapterMapping.action.xml"/>
+        <id-77fd7bab-20ff-45b9-a959-4a4e365df0eb path="com.vmware.library.vc.vm.spec.identity/getCustomizationPassword.action.xml"/>
+        <id-7a2f1a94-b487-4af3-be72-ed776ec029ab path="com.vmware.library.vc.vm.spec/getConfigSpecSimple.action.xml"/>
+        <id-7f64fab4-0051-4b64-a8cb-9a4c3a683b50 path="com.vmware.library.vc.vm.spec/getCloneSpec.action.xml"/>
+        <id-812f97c9-6d2f-4172-852f-fd7d5938be5d path="com.vmware.library.vc.vm.spec.identity/getCustomizationSysprep.action.xml"/>
+        <id-815294fd-ba3e-474e-ac34-ee1319459495 path="com.vmware.library.vc.vm.spec.identity/getCustomizationUserData.action.xml"/>
+        <id-824faaf4-383c-4224-919a-18dbece89ce6 path="com.vmware.library.vc.resourcePool/getValidResourcePoolForNetwork.action.xml"/>
+        <id-83cc409d-547b-4c8c-9ba4-29c886b1b3ba path="com.vmware.library.vc.basic/vim3WaitTaskEnd.action.xml"/>
+        <id-83fb285c-7f3a-44e4-877b-437d0bcfec25 path="com.vmware.library.vc.vm.spec/getCustomizationSpec.action.xml"/>
+        <id-8cec318b-bb81-41df-b13e-bdeb3c6d58aa path="com.vmware.library.vc.datastore/getAllAvaiblableHostForVM.action.xml"/>
+        <id-8e6d65f2-5f54-4c90-b553-00448b577f83 path="com.vmware.library.vc.vm.spec.nic/getCustomizationIPSettings.action.xml"/>
+        <id-965ff7b4-1631-4153-a767-b4e227ed5003 path="no.uio/CheckPidInVM.action.xml"/>
+        <id-99544f0f-9ebe-4032-a611-2886d2387e14 path="com.vmware.library.microsoft.activeDirectory/setUserEnable.action.xml"/>
+        <id-9989df5b-6787-4aaf-ad59-1481a29375dd path="com.vmware.library.vc.vm.spec.config.device/getVirtualE1000.action.xml"/>
+        <id-9aeae868-7645-4839-a53d-071f57300e2e path="com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettings.action.xml"/>
+        <id-a12e3fb9-94f1-4c99-9e3b-709e44a639cc path="com.vmware.library.vc.vm.spec/getRelocateSpec.action.xml"/>
+        <id-a13e6055-0e74-40b4-acd0-57ad9f946d3c path="com.vmware.library.vc.vm/changeVMvCPU.action.xml"/>
+        <id-a3739b91-83f6-4688-8e66-135bdc8ff332 path="com.vmware.library.vc.vm.spec.config.device/getVirtualSriovEthernetCard.action.xml"/>
+        <id-a5bffcea-58d8-4b12-b40e-0e3f15dee82d path="com.vmware.library.vc.basic/WaitTaskEndOrVMQuestion.action.xml"/>
+        <id-a6ec564a-c18b-4b40-abc1-4270d7fd4a4d path="no.uio/createVirtualEthernetCardDvNetworkConfigSpec.action.xml"/>
+        <id-a9e966ff-d1f6-42a0-8949-785216c01922 path="com.vmware.library.vc.resourcePool/getAllChildResourcePool.action.xml"/>
+        <id-ab9f91c2-4a4b-4b7c-b7b1-aca3b32ff087 path="com.vmware.library.vc.networking/getVirtualEthernetCardDvPortgroupBackingInfo.action.xml"/>
+        <id-b37d567e-4fc0-45c4-8211-b7176025dc8e path="com.vmware.library.vc.vm/getAllVMsMatchingRegexp.action.xml"/>
+        <id-b542b6a6-84ea-4222-a9a8-547a3aab8efe path="com.vmware.library.vc.vm.spec.identity/getCustomizationIdentificationFromCredential.action.xml"/>
+        <id-b91481c1-f5e9-4e99-8bdf-daaf77bf4ea0 path="com.vmware.library.vc.vm.spec.config.device/getVirtualDevice.action.xml"/>
+        <id-c0ff93ed-4d78-4d28-a2e9-b165098b0862 path="com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet2.action.xml"/>
+        <id-c6c94b25-55fa-4d47-9d2b-97292fdcfe57 path="com.vmware.pso.cryptojs/base64Encode.action.xml"/>
+        <id-c968b77a-b583-4a43-bcbc-4452e5a84b8f path="com.vmware.library.vc.datastore/getAllDatastoreOnVimHost.action.xml"/>
+        <id-ccf4a83a-1893-4c73-b22f-5cae1b26346e path="com.vmware.library.vc.network/getNetworksForVimHost.action.xml"/>
+        <id-cf810eef-158a-49bd-8ee9-7f9616b7519b path="com.vmware.library.vc.vm.power/shutdownVM.action.xml"/>
+        <id-d16d3729-a26c-453d-9819-2f82c9f0a368 path="com.vmware.library.vc.vm.power/startVM.action.xml"/>
+        <id-e0a4d65f-1ebb-49df-b5db-a599a1909bf2 path="com.vmware.library.vc.datastore/getAllDatastores.action.xml"/>
+        <id-edaf362c-ac98-48ad-89fb-7875b052489e path="com.vmware.library.vc.vm.spec.nic/getCustomizationFixedIp.action.xml"/>
+        <id-f6adc44f-0be3-44ca-abe6-dd06e84b3223 path="com.vmware.library.vc.vm.spec/getCustomizationGlobalIPSettingsWithDomainAsString.action.xml"/>
+        <id-fe1c822f-9003-47b9-a675-9075cf569fdd path="com.vmware.library.vc.vm.spec.config.device.backing.device/getVirtualEthernetCardNetworkBackingInfo.action.xml"/>
+        <id-feb34f2d-6779-42cb-ae27-0d5c8f3ef51a path="com.vmware.library.vc.vm.spec.nic/getCustomizationDhcpIpGenerator.action.xml"/>
+    </actions>
+    <configurations/>
+    <resources>
+        <id-3938885e-2198-4f6d-a87b-6e65f3cb4a57 path="Library/Configuration/_Icons/troubleshooting.gif">
+            <name>troubleshooting.gif</name>
+            <description>Troubleshooting icon</description>
+            <mimetype>image/gif</mimetype>
+            <permissions>fv</permissions>
+            <version>1.0.0</version>
+        </id-3938885e-2198-4f6d-a87b-6e65f3cb4a57>
+        <id-419c9a2c-8915-4c26-8b59-fbb5931eb502 path="ikoner/cerebrum.png">
+            <name>cerebrum.png</name>
+            <description>Imported from : '/uio/kant/usit-gid-u1/ragnahon/Downloads/cerebrum.png' on server orchestrator01.uio.no:8281</description>
+            <mimetype>image/png</mimetype>
+            <permissions>fve</permissions>
+            <version>1.0.0</version>
+        </id-419c9a2c-8915-4c26-8b59-fbb5931eb502>
+        <id-93015d83-b1ba-42d0-9b3c-bb3ebb862beb path="Library/Configuration/_Icons/certificate.gif">
+            <name>certificate.gif</name>
+            <description>Certificate icon</description>
+            <mimetype>image/gif</mimetype>
+            <permissions>fv</permissions>
+            <version>1.0.0</version>
+        </id-93015d83-b1ba-42d0-9b3c-bb3ebb862beb>
+        <id-ccc63028-0b79-48ad-bf8d-4078a2d058ce path="Library/Configuration/_Icons/server.gif">
+            <name>server.gif</name>
+            <description>Server icon</description>
+            <mimetype>image/gif</mimetype>
+            <permissions>fv</permissions>
+            <version>1.0.0</version>
+        </id-ccc63028-0b79-48ad-bf8d-4078a2d058ce>
+        <id-e7418220-002f-4135-a5de-2875150c1cdb path="ikoner/cfengine.jpeg">
+            <name>cfengine.jpeg</name>
+            <description>Imported from : '/uio/kant/usit-gid-u1/ragnahon/Downloads/p/cfengine.jpeg' on server orchestrator01.uio.no:8281</description>
+            <mimetype>image/jpeg</mimetype>
+            <permissions>fve</permissions>
+            <version>1.0.0</version>
+        </id-e7418220-002f-4135-a5de-2875150c1cdb>
+    </resources>
+</package>
diff --git a/vFLOWER/content/Resources/Library/Configuration/_Icons/certificate.gif b/vFLOWER/content/Resources/Library/Configuration/_Icons/certificate.gif
new file mode 100644 (file)
index 0000000..85c77fc
Binary files /dev/null and b/vFLOWER/content/Resources/Library/Configuration/_Icons/certificate.gif differ
diff --git a/vFLOWER/content/Resources/Library/Configuration/_Icons/server.gif b/vFLOWER/content/Resources/Library/Configuration/_Icons/server.gif
new file mode 100644 (file)
index 0000000..f9260ba
Binary files /dev/null and b/vFLOWER/content/Resources/Library/Configuration/_Icons/server.gif differ
diff --git a/vFLOWER/content/Resources/Library/Configuration/_Icons/troubleshooting.gif b/vFLOWER/content/Resources/Library/Configuration/_Icons/troubleshooting.gif
new file mode 100644 (file)
index 0000000..3f16d2b
Binary files /dev/null and b/vFLOWER/content/Resources/Library/Configuration/_Icons/troubleshooting.gif differ
diff --git a/vFLOWER/content/Resources/ikoner/cerebrum.png b/vFLOWER/content/Resources/ikoner/cerebrum.png
new file mode 100644 (file)
index 0000000..7dbb09c
Binary files /dev/null and b/vFLOWER/content/Resources/ikoner/cerebrum.png differ
diff --git a/vFLOWER/content/Resources/ikoner/cfengine.jpeg b/vFLOWER/content/Resources/ikoner/cfengine.jpeg
new file mode 100644 (file)
index 0000000..9dfb17e
Binary files /dev/null and b/vFLOWER/content/Resources/ikoner/cfengine.jpeg differ
diff --git a/vFLOWER/content/Workflows/Library/Microsoft/Active Directory/User/Disable a user.workflow.xml b/vFLOWER/content/Workflows/Library/Microsoft/Active Directory/User/Disable a user.workflow.xml
new file mode 100644 (file)
index 0000000..6a2cd69
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="Workflow:name=generic" id="958080808080808080808080808080803381808001175609873343b6bbd2e3eea" version="1.1.1" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Disable a user</display-name>
+
+    <description>Disables a user from an Active Directory instance.</description>
+    <ref-types>(AD:User)</ref-types>
+
+    <position x="180.0" y="20.0"/>
+
+    <input>
+        <param name="user" type="AD:User">
+            <description>User to disable</description>
+        </param>
+    </input>
+
+    <attrib name="enable" type="boolean" read-only="false">
+        <value encoded="n">false</value>
+    </attrib>
+
+    <workflow-item name="item2" type="end" end-mode="0">
+        <position x="180.0" y="150.0"/>
+    </workflow-item>
+
+    <workflow-item name="item0" out-name="item2" type="task" script-module="com.vmware.library.microsoft.activeDirectory/setUserEnable">
+        <display-name>setUserEnable</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+System.getModule("com.vmware.library.microsoft.activeDirectory").setUserEnable(user,enable) ;
+        </script>
+
+        <in-binding>
+            <bind name="enable" type="boolean" export-name="enable">
+                <description>Enable or disable?</description>
+            </bind>
+            <bind name="user" type="AD:User" export-name="user">
+                <description>User to enable or disable</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>Allows to enable or disable a user in the Active Directory.</description>
+
+        <position x="140.0" y="100.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="user">
+            <desc>User to disable</desc>
+            <p-qual name="show-select-as" type="string">live-search</p-qual>
+            <p-qual name="contextualParameter" type="void"/>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/Microsoft/Active Directory/User/Enable a user.workflow.xml b/vFLOWER/content/Workflows/Library/Microsoft/Active Directory/User/Enable a user.workflow.xml
new file mode 100644 (file)
index 0000000..838b470
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="Workflow:name=generic" id="958080808080808080808080808080803881808001175609873343b6bbd2e3eea" version="1.1.1" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Enable a user</display-name>
+
+    <description>Enables a user in an Active Directory instance.</description>
+    <ref-types>(AD:User)</ref-types>
+
+    <position x="180.0" y="20.0"/>
+
+    <input>
+        <param name="user" type="AD:User">
+            <description>User to enable</description>
+        </param>
+    </input>
+
+    <attrib name="enable" type="boolean" read-only="false">
+        <value encoded="n">true</value>
+    </attrib>
+
+    <workflow-item name="item2" type="end" end-mode="0">
+        <position x="180.0" y="170.0"/>
+    </workflow-item>
+
+    <workflow-item name="item0" out-name="item2" type="task" script-module="com.vmware.library.microsoft.activeDirectory/setUserEnable">
+        <display-name>setUserEnable</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+System.getModule("com.vmware.library.microsoft.activeDirectory").setUserEnable(user,enable) ;
+        </script>
+
+        <in-binding>
+            <bind name="enable" type="boolean" export-name="enable">
+                <description>Enable or disable?</description>
+            </bind>
+            <bind name="user" type="AD:User" export-name="user">
+                <description>User to enable or disable</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>Allows to enable or disable a user in the Active Directory.</description>
+
+        <position x="140.0" y="100.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="user">
+            <desc>User to enable</desc>
+            <p-qual name="show-select-as">live-search</p-qual>
+            <p-qual name="contextualParameter"/>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/SQL/Execute a custom query on a database.workflow.xml b/vFLOWER/content/Workflows/Library/SQL/Execute a custom query on a database.workflow.xml
new file mode 100644 (file)
index 0000000..7a546d6
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="workflow:name=generic" id="028080808080808080808080808080809F808080013264596926189e8150e1493" version="0.0.1" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Execute a custom query on a database</display-name>
+
+    <description>Executes a custom query on a specified database and returns the number of affected rows. You can run the workflow to update, delete, and insert queries.</description>
+    <ref-types>(SQL:Database)</ref-types>
+
+    <position x="180.0" y="20.0"/>
+
+    <input>
+        <param name="database" type="SQL:Database">
+            <description>The database to use for the query</description>
+        </param>
+        <param name="query" type="string">
+            <description>The query to execute</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="rowsAffected" type="number">
+            <description>The number of rows affected by the query</description>
+        </param>
+    </output>
+
+    <attrib name="errorCode" type="string" read-only="false">
+        <value encoded="n"/>
+    </attrib>
+
+    <workflow-item name="item0" out-name="item1" catch-name="item2" throw-bind-name="errorCode" type="task">
+        <display-name>Execute query</display-name>
+
+        <script encoded="false">
+System.log("Executing query " + query + " on database " + database.name );
+rowsAffected = database.executeCustomQuery(query);
+System.log("Rows affected: "+ rowsAffected);
+        </script>
+
+        <in-binding>
+            <bind name="database" type="SQL:Database" export-name="database"/>
+            <bind name="query" type="string" export-name="query"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="errorCode" type="string" export-name="errorCode"/>
+            <bind name="rowsAffected" type="number" export-name="rowsAffected"/>
+        </out-binding>
+
+        <position x="140.0" y="100.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" type="end" end-mode="0">
+        <position x="180.0" y="170.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" throw-bind-name="errorCode" type="end" end-mode="1">
+        <position x="320.0" y="90.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-step>
+            <title>Execute a custom query on a database</title>
+            <p-group>
+                <title>Database</title>
+                <desc>Select a database and specify a query.</desc>
+                <p-param name="database">
+                    <desc>Database</desc>
+                    <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+                    <p-qual name="contextualParameter" type="void">__NULL__</p-qual>
+                </p-param>
+                <p-param name="query">
+                    <desc>Query</desc>
+                    <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+                </p-param>
+            </p-group>
+        </p-step>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/SQL/Read a custom query from a database.workflow.xml b/vFLOWER/content/Workflows/Library/SQL/Read a custom query from a database.workflow.xml
new file mode 100644 (file)
index 0000000..3096102
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="workflow:name=generic" id="048080808080808080808080808080808F808080013264596926189e8150e1493" version="0.0.1" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Read a custom query from a database</display-name>
+
+    <description>Executes a custom query on a specified database and returns the result in an array of ActiveRecord objects. You can run the workflow to select queries.</description>
+    <ref-types>(SQL:Database)</ref-types>
+
+    <position x="180.0" y="20.0"/>
+
+    <input>
+        <param name="database" type="SQL:Database">
+            <description>The database to use for the query</description>
+        </param>
+        <param name="query" type="string">
+            <description>The query to execute</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="resultRecords" type="Array/SQL:ActiveRecord">
+            <description>An array of ActiveRecord objects corresponding to the query.</description>
+        </param>
+    </output>
+
+    <attrib name="errorCode" type="string" read-only="false">
+        <value encoded="n"/>
+    </attrib>
+
+    <workflow-item name="item0" out-name="item1" catch-name="item2" throw-bind-name="errorCode" type="task">
+        <display-name>Execute query</display-name>
+
+        <script encoded="false">
+System.log("Executing query " + query + " on database " + database.name );
+resultRecords = database.readCustomQuery(query);
+        </script>
+
+        <in-binding>
+            <bind name="database" type="SQL:Database" export-name="database"/>
+            <bind name="query" type="string" export-name="query"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="resultRecords" type="Array/SQL:ActiveRecord" export-name="resultRecords"/>
+        </out-binding>
+
+        <position x="140.0" y="100.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" type="end" end-mode="0">
+        <position x="180.0" y="170.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" throw-bind-name="errorCode" type="end" end-mode="1">
+        <position x="320.0" y="90.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-step>
+            <title>Read a custom query from a database</title>
+            <p-group>
+                <title>Database</title>
+                <desc>Select a database and specify a query.</desc>
+                <p-param name="database">
+                    <desc>Database</desc>
+                    <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+                    <p-qual name="contextualParameter" type="void">__NULL__</p-qual>
+                </p-param>
+                <p-param name="query">
+                    <desc>Query</desc>
+                    <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+                </p-param>
+            </p-group>
+        </p-step>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/SSH/Run SSH command.workflow.xml b/vFLOWER/content/Workflows/Library/SSH/Run SSH command.workflow.xml
new file mode 100644 (file)
index 0000000..2fef9c6
--- /dev/null
@@ -0,0 +1,296 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item6" object-name="Workflow:name=generic" id="90808080808080808080808080808080D28080800120523434428525559a3425f" version="0.0.3" api-version="3.1.0" allowed-operations="fve" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Run SSH command</display-name>
+
+    <description>Runs an SSH command.</description>
+
+    <position x="160.0" y="10.0"/>
+
+    <input>
+        <param name="hostNameOrIP" type="string">
+            <description>Hostname or IP address of the SSH host</description>
+        </param>
+        <param name="username" type="string">
+            <description>Username</description>
+        </param>
+        <param name="password" type="SecureString">
+            <description>Password</description>
+        </param>
+        <param name="cmd" type="string">
+            <description>The SSH command to run</description>
+        </param>
+        <param name="passwordAuthentication" type="boolean">
+            <description>Sets authentication to password or key file</description>
+        </param>
+        <param name="path" type="Path">
+            <description>Path to the private key</description>
+        </param>
+        <param name="passphrase" type="SecureString">
+            <description>Private key pass-phrase</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="result" type="number">
+            <description>0 = OK, Negative = Error, Positive = Number of values returned, after error text</description>
+        </param>
+        <param name="errorText" type="string">
+            <description>Error text, if any</description>
+        </param>
+        <param name="outputText" type="string">
+            <description>Result of running the SSH command</description>
+        </param>
+    </output>
+
+    <attrib name="output" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Standard output</description>
+    </attrib>
+    <attrib name="error" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Error output</description>
+    </attrib>
+    <attrib name="defaultKeyPairPath" type="Path" read-only="false">
+        <value encoded="n">../conf/vco_key</value>
+        <description>Default path to the key file</description>
+    </attrib>
+    <attrib name="exitCode" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Returns 0 if successful, and a negative value if there is a failure</description>
+    </attrib>
+    <attrib name="logText" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Log String</description>
+    </attrib>
+
+    <workflow-item name="item3" out-name="item2" type="condition" alt-out-name="item4" comparator="0">
+        <display-name>ok?</display-name>
+
+        <script encoded="false">
+//Generated by the system, cannot be edited
+return (error == "null") ;
+        </script>
+
+        <in-binding>
+            <bind name="error" type="string" export-name="error"/>
+        </in-binding>
+        <condition name="error" type="string" comparator="0" label="null"/>
+
+        <position x="120.0" y="170.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" out-name="item5" content-mode="y" type="task">
+        <display-name>System+Server log</display-name>
+
+        <script encoded="false">
+//Auto-generated script
+System.log(text + " - " + object);
+Server.log(text, object);
+        </script>
+
+        <in-binding>
+            <bind name="text" type="String" export-name="cmd">
+                <description>The text to log</description>
+            </bind>
+            <bind name="object" type="string" export-name="logText">
+                <description>The text to log and additional info</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>Log the input text to the console and the server log with level 'log'</description>
+
+        <position x="40.0" y="240.0"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item5" content-mode="y" type="task">
+        <display-name>System+Server error</display-name>
+
+        <script encoded="false">
+//Auto-generated script
+System.error(text + " - " + object);
+Server.error(text, object);
+        </script>
+
+        <in-binding>
+            <bind name="text" type="String" export-name="cmd">
+                <description>The text to log</description>
+            </bind>
+            <bind name="object" type="string" export-name="logText">
+                <description>The text to log and additional info</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>Log the input text to the console and the server log with level 'error'</description>
+
+        <position x="200.0" y="240.0"/>
+    </workflow-item>
+
+    <workflow-item name="item5" out-name="item8" type="task">
+        <display-name>Assign</display-name>
+
+        <script encoded="false">
+outputText = output;
+errorText = error;
+if(error == ""){
+       result = 1;
+} else {
+       result = -1;
+       throw "SSH execute command failed. " + error;
+}
+        </script>
+
+        <in-binding>
+            <bind name="output" type="string" export-name="output"/>
+            <bind name="error" type="string" export-name="error"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="result" type="number" export-name="result"/>
+            <bind name="outputText" type="string" export-name="outputText"/>
+            <bind name="errorText" type="string" export-name="errorText"/>
+        </out-binding>
+
+        <position x="120.0" y="280.0"/>
+    </workflow-item>
+
+    <workflow-item name="item6" out-name="item9" type="task">
+        <display-name>Execute SSH Command</display-name>
+
+        <script encoded="false">
+try{
+       var session = new SSHSession(hostName,username);
+       
+       if(passwordAuthentication){
+               System.log("Connecting with password");
+       } else {
+               if(path == null || path == ""){
+                       System.log("using default");
+                       path = defaultKeyPairPath;
+               }
+               System.log("Connecting with key pair ("+path+")");
+               password = passphrase;
+       }
+
+       session.connectWithPasswordOrIdentity(passwordAuthentication,password,path);
+       System.log("Connected!");
+       
+       System.log("Executing '"+cmd+"'");
+       session.executeCommand(cmd,true) ;
+       
+       output = session.getOutput();
+       error = session.getError();
+       exitCode = session.exitCode;
+       
+       System.log("Output: '"+output+"'");
+       System.log("Error: '"+error+"'");
+       System.log("Exit code: '"+exitCode+"'");
+       
+       session.disconnect();
+       
+} catch (e) {
+       throw "Unable to execute command " + e;
+}
+        </script>
+
+        <in-binding>
+            <bind name="username" type="string" export-name="username"/>
+            <bind name="password" type="SecureString" export-name="password"/>
+            <bind name="cmd" type="string" export-name="cmd"/>
+            <bind name="passwordAuthentication" type="boolean" export-name="passwordAuthentication"/>
+            <bind name="path" type="Path" export-name="path"/>
+            <bind name="hostName" type="string" export-name="hostNameOrIP"/>
+            <bind name="passphrase" type="SecureString" export-name="passphrase"/>
+            <bind name="defaultKeyPairPath" type="Path" export-name="defaultKeyPairPath"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="output" type="string" export-name="output"/>
+            <bind name="error" type="string" export-name="error"/>
+            <bind name="exitCode" type="string" export-name="exitCode"/>
+        </out-binding>
+
+        <position x="120.0" y="60.0"/>
+    </workflow-item>
+
+    <workflow-item name="item8" type="end" end-mode="0">
+        <position x="160.0" y="310.0"/>
+    </workflow-item>
+
+    <workflow-item name="item9" out-name="item3" type="task">
+        <display-name>Prepare for log</display-name>
+
+        <script encoded="false">
+logText = "output: " + output + "\n" + "error: " + error;
+        </script>
+
+        <in-binding>
+            <bind name="output" type="string" export-name="output"/>
+            <bind name="error" type="string" export-name="error"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="logText" type="string" export-name="logText"/>
+        </out-binding>
+
+        <position x="120.0" y="120.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-step>
+            <title>Host</title>
+            <p-group>
+                <title>Host selection</title>
+                <desc>Select if you want ot choose host from a list or enter a name or IP address</desc>
+                <p-param name="hostNameOrIP">
+                    <desc>Host name or IP  of the SSH host</desc>
+                    <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+                </p-param>
+            </p-group>
+            <p-group>
+                <title>Command</title>
+                <desc>The command to execute</desc>
+                <p-param name="cmd">
+                    <desc>The SSH command to run</desc>
+                    <p-qual name="defaultValue" type="string">uptime</p-qual>
+                </p-param>
+            </p-group>
+            <p-group>
+                <title>Authentication</title>
+                <p-param name="passwordAuthentication">
+                    <desc>Do you want to use password authentication? If you click No, key file authentication will be used.</desc>
+                </p-param>
+            </p-group>
+        </p-step>
+        <p-step>
+            <title>Authentication</title>
+            <p-group>
+                <title>Host</title>
+                <desc>Enter connection info for host to execute the command on</desc>
+                <p-param name="username">
+                    <desc>Username</desc>
+                </p-param>
+            </p-group>
+            <p-group>
+                <title>Authentication</title>
+                <desc>If authentication method is password enter the password, otherwise enter the path for the key pair and passphrase for the private key</desc>
+                <p-param name="password">
+                    <desc>Password</desc>
+                    <p-qual name="visible">passwordAuthentication/passwordAuthentication</p-qual>
+                </p-param>
+                <p-param name="path">
+                    <desc>Path to private key</desc>
+                    <p-qual name="notVisible">passwordAuthentication/passwordAuthentication</p-qual>
+                    <p-qual kind="ognl" name="defaultValue" type="Path">#defaultKeyPairPath</p-qual>
+                </p-param>
+                <p-param name="passphrase">
+                    <desc>Private key pass-phrase</desc>
+                    <p-qual name="notVisible">passwordAuthentication/passwordAuthentication</p-qual>
+                </p-param>
+            </p-group>
+        </p-step>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/Tagging/Tag workflow.workflow.xml b/vFLOWER/content/Workflows/Library/Tagging/Tag workflow.workflow.xml
new file mode 100644 (file)
index 0000000..2bd76e5
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="0ef918a9-8fc7-4efd-b556-59a32f96bae5" version="0.0.1" api-version="3.1.0" allowed-operations="fve" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Tag workflow</display-name>
+
+    <description>Assigns a tag to a workflow. You must specify the workflow you want to tag and the tag name and value.</description>
+
+    <position x="100.0" y="50.0"/>
+
+    <input>
+        <param name="taggedWorkflow" type="Workflow">
+            <description>Tagged object</description>
+        </param>
+        <param name="tagName" type="string">
+            <description>Tag name</description>
+        </param>
+        <param name="tagValue" type="string">
+            <description>Tag value</description>
+        </param>
+        <param name="isGlobal" type="boolean">
+            <description>Create global or private tag</description>
+        </param>
+    </input>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="384.5" y="45.40909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item0" type="task">
+        <display-name>Scriptable task</display-name>
+
+        <script encoded="false">
+if ( isGlobal ) {
+  Server.tagGlobally(taggedObject, tagName, tagValue );
+} else {
+  Server.tag(taggedObject, tagName, tagValue );
+}
+System.log("Tag created : " + tagName + " = " + tagValue);
+        </script>
+
+        <in-binding>
+            <bind name="taggedObject" type="Workflow" export-name="taggedWorkflow"/>
+            <bind name="isGlobal" type="boolean" export-name="isGlobal"/>
+            <bind name="tagName" type="string" export-name="tagName"/>
+            <bind name="tagValue" type="string" export-name="tagValue"/>
+        </in-binding>
+
+        <out-binding/>
+
+        <position x="204.5" y="55.40909090909091"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="taggedWorkflow">
+            <desc>Tagged workfow</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="tagName">
+            <desc>Tag</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="tagValue">
+            <desc>Value</desc>
+        </p-param>
+        <p-param name="isGlobal">
+            <desc>Global tag</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/Tagging/Untag workflow.workflow.xml b/vFLOWER/content/Workflows/Library/Tagging/Untag workflow.workflow.xml
new file mode 100644 (file)
index 0000000..e0c4f0a
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="5a067901-2ced-47ef-8973-ea49ceb60d5d" version="0.0.2" api-version="3.1.0" allowed-operations="fve" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Untag workflow</display-name>
+
+    <description>Removes a tag from a workflow. You must specify the workflow you want to untag and the tag you want to remove from the specified workflow.</description>
+
+    <position x="100.0" y="50.0"/>
+
+    <input>
+        <param name="taggedObject" type="Workflow">
+            <description>Workflow to untag</description>
+        </param>
+        <param name="tagName" type="string">
+            <description>Tag name</description>
+        </param>
+        <param name="isGlobal" type="boolean">
+            <description>Is global tag</description>
+        </param>
+    </input>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="384.5" y="45.40909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item0" type="task">
+        <display-name>Untag object</display-name>
+
+        <script encoded="false">
+try { 
+    var        tags = new Array(tagName);
+       if ( isGlobal ) {
+         Server.untagGlobally(taggedObject,  tags);
+       } else {
+         Server.untag(taggedObject, tags);
+       }
+} catch (e) {
+  System.error(e);
+}
+        </script>
+
+        <in-binding>
+            <bind name="taggedObject" type="Workflow" export-name="taggedObject"/>
+            <bind name="isGlobal" type="boolean" export-name="isGlobal"/>
+            <bind name="tagName" type="string" export-name="tagName"/>
+        </in-binding>
+
+        <out-binding/>
+
+        <position x="204.5" y="55.40909090909091"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="taggedObject">
+            <desc>Workflow to untag</desc>
+        </p-param>
+        <p-param name="tagName">
+            <desc>Tag to remove</desc>
+        </p-param>
+        <p-param name="isGlobal">
+            <desc>Global tag</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/Check for file in guest.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/Check for file in guest.workflow.xml
new file mode 100644 (file)
index 0000000..5b4a8c3
--- /dev/null
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item4" object-name="workflow:name=generic" id="C3808080808080808080808080808080AA80808001322751030482b80adf61e7c" version="0.0.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Check for file in guest</display-name>
+
+    <description>
+Checks to see if a directory exists in a guest VM.
+Output parameter result is a boolean.
+    </description>
+
+    <position x="100.0" y="50.0"/>
+
+    <input>
+        <param name="vmUsername" type="string">
+            <description>Username for the virtual machine</description>
+        </param>
+        <param name="vmPassword" type="SecureString">
+            <description>Password for the virtual machine</description>
+        </param>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine</description>
+        </param>
+        <param name="path" type="string">
+            <description>Path in virtual machine to check</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="exists" type="boolean">
+            <description>True if directory exists.</description>
+        </param>
+    </output>
+
+    <attrib name="resultLimit" type="number" read-only="false">
+        <value encoded="n">1.0</value>
+        <description>Result list maximum entries.</description>
+    </attrib>
+    <attrib name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Array of file info objects (path, type, size).</description>
+    </attrib>
+    <attrib name="errorCode" type="string" read-only="false">
+        <value encoded="n"/>
+    </attrib>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="664.5" y="45.40909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item2" out-name="item0" type="task">
+        <display-name>set result</display-name>
+
+        <script encoded="false">
+exists = false;
+for (var i in result) {
+       var f = result[i];
+       System.log("&gt;" + f.path + "&lt;");
+       System.log("&gt;" + path + "&lt;");
+       System.log(f.path + " : " + f.type + " p:" + (f.path == path) + " f:" + (f.type == "file"));
+       if (f.path == path &amp;&amp; f.type == "file") {
+               exists = true;
+               break;
+       }
+}
+        </script>
+
+        <in-binding>
+            <bind name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType" export-name="result"/>
+            <bind name="path" type="string" export-name="path"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="exists" type="boolean" export-name="exists"/>
+        </out-binding>
+
+        <position x="484.5" y="9.954545454545453"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item0" type="task">
+        <display-name>process error</display-name>
+
+        <script encoded="false">
+if (!/File .+ was not found.+/.test(errorCode)) {
+       throw errorCode;
+}
+exists = false;
+        </script>
+
+        <in-binding>
+            <bind name="errorCode" type="string" export-name="errorCode"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="exists" type="boolean" export-name="exists"/>
+        </out-binding>
+
+        <position x="484.5" y="55.40909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item2" catch-name="item3" throw-bind-name="errorCode" type="link" linked-workflow-id="C28080808080808080808080808080808180808001322751030482b80adf61e7c">
+        <display-name>List path in guest</display-name>
+
+        <in-binding>
+            <bind name="vmUsername" type="string" export-name="vmUsername">
+                <description>Username for the virtual machine</description>
+            </bind>
+            <bind name="vmPassword" type="SecureString" export-name="vmPassword">
+                <description>Password for the virtual machine</description>
+            </bind>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm">
+                <description>Virtual machine</description>
+            </bind>
+            <bind name="path" type="string" export-name="path">
+                <description>Path in virtual machine to check</description>
+            </bind>
+            <bind name="resultLimit" type="number" export-name="resultLimit">
+                <description>Result list maximum entries.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType" export-name="result">
+                <description>Array of file info objects (path, type, size).</description>
+            </bind>
+        </out-binding>
+
+        <description>List path in a guest VM. Output parameter result is list of files and/or directories or throws if path does not exists.</description>
+
+        <position x="204.5" y="55.40909090909091"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="vmUsername">
+            <desc>Username for the virtual machine</desc>
+        </p-param>
+        <p-param name="vmPassword">
+            <desc>Password for the virtual machine</desc>
+        </p-param>
+        <p-param name="vm">
+            <desc>Virtual machine</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="path">
+            <desc>Path in virtual machine to check</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/Create directory in guest.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/Create directory in guest.workflow.xml
new file mode 100644 (file)
index 0000000..0573271
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="C88080808080808080808080808080809880808001322751030482b80adf61e7c" version="0.0.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Create directory in guest</display-name>
+
+    <description>Create a directory in a guest virtual machine.</description>
+
+    <position x="100.0" y="50.0"/>
+
+    <input>
+        <param name="vmUsername" type="string">
+            <description>Username for the virtual machine</description>
+        </param>
+        <param name="vmPassword" type="SecureString">
+            <description>Password for the virtual machine</description>
+        </param>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine</description>
+        </param>
+        <param name="dirPath" type="string">
+            <description>Guest path</description>
+        </param>
+        <param name="createParents" type="boolean">
+            <description>Create parent directories if missing</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="result" type="boolean">
+            <description>Set to true if directory was created successfully</description>
+        </param>
+    </output>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="385.0" y="45.90909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item0" type="task">
+        <display-name>Scriptable task</display-name>
+
+        <script encoded="false">
+var host = vm.sdkConnection;
+
+var guestOperationsManager = host.guestOperationsManager;
+var guestAuth = new VcNamePasswordAuthentication();
+guestAuth.username = vmUsername;
+guestAuth.password = vmPassword;
+
+var fileManager = guestOperationsManager.fileManager;
+result = false;
+fileManager.makeDirectoryInGuest(vm , guestAuth , dirPath, createParents);
+result = true;
+        </script>
+
+        <in-binding>
+            <bind name="vmUsername" type="string" export-name="vmUsername"/>
+            <bind name="vmPassword" type="SecureString" export-name="vmPassword"/>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="dirPath" type="string" export-name="dirPath"/>
+            <bind name="createParents" type="boolean" export-name="createParents"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="result" type="boolean" export-name="result"/>
+        </out-binding>
+
+        <position x="205.0" y="55.90909090909091"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="vmUsername">
+            <desc>Username for the virtual machine</desc>
+        </p-param>
+        <p-param name="vmPassword">
+            <desc>Password for the virtual machine</desc>
+        </p-param>
+        <p-param name="vm">
+            <desc>Virtual machine</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="dirPath">
+            <desc>Guest path</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="createParents">
+            <desc>Create parent directories if missing</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/List path in guest.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Files/List path in guest.workflow.xml
new file mode 100644 (file)
index 0000000..eb8e33b
--- /dev/null
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="C28080808080808080808080808080808180808001322751030482b80adf61e7c" version="0.0.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>List path in guest</display-name>
+
+    <description>List path in a guest VM. Output parameter result is list of files and/or directories or throws if path does not exists.</description>
+
+    <position x="100.0" y="50.0"/>
+
+    <input>
+        <param name="vmUsername" type="string">
+            <description>Username for the virtual machine</description>
+        </param>
+        <param name="vmPassword" type="SecureString">
+            <description>Password for the virtual machine</description>
+        </param>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine</description>
+        </param>
+        <param name="path" type="string">
+            <description>Path in virtual machine to check</description>
+        </param>
+        <param name="resultLimit" type="number">
+            <description>Result list maximum entries.</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType">
+            <description>Array of file info objects (path, type, size).</description>
+        </param>
+    </output>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="384.5" y="45.40909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item0" type="task">
+        <display-name>Scriptable task</display-name>
+
+        <script encoded="false">
+var host = vm.sdkConnection;
+
+var guestOperationsManager = host.guestOperationsManager;
+var guestAuth = new VcNamePasswordAuthentication();
+guestAuth.username = vmUsername;
+guestAuth.password = vmPassword;
+
+var guestListFileInfo = guestOperationsManager.fileManager.listFilesInGuest(vm , guestAuth ,
+                                                                                                                                                path , 0 , resultLimit , ".*");
+result = new Array();
+for (var f in guestListFileInfo.files) {
+       var file = guestListFileInfo.files[f];
+       var jsObj = { path: file.path, type: file.type, size: file.size};
+       result.push(jsObj);
+}
+        </script>
+
+        <in-binding>
+            <bind name="vmUsername" type="string" export-name="vmUsername"/>
+            <bind name="vmPassword" type="SecureString" export-name="vmPassword"/>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="path" type="string" export-name="path"/>
+            <bind name="resultLimit" type="number" export-name="resultLimit"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="result" type="Array/CompositeType(path:string,type:string,size:number):VcGuestFileInfoType" export-name="result"/>
+        </out-binding>
+
+        <position x="204.5" y="55.40909090909091"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="vmUsername">
+            <desc>Username for the virtual machine</desc>
+        </p-param>
+        <p-param name="vmPassword">
+            <desc>Password for the virtual machine</desc>
+        </p-param>
+        <p-param name="vm">
+            <desc>Virtual machine</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="path">
+            <desc>Path in virtual machine to check</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="resultLimit">
+            <desc>Result list maximum entries.</desc>
+            <p-qual kind="static" name="defaultValue" type="number">10.0</p-qual>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Processes/Run program in guest.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Guest operations/Processes/Run program in guest.workflow.xml
new file mode 100644 (file)
index 0000000..81ac8df
--- /dev/null
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="workflow:name=generic" id="C98080808080808080808080808080805E80808001322751030482b80adf61e7c" version="0.0.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Run program in guest</display-name>
+
+    <description>
+Starts a program in the guest operating system.
+A process started this way can have its status queried with this API. When the process completes, its exit code and end time will be available for 5 minutes after completion.
+    </description>
+
+    <position x="100.0" y="50.0"/>
+
+    <input>
+        <param name="vmUsername" type="string">
+            <description>Username for the virtual machine</description>
+        </param>
+        <param name="vmPassword" type="SecureString">
+            <description>Password for the virtual machine</description>
+        </param>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine</description>
+        </param>
+        <param name="interactiveSession" type="boolean">
+            <description>This is set to true if the client wants an interactive session in the guest.</description>
+        </param>
+        <param name="programPath" type="string">
+            <description>The absolute path to the program to start. For Linux guest operating systems, /bin/bash is used to start the program.  For Solaris guest operating systems, /bin/bash is used to start the program if it exists. Otherwise /bin/sh is used. If /bin/sh is used, then the process ID returned will be that of the shell used to start the program, rather than the program itself, due to the differences in how /bin/sh and /bin/bash work. This PID will still be usable for watching the process with this API to find its exit code and elapsed time.</description>
+        </param>
+        <param name="arguments" type="string">
+            <description>The arguments to the program. In Linux and Solaris guest operating systems, the program will be executed by a guest shell. This allows stdio redirection, but may also require that characters which must be escaped to the shell also be escaped on the command line provided. For Windows guest operating systems, prefixing the command with "cmd /c" can provide stdio redirection.</description>
+        </param>
+        <param name="workingDirectory" type="string">
+            <description>The absolute path of the working directory for the program to be run. VMware recommends explicitly setting the working directory for the program to be run. If this value is unset or is an empty string, the behavior depends on the guest operating system. For Linux guest operating systems, if this value is unset or is an empty string, the working directory will be the home directory of the user associated with the guest authentication. For other guest operating systems, if this value is unset, the behavior is unspecified.</description>
+        </param>
+        <param name="environment" type="Array/string">
+            <description>An array of environment variables, specified in the guest OS notation (eg PATH=c:\bin;c:\windows\system32 or LD_LIBRARY_PATH=/usr/lib:/lib), to be set for the program being run. Note that these are not additions to the default environment variables; they define the complete set available to the program. If none are specified the values are guest dependent.</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="result" type="number">
+            <description>The pid of the program started.</description>
+        </param>
+    </output>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="384.5" y="45.40909090909091"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item0" type="task">
+        <display-name>Scriptable task</display-name>
+
+        <script encoded="false">
+var host = vm.sdkConnection;
+
+var guestOperationsManager = host.guestOperationsManager;
+var guestAuth = new VcNamePasswordAuthentication();
+guestAuth.username = vmUsername;
+guestAuth.password = vmPassword;
+guestAuth.interactiveSession = interactiveSession;
+
+var guestProgramSpec = new VcGuestProgramSpec();
+guestProgramSpec.programPath = programPath;
+guestProgramSpec.arguments = arguments;
+guestProgramSpec.workingDirectory = workingDirectory;
+guestProgramSpec.envVariables = environment;
+
+var processManager = guestOperationsManager.processManager;
+result = processManager.startProgramInGuest(vm , guestAuth , guestProgramSpec);
+        </script>
+
+        <in-binding>
+            <bind name="vmUsername" type="string" export-name="vmUsername"/>
+            <bind name="vmPassword" type="SecureString" export-name="vmPassword"/>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="programPath" type="string" export-name="programPath"/>
+            <bind name="arguments" type="string" export-name="arguments"/>
+            <bind name="workingDirectory" type="string" export-name="workingDirectory"/>
+            <bind name="environment" type="Array/string" export-name="environment"/>
+            <bind name="interactiveSession" type="boolean" export-name="interactiveSession"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="result" type="number" export-name="result"/>
+        </out-binding>
+
+        <position x="204.5" y="55.40909090909091"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="vmUsername">
+            <desc>Username for the virtual machine</desc>
+        </p-param>
+        <p-param name="vmPassword">
+            <desc>Password for the virtual machine</desc>
+        </p-param>
+        <p-param name="vm">
+            <desc>Virtual machine</desc>
+            <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+        </p-param>
+        <p-param name="interactiveSession">
+            <desc>Set to 'Yes' if you want an interactive session in the guest.</desc>
+        </p-param>
+        <p-group>
+            <title>Program path</title>
+            <desc>The absolute path to the program to start. For Linux guest operating systems, /bin/bash is used to start the program.  For Solaris guest operating systems, /bin/bash is used to start the program if it exists. Otherwise /bin/sh is used. If /bin/sh is used, then the process ID returned will be that of the shell used to start the program, rather than the program itself, due to the differences in how /bin/sh and /bin/bash work. This PID will still be usable for watching the process with this API to find its exit code and elapsed time.</desc>
+            <p-param name="programPath">
+                <desc>Program path</desc>
+                <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+            </p-param>
+        </p-group>
+        <p-group>
+            <title>Arguments</title>
+            <desc>The arguments to the program. In Linux and Solaris guest operating systems, the program will be executed by a guest shell. This allows stdio redirection, but may also require that characters which must be escaped to the shell also be escaped on the command line provided. For Windows guest operating systems, prefixing the command with "cmd /c" can provide stdio redirection.</desc>
+            <p-param name="arguments">
+                <desc>Arguments</desc>
+            </p-param>
+        </p-group>
+        <p-group>
+            <title>Working directory</title>
+            <desc>The absolute path of the working directory for the program to be run. VMware recommends explicitly setting the working directory for the program to be run. If this value is unset or is an empty string, the behavior depends on the guest operating system. For Linux guest operating systems, if this value is unset or is an empty string, the working directory will be the home directory of the user associated with the guest authentication. For other guest operating systems, if this value is unset, the behavior is unspecified.</desc>
+            <p-param name="workingDirectory">
+                <desc>Working directory</desc>
+            </p-param>
+        </p-group>
+        <p-group>
+            <title>Environment</title>
+            <desc>An array of environment variables, specified in the guest OS notation (eg PATH=c:\bin;c:\windows\system32 or LD_LIBRARY_PATH=/usr/lib:/lib), to be set for the program being run. Note that these are not additions to the default environment variables; they define the complete set available to the program. If none are specified the values are guest dependent.</desc>
+            <p-param name="environment">
+                <desc>Environment</desc>
+            </p-param>
+        </p-group>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Basic/Mark as template.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Basic/Mark as template.workflow.xml
new file mode 100644 (file)
index 0000000..a9c9fff
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="Workflow:name=generic" id="BD80808080808080808080808080808093C380800122528313869552e41805bb1" version="0.2.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Mark as template</display-name>
+
+    <description>
+Converts an existing virtual machine to a template, not allowing it to start. You can use templates to create virtual machines.
+Warning: The workflow may finish before the virtual machine status is refreshed.
+    </description>
+    <ref-types>(VC:VirtualMachine)</ref-types>
+
+    <position x="180.0" y="20.0"/>
+
+    <input>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine to mark as template</description>
+        </param>
+    </input>
+
+    <workflow-item name="item0" out-name="item2" type="task">
+        <display-name>Mark as template</display-name>
+
+        <script encoded="false">
+vm.markAsTemplate();
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+        </in-binding>
+
+        <out-binding/>
+
+        <position x="140.0" y="80.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" type="end" end-mode="0">
+        <position x="180.0" y="130.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="vm">
+            <desc>Virtual machine to mark as template</desc>
+            <p-qual name="mandatory">true</p-qual>
+            <p-qual name="contextualParameter"/>
+            <p-qual name="sdkExpression">#this.isTemplate=="false"</p-qual>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Basic/Wait for task and answer virtual machine question.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Basic/Wait for task and answer virtual machine question.workflow.xml
new file mode 100644 (file)
index 0000000..41c43dc
--- /dev/null
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="Workflow:name=generic" id="B8808080808080808080808080808080C480808001231146624761b79546544c2" version="0.1.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Wait for task and answer virtual machine question</display-name>
+
+    <description>Waits for a vCenter Server task to complete or for the virtual machine to ask a question. If the virtual machine requires an answer, accepts user input and answers the question.</description>
+
+    <position x="180.0" y="10.0"/>
+
+    <input>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine for which the task runs</description>
+        </param>
+        <param name="task" type="VC:Task">
+            <description>Task to await</description>
+        </param>
+    </input>
+
+    <attrib name="questionText" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Text of the question asked by the virtual machine</description>
+    </attrib>
+    <attrib name="questionAnswer" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Selected answer</description>
+    </attrib>
+    <attrib name="questionText2" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Text to prompt user choice</description>
+    </attrib>
+    <attrib name="answerList" type="Array/string" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>List of possible answers</description>
+    </attrib>
+    <attrib name="questionId" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Identifier of the question asked</description>
+    </attrib>
+    <attrib name="choiceList" type="Array/Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>List of answer elements (IDs and texts)</description>
+    </attrib>
+    <attrib name="taskActionResult" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Result of the task to await action</description>
+    </attrib>
+    <attrib name="progress" type="boolean" read-only="false">
+        <value encoded="n">true</value>
+        <description>Log progress while waiting for the task to complete</description>
+    </attrib>
+    <attrib name="pollRate" type="number" read-only="false">
+        <value encoded="n">1.0</value>
+        <description>Polling rate for the task state, in seconds</description>
+    </attrib>
+    <attrib name="timeoutDate" type="Date" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>If not set to null, this input item waits until the specified date and continues the workflow run</description>
+    </attrib>
+    <workflow-note x="500.0" y="50.0" w="360.0" h="260.0">
+        <description>
+VM requires answer
+        </description>
+    </workflow-note>
+
+    <workflow-item name="item2" type="end" end-mode="0">
+        <position x="380.0" y="250.0"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item5" type="input">
+        <display-name>Reply to VM</display-name>
+
+        <in-binding>
+            <bind name="security.group" type="LdapGroup" explicitly-not-bound="true" export-name="NULL">
+                <description>Any user member of this security group will be authorized to answer this 'Input'</description>
+            </bind>
+            <bind name="timeout.date" type="Date" export-name="timeoutDate">
+                <description>If not null, this input item will wait until date and will continue workflow execution.</description>
+            </bind>
+            <bind name="questionText" type="string" export-name="questionText"/>
+            <bind name="questionText2" type="string" export-name="questionText2"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="questionAnswer" type="string" export-name="questionAnswer"/>
+        </out-binding>
+
+        <presentation>
+            <desc>${questionText}</desc>
+            <p-param name="questionAnswer">
+                <desc>
+${questionText2}
+                </desc>
+                <p-qual kind="ognl" name="linkedEnumeration" type="Array/string">#answerList</p-qual>
+                <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+            </p-param>
+        </presentation>
+
+        <position x="540.0" y="140.0"/>
+    </workflow-item>
+
+    <workflow-item name="item5" out-name="item3" type="task">
+        <display-name>Send answer to VM</display-name>
+
+        <script encoded="false">
+// The user has selected a response, now we need to convert it back from the label to the key because the answerVM requires the key 
+var theAnswer;
+for (i in choiceList) {
+       if (choiceList[i].label == questionAnswer){
+               theAnswer = choiceList[i].key;
+               System.log("Answer selected: "  + choiceList[i].key + " (The text the user selected was: " + questionAnswer + ")");
+               break;
+       }
+}
+
+vm.answerVM(questionId , theAnswer);
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="questionAnswer" type="string" export-name="questionAnswer"/>
+            <bind name="questionId" type="string" export-name="questionId"/>
+            <bind name="choiceList" type="Array/Any" export-name="choiceList"/>
+            <bind name="pollRate" type="number" export-name="pollRate"/>
+        </in-binding>
+
+        <out-binding/>
+
+        <position x="540.0" y="200.0"/>
+    </workflow-item>
+
+    <workflow-item name="item6" out-name="item4" type="task">
+        <display-name>Set question text</display-name>
+
+        <script encoded="false">
+// Set text to display in user interaction
+var question = vm.runtime.question;
+
+questionId = question.id;
+
+questionText = question.text;
+questionText2 = "Please choose: " + "\n";
+
+// Set array of valid answers
+choiceList=question.choice.choiceInfo;
+// Set array of texts to display in presentation allowing user to choose response 
+answerList = new Array();      
+for (i in choiceList) {
+       answerList.push(choiceList[i].label);
+}
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="questionText" type="string" export-name="questionText"/>
+            <bind name="questionText2" type="string" export-name="questionText2"/>
+            <bind name="answerList" type="Array/string" export-name="answerList"/>
+            <bind name="questionId" type="string" export-name="questionId"/>
+            <bind name="choiceList" type="Array/Any" export-name="choiceList"/>
+        </out-binding>
+
+        <position x="540.0" y="80.0"/>
+    </workflow-item>
+
+    <workflow-item name="item0" out-name="item1" type="task" script-module="com.vmware.library.vc.basic/WaitTaskEndOrVMQuestion">
+        <display-name>WaitTaskEndOrVMQuestion</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.basic").WaitTaskEndOrVMQuestion(task,progress,pollRate,vm) ;
+        </script>
+
+        <in-binding>
+            <bind name="task" type="VC:Task" export-name="task">
+                <description>Task to Wait for</description>
+            </bind>
+            <bind name="progress" type="boolean" export-name="progress">
+                <description>Log progess while waiting for the task</description>
+            </bind>
+            <bind name="pollRate" type="number" export-name="pollRate">
+                <description>Polling rate for the task state [seconds]</description>
+            </bind>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="taskActionResult"/>
+        </out-binding>
+
+        <description>
+Wait for a VC Task to end or for the VM to ask a question.
+Return the task result or the question asked.
+        </description>
+
+        <position x="140.0" y="80.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item6" type="custom-condition" alt-out-name="item2">
+        <display-name>VM Question?</display-name>
+
+        <script encoded="false">
+if (taskActionResult instanceof VcVirtualMachineQuestionInfo){
+       return true;
+}
+else {
+       return false;
+}
+        </script>
+
+        <in-binding>
+            <bind name="taskActionResult" type="Any" export-name="taskActionResult"/>
+        </in-binding>
+
+        <position x="340.0" y="70.0"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item2" type="task" script-module="com.vmware.library.vc.basic/vim3WaitTaskEnd">
+        <display-name>vim3WaitTaskEnd</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ;
+        </script>
+
+        <in-binding>
+            <bind name="task" type="VC:Task" export-name="task">
+                <description>Task to Wait for</description>
+            </bind>
+            <bind name="progress" type="boolean" export-name="progress">
+                <description>Log progess while waiting for the task</description>
+            </bind>
+            <bind name="pollRate" type="number" export-name="pollRate">
+                <description>Polling rate for the task state [seconds]</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="taskActionResult"/>
+        </out-binding>
+
+        <description>
+Wait for a VC Task to end.
+When task ended, return the task result if any.
+        </description>
+
+        <position x="540.0" y="260.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="vm">
+            <desc>Virtual machine for which the task runs</desc>
+        </p-param>
+        <p-param name="task">
+            <desc>Task to await</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get Linux customization.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get Linux customization.workflow.xml
new file mode 100644 (file)
index 0000000..8302e84
--- /dev/null
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="Workflow:name=generic" id="BD80808080808080808080808080808039C280800122528313869552e41805bb1" version="0.2.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Get Linux customization</display-name>
+
+    <description>Returns the Linux customization preparation.</description>
+
+    <position x="180.0" y="20.0"/>
+
+    <input>
+        <param name="domain" type="string">
+            <description>Fully qualified domain name</description>
+        </param>
+        <param name="hostname" type="string">
+            <description>Network host name of a Linux virtual machine</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="customizationLinuxPrep" type="Any">
+            <description>Corresponding Linux customization preparation</description>
+        </param>
+    </output>
+
+    <attrib name="customizationName" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Name of this Linux customization</description>
+    </attrib>
+
+    <workflow-item name="item0" out-name="item1" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationFixedName">
+        <display-name>getCustomizationFixedName</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationFixedName(name) ;
+        </script>
+
+        <in-binding>
+            <bind name="name" type="string" export-name="hostname">
+                <description>The virtual machine name specified by the client.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="customizationName"/>
+        </out-binding>
+
+        <description>A fixed name.</description>
+
+        <position x="140.0" y="100.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item2" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationLinuxPrep">
+        <display-name>getCustomizationLinuxPrep</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationLinuxPrep(domain,hostName) ;
+        </script>
+
+        <in-binding>
+            <bind name="domain" type="string" export-name="domain">
+                <description>The fully qualified domain name.</description>
+            </bind>
+            <bind name="hostName" type="Any" export-name="customizationName">
+                <description>The network host name of the (Linux) virtual machine.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="customizationLinuxPrep"/>
+        </out-binding>
+
+        <description>This is the Linux counterpart to the Windows Sysprep object. LinuxPrep contains machine-wide settings that identify a Linux machine in the same way that the Sysprep type identifies a Windows machine.</description>
+
+        <position x="140.0" y="140.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" type="end" end-mode="0">
+        <position x="180.0" y="170.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="domain">
+            <desc>Fully qualified domain name.</desc>
+        </p-param>
+        <p-param name="hostname">
+            <desc>Network host name of the (Linux) virtual machine.</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get NIC setting map.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get NIC setting map.workflow.xml
new file mode 100644 (file)
index 0000000..b9854e2
--- /dev/null
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item3" object-name="Workflow:name=generic" id="BD80808080808080808080808080808094C280800122528313869552e41805bb1" version="0.2.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Get NIC setting map</display-name>
+
+    <description>
+Returns the setting map for virtual network card by using VimAdapterMapping.
+
+Changes NIC information for workflows that clone and reconfigure virtual machines. Other clone workflows call this workflow.
+    </description>
+
+    <position x="160.0" y="10.0"/>
+
+    <input>
+        <param name="dhcp" type="boolean">
+            <description>Use a DHCP server to configure the virtual network adapter</description>
+        </param>
+        <param name="ipAddress" type="string">
+            <description>Fixed, valid IP address</description>
+        </param>
+        <param name="subnetMask" type="string">
+            <description>[Optional] Subnet mask for this virtual network adapter</description>
+        </param>
+        <param name="gateway" type="Array/string">
+            <description>[Optional] List of gateways, in order of preference</description>
+        </param>
+        <param name="dnsDomain" type="string">
+            <description>[Optional] DNS domain suffix, for example, vmware.com.</description>
+        </param>
+        <param name="dnsServerList" type="Array/string">
+            <description>[Optional] List of server IP addresses to use for DNS lookup in a Windows guest operating system</description>
+        </param>
+        <param name="netBIOS" type="VC:CustomizationNetBIOSMode">
+            <description>[Optional] NetBIOS setting for Windows</description>
+        </param>
+        <param name="primaryWINS" type="string">
+            <description>(Optional) IP address of the primary WINS server. Linux guest operating systems ignore this property</description>
+        </param>
+        <param name="secondaryWINS" type="string">
+            <description>(Optional) IP address of the secondary WINS server. Linux guest operating systems ignore this property</description>
+        </param>
+        <param name="macAddress" type="string">
+            <description>(Optional) MAC address of a network adapter to customize. By default, the customization process maps the settings from the virtual machine's network adapters, in PCI slot order</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="adapterMapping" type="Any">
+            <description>Data object type to associate a virtual network adapter with its IP settings</description>
+        </param>
+    </output>
+
+    <attrib name="adapter" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>VimCustomizationIPSettings: IP settings for the associated virtual network adapter</description>
+    </attrib>
+    <attrib name="ip" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>VimCustomizationIpGenerator: Specification to obtain a unique IP address for this virtual network adapter</description>
+    </attrib>
+    <attrib name="exception" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Error code</description>
+    </attrib>
+    <workflow-note x="60.0" y="390.0" w="200.0" h="60.0" color="b0ebceff">
+        <description>Adapter Mapping</description>
+    </workflow-note>
+    <workflow-note x="60.0" y="320.0" w="200.0" h="50.0">
+        <description>IP Settings</description>
+    </workflow-note>
+    <workflow-note x="60.0" y="90.0" w="570.0" h="190.0">
+        <description>Choose the Correct IP Generator</description>
+    </workflow-note>
+
+    <workflow-item name="item0" type="end" end-mode="0">
+        <position x="160.0" y="470.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item0" catch-name="item8" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.nic/getCustomizationAdapterMapping">
+        <display-name>getCustomizationAdapterMapping</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.nic").getCustomizationAdapterMapping(adapter,macAddress) ;
+        </script>
+
+        <in-binding>
+            <bind name="adapter" type="Any" export-name="adapter">
+                <description>VimCustomizationIPSettings: The IP settings for the associated virtual network adapter.</description>
+            </bind>
+            <bind name="macAddress" type="string" export-name="macAddress">
+                <description>[Optional] The MAC address of a network adapter being customized. If it is not included, the customization process maps the settings from the virtual machine's network adapters, in PCI slot order.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="adapterMapping"/>
+        </out-binding>
+
+        <description>Define Data object type to associate a virtual network adapter with its IP settings.</description>
+
+        <position x="120.0" y="420.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" out-name="item1" catch-name="item8" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.nic/getCustomizationIPSettings">
+        <display-name>getCustomizationIPSettings</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.nic").getCustomizationIPSettings(dnsDomain,dnsServerList,gateway,ip,netBIOS,primaryWINS,secondaryWINS,subnetMask) ;
+        </script>
+
+        <in-binding>
+            <bind name="dnsDomain" type="string" export-name="dnsDomain">
+                <description>[Optional] A DNS domain suffix such as dunes.ch.</description>
+            </bind>
+            <bind name="dnsServerList" type="Array/string" export-name="dnsServerList">
+                <description>[Optional] A list of server IP addresses to use for DNS lookup in a Windows guest operating system.</description>
+            </bind>
+            <bind name="gateway" type="Array/string" export-name="gateway">
+                <description>[Optional] List of gateways, in order of preference.</description>
+            </bind>
+            <bind name="ip" type="Any" export-name="ip">
+                <description>VimCustomizationIpGenerator: Specification to obtain a unique IP address for this virtual network adapter.</description>
+            </bind>
+            <bind name="netBIOS" type="VC:CustomizationNetBIOSMode" export-name="netBIOS">
+                <description>[Optional] NetBIOS setting for Windows.</description>
+            </bind>
+            <bind name="primaryWINS" type="string" export-name="primaryWINS">
+                <description>[Optional] The IP address of the primary WINS server. This property is ignored for Linux guest operating systems.</description>
+            </bind>
+            <bind name="secondaryWINS" type="string" export-name="secondaryWINS">
+                <description>[Optional] The IP address of the secondary WINS server. This property is ignored for Linux guest operating systems.</description>
+            </bind>
+            <bind name="subnetMask" type="string" export-name="subnetMask">
+                <description>[Optional] Subnet mask for this virtual network adapter.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="adapter"/>
+        </out-binding>
+
+        <description>Define IP settings for a virtual network adapter.</description>
+
+        <position x="120.0" y="340.0"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item4" type="condition" alt-out-name="item6" comparator="0">
+        <display-name>DHCP?</display-name>
+
+        <script encoded="false">
+//Generated by the system, cannot be edited
+return (dhcp == true) ;
+        </script>
+
+        <in-binding>
+            <bind name="dhcp" type="boolean" export-name="dhcp"/>
+        </in-binding>
+        <condition name="dhcp" type="boolean" comparator="0" label="null">false</condition>
+
+        <position x="120.0" y="130.0"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item2" type="task" script-module="com.vmware.library.vc.vm.spec.nic/getCustomizationDhcpIpGenerator">
+        <display-name>getCustomizationDhcpIpGenerator</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.nic").getCustomizationDhcpIpGenerator() ;
+        </script>
+
+        <in-binding/>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="ip"/>
+        </out-binding>
+
+        <description>Use a DHCP server to configure the virtual network adapter.</description>
+
+        <position x="120.0" y="200.0"/>
+    </workflow-item>
+
+    <workflow-item name="item5" out-name="item2" catch-name="item8" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.nic/getCustomizationFixedIp">
+        <display-name>getCustomizationFixedIp</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.nic").getCustomizationFixedIp(ipAddress) ;
+        </script>
+
+        <in-binding>
+            <bind name="ipAddress" type="string" export-name="ipAddress"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="ip"/>
+        </out-binding>
+
+        <description>Use a static IP Address for the virtual network adapter.</description>
+
+        <position x="300.0" y="200.0"/>
+    </workflow-item>
+
+    <workflow-item name="item6" out-name="item5" type="custom-condition" alt-out-name="item7">
+        <display-name>Fixed IP?</display-name>
+
+        <script encoded="false">
+return ipAddress != null &amp;&amp; ipAddress != "";
+        </script>
+
+        <in-binding>
+            <bind name="ipAddress" type="string" export-name="ipAddress"/>
+        </in-binding>
+
+        <position x="300.0" y="130.0"/>
+    </workflow-item>
+
+    <workflow-item name="item7" out-name="item2" type="task" script-module="com.vmware.library.vc.vm.spec.nic/getCustomizationUnknownIpGenerator">
+        <display-name>getCustomizationUnknownIpGenerator</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.nic").getCustomizationUnknownIpGenerator() ;
+        </script>
+
+        <in-binding/>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="ip"/>
+        </out-binding>
+
+        <description>The IP address is left unspecified. The user must be prompted to supply an IP address.</description>
+
+        <position x="480.0" y="200.0"/>
+    </workflow-item>
+
+    <workflow-item name="item8" out-name="item9" type="task">
+        <display-name>Add text to exception</display-name>
+
+        <script encoded="false">
+exception = "Unable to create Nic Setting Map: " + exception;
+        </script>
+
+        <in-binding>
+            <bind name="exception" type="string" export-name="exception"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="exception" type="string" export-name="exception"/>
+        </out-binding>
+
+        <position x="360.0" y="340.0"/>
+    </workflow-item>
+
+    <workflow-item name="item9" throw-bind-name="exception" type="end" end-mode="1">
+        <position x="520.0" y="330.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="macAddress">
+            <desc>(Optional) MAC address of a network adapter to customize. By default, the customization process maps the settings from the virtual machine's network adapters, in PCI slot order</desc>
+            <p-qual kind="static" name="regexp" type="Regexp">00:50:56:[0-3][0-9A-Fa-f](:[0-9A-Fa-f]{2}){2}</p-qual>
+        </p-param>
+        <p-param name="dnsDomain">
+            <desc>(Optional) DNS domain suffix, for example, vmware.com</desc>
+        </p-param>
+        <p-param name="dnsServerList">
+            <desc>(Optional) List of server IP addresses to use for DNS lookup in a Windows guest operating system.</desc>
+        </p-param>
+        <p-param name="gateway">
+            <desc>(Optional) List of gateways, in order of preference.</desc>
+        </p-param>
+        <p-param name="netBIOS">
+            <desc>(Optional) NetBIOS setting for Windows.</desc>
+        </p-param>
+        <p-param name="primaryWINS">
+            <desc>(Optional)IP address of the primary WINS server. Linux guest operating systems ignore this property</desc>
+        </p-param>
+        <p-param name="secondaryWINS">
+            <desc>(Optional) IP address of the secondary WINS server. Linux guest operating systems ignore this property</desc>
+        </p-param>
+        <p-param name="subnetMask">
+            <desc>(Optional) Subnet mask for this virtual network adapter</desc>
+        </p-param>
+        <p-param name="dhcp">
+            <desc>Use a DHCP server to configure the virtual network adapter?</desc>
+        </p-param>
+        <p-param name="ipAddress">
+            <desc>Fixed, valid IP address</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get Windows customization, Sysprep with credentials.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get Windows customization, Sysprep with credentials.workflow.xml
new file mode 100644 (file)
index 0000000..c599c77
--- /dev/null
@@ -0,0 +1,480 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item8" object-name="Workflow:name=generic" id="BD808080808080808080808080808080FEC180800122528313869552e41805bb1" version="0.2.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Get Windows customization, Sysprep with credentials</display-name>
+
+    <description>
+Returns customization information about the Microsoft Sysprep process, with credentials. 
+Workflows for cloning Windows virtual machines use this workflow.
+    </description>
+
+    <position x="120.0" y="10.0"/>
+
+    <input>
+        <param name="commandList" type="Array/string">
+            <description>List of commands to run at first user login after customizing the guest OS</description>
+        </param>
+        <param name="autoLogon" type="boolean">
+            <description>Flag to determine whether or not the machine automatically logs on as administrator</description>
+        </param>
+        <param name="autoLogonCount" type="number">
+            <description>If the AutoLogon flag is set, then the AutoLogonCount property specifies the number of times the machine should automatically log on as Administrator</description>
+        </param>
+        <param name="timeZone" type="number">
+            <description>Time zone for the new virtual machine. Numbers correspond to time zones listed in the Sysprep documentation</description>
+        </param>
+        <param name="domainAdmin" type="Credential">
+            <description>(Optional) Domain user account to use for authentication if the virtual machine is to join a domain. Does not need to be a domain administrator account, but the account must have the necessary privileges to add machines to the domain.</description>
+        </param>
+        <param name="joinDomain" type="string">
+            <description>(Optional) Domain that the virtual machine joins. If this value is set, you must set domainAdmin and domainAdminPassword, and you must leave the workgroup name empty.</description>
+        </param>
+        <param name="joinWorkgroup" type="string">
+            <description>(Optional) Workgroup that the virtual machine joins. If this value is set, you must leave the domain name and authentication fields empty.</description>
+        </param>
+        <param name="licenseMode" type="VC:CustomizationLicenseDataMode">
+            <description>Server licensing mode</description>
+        </param>
+        <param name="licenseUsers" type="number">
+            <description>This key is valid only if AutoMode = PerServer</description>
+        </param>
+        <param name="fullName" type="string">
+            <description>User's full name</description>
+        </param>
+        <param name="orgName" type="string">
+            <description>User's organization</description>
+        </param>
+        <param name="productId" type="string">
+            <description>Sysprep requires you to include a valid serial number in the answer file when the mini-setup runs. Workflow ignores this serial number if you installed the original guest OS using a volume-licensed CD.</description>
+        </param>
+        <param name="newAdminPassword" type="string">
+            <description>New administrator password. Set the associated plainText flag to false to activate encryption</description>
+        </param>
+        <param name="addNumberToName" type="boolean">
+            <description>Append a number to the name to ensure the name is unique</description>
+        </param>
+        <param name="clientName" type="string">
+            <description>Virtual machine name that the user specifies</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="sysprep" type="Any">
+            <description>Object representation of a Windows sysprep.inf answer file.</description>
+        </param>
+    </output>
+
+    <attrib name="guiRunOnce" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>(Optional) VimCustomizationGuiRunOnce: Object representation of the Sysprep GuiRunOnce key</description>
+    </attrib>
+    <attrib name="guiUnattended" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>VimCustomizationGuiUnattended: Object representation of the Sysprep GuiUnattended key</description>
+    </attrib>
+    <attrib name="identification" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>VimCustomizationIdentification: Object representation of the Sysprep Identification key</description>
+    </attrib>
+    <attrib name="licenseFilePrintData" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>(Optional) VimCustomizationLicenseFilePrintData: Object representation of the Sysprep LicenseFilePrintData key. Required only for Windows 2000 Server and Windows Server 2003.</description>
+    </attrib>
+    <attrib name="userData" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>VimCustomizationUserData: Object representation of the Sysprep UserData key</description>
+    </attrib>
+    <attrib name="newAdminPasswordAtt" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>(Optional) VimCustomizationPassword: New administrator password for the machine. To deactivate  password control, set the password value to NULL. Because of encryption, "" is NOT a valid value.</description>
+    </attrib>
+    <attrib name="computerName" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>VimCustomizationName: Computer name of the Windows virtual machine</description>
+    </attrib>
+    <attrib name="plainText" type="boolean" read-only="true">
+        <value encoded="n">true</value>
+        <description>Flag to specify whether or not to encrypt the password or use plain text</description>
+    </attrib>
+    <attrib name="exception" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Error code</description>
+    </attrib>
+    <workflow-note x="40.0" y="220.0" w="270.0" h="120.0">
+        <description>GUI Run Once only if one autoLogon</description>
+    </workflow-note>
+    <workflow-note x="40.0" y="80.0" w="170.0" h="100.0">
+        <description>GUI Unattended</description>
+    </workflow-note>
+    <workflow-note x="40.0" y="380.0" w="170.0" h="100.0">
+        <description>Identification</description>
+    </workflow-note>
+    <workflow-note x="40.0" y="500.0" w="170.0" h="60.0">
+        <description>License</description>
+    </workflow-note>
+    <workflow-note x="40.0" y="580.0" w="320.0" h="140.0">
+        <description>Userdata</description>
+    </workflow-note>
+    <workflow-note x="420.0" y="580.0" w="170.0" h="60.0" color="bfffdfff">
+        <description>Compute all</description>
+    </workflow-note>
+
+    <workflow-item name="item0" out-name="item5" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationSysprep">
+        <display-name>getCustomizationSysprep</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationSysprep(guiRunOnce,guiUnattended,identification,licenseFilePrintData,userData) ;
+        </script>
+
+        <in-binding>
+            <bind name="guiRunOnce" type="Any" export-name="guiRunOnce">
+                <description>[Optional] VimCustomizationGuiRunOnce: An object representation of the sysprep GuiRunOnce key.</description>
+            </bind>
+            <bind name="guiUnattended" type="Any" export-name="guiUnattended">
+                <description>VimCustomizationGuiUnattended: An object representation of the sysprep GuiUnattended key. VimCustomizationGuiUnattended:</description>
+            </bind>
+            <bind name="identification" type="Any" export-name="identification">
+                <description>VimCustomizationIdentification: An object representation of the sysprep Identification key.</description>
+            </bind>
+            <bind name="licenseFilePrintData" type="Any" export-name="licenseFilePrintData">
+                <description>[Optional] VimCustomizationLicenseFilePrintData: An object representation of the sysprep LicenseFilePrintData key. Required only for Windows 2000 Server and Windows Server 2003.</description>
+            </bind>
+            <bind name="userData" type="Any" export-name="userData">
+                <description>VimCustomizationUserData: An object representation of the sysprep UserData key.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="sysprep"/>
+        </out-binding>
+
+        <description>An object representation of a Windows sysprep.inf answer file. The sysprep type encloses all the individual keys listed in a sysprep.inf file. For more detailed information, see the document Windows 2000 Unattended Setup Guide.</description>
+
+        <position x="460.0" y="600.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item3" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationGuiRunOnce">
+        <display-name>getCustomizationGuiRunOnce</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationGuiRunOnce(commandList) ;
+        </script>
+
+        <in-binding>
+            <bind name="commandList" type="Array/string" export-name="commandList">
+                <description>A list of commands to run at first user logon, after guest customization.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="guiRunOnce"/>
+        </out-binding>
+
+        <description>The commands listed in the GuiRunOnce data object type are executed when a user logs on the first time after customization completes. The logon may be driven by the AutoLogon setting.</description>
+
+        <position x="180.0" y="300.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" out-name="item11" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationGuiUnattended">
+        <display-name>getCustomizationGuiUnattended</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationGuiUnattended(autoLogon,autoLogonCount,password,timeZone) ;
+        </script>
+
+        <in-binding>
+            <bind name="autoLogon" type="boolean" export-name="autoLogon">
+                <description>Flag to determine whether or not the machine automatically logs on as Administrator</description>
+            </bind>
+            <bind name="autoLogonCount" type="number" export-name="autoLogonCount">
+                <description>If the AutoLogon flag is set, then the AutoLogonCount property specifies the number of times the machine should automatically log on as Administrator</description>
+            </bind>
+            <bind name="password" type="Any" export-name="newAdminPasswordAtt">
+                <description>[Optional] VimCustomizationPassword: The new administrator password for the machine. To specify that the password should be set to blank (that is, no password), set the password value to NULL. Because of encryption, "" is NOT a valid value.</description>
+            </bind>
+            <bind name="timeZone" type="number" export-name="timeZone">
+                <description>The time zone for the new virtual machine. Numbers correspond to time zones listed in sysprep documentation</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="guiUnattended"/>
+        </out-binding>
+
+        <description>The GuiUnattended type maps to the GuiUnattended key in the sysprep.inf answer file. These values are plugged directly into the sysprep.inf file that VirtualCenter stores on the target virtual disk.</description>
+
+        <position x="80.0" y="140.0"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item14" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationLicenseFilePrintData">
+        <display-name>getCustomizationLicenseFilePrintData</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationLicenseFilePrintData(autoMode,autoUsers) ;
+        </script>
+
+        <in-binding>
+            <bind name="autoMode" type="VC:CustomizationLicenseDataMode" export-name="licenseMode">
+                <description>Server licensing mode</description>
+            </bind>
+            <bind name="autoUsers" type="number" export-name="licenseUsers">
+                <description>This key is valid only if AutoMode = PerServer.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="licenseFilePrintData"/>
+        </out-binding>
+
+        <description>The LicenseFilePrintData type maps directly to the LicenseFilePrintData key in the sysprep.inf answer file.</description>
+
+        <position x="80.0" y="520.0"/>
+    </workflow-item>
+
+    <workflow-item name="item6" out-name="item0" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationUserData">
+        <display-name>getCustomizationUserData</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationUserData(computerName,fullName,orgName,productId) ;
+        </script>
+
+        <in-binding>
+            <bind name="computerName" type="Any" export-name="computerName">
+                <description>VimCustomizationName: The computer name of the (Windows) virtual machine.</description>
+            </bind>
+            <bind name="fullName" type="string" export-name="fullName">
+                <description>User's full name.</description>
+            </bind>
+            <bind name="orgName" type="string" export-name="orgName">
+                <description>User's organization.</description>
+            </bind>
+            <bind name="productId" type="string" export-name="productId">
+                <description>Microsoft Sysprep requires that a valid serial number be included in the answer file when mini-setup runs. This serial number is ignored if the original guest operating system was installed using a volume-licensed CD.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="userData"/>
+        </out-binding>
+
+        <description>
+Personal data pertaining to the owner of the virtual machine.
+        </description>
+
+        <position x="220.0" y="680.0"/>
+    </workflow-item>
+
+    <workflow-item name="item8" out-name="item2" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationPassword">
+        <display-name>getCustomizationPassword</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationPassword(plainText,value) ;
+        </script>
+
+        <in-binding>
+            <bind name="plainText" type="boolean" export-name="plainText">
+                <description>Flag to specify whether or not the password is in plain text, rather than encrypted.</description>
+            </bind>
+            <bind name="value" type="string" export-name="newAdminPassword">
+                <description>The password string. It is encrypted if the associated plainText flag is false.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="newAdminPasswordAtt"/>
+        </out-binding>
+
+        <description>Contains a password string and a flag that specifies whether the string is in plain text or encrypted.</description>
+
+        <position x="80.0" y="100.0"/>
+    </workflow-item>
+
+    <workflow-item name="item5" type="end" end-mode="0">
+        <position x="660.0" y="570.0"/>
+    </workflow-item>
+
+    <workflow-item name="item9" out-name="item10" catch-name="" type="task">
+        <display-name>Add text to Exception</display-name>
+
+        <script encoded="false">
+exception = "Cannot Create Sysprep customization: " + exception;
+        </script>
+
+        <in-binding>
+            <bind name="exception" type="string" export-name="exception"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="exception" type="string" export-name="exception"/>
+        </out-binding>
+
+        <position x="460.0" y="340.0"/>
+    </workflow-item>
+
+    <workflow-item name="item10" throw-bind-name="exception" type="end" end-mode="1">
+        <position x="660.0" y="330.0"/>
+    </workflow-item>
+
+    <workflow-item name="item11" out-name="item1" type="condition" alt-out-name="item3" comparator="0">
+        <display-name>Autologon?</display-name>
+
+        <script encoded="false">
+//Generated by the system, cannot be edited
+return (autoLogon == true) ;
+        </script>
+
+        <in-binding>
+            <bind name="autoLogon" type="boolean" export-name="autoLogon"/>
+        </in-binding>
+        <condition name="autoLogon" type="boolean" comparator="0" label="null">false</condition>
+
+        <position x="80.0" y="250.0"/>
+    </workflow-item>
+
+    <workflow-item name="item12" out-name="item6" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationFixedName">
+        <display-name>getCustomizationFixedName</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationFixedName(name) ;
+        </script>
+
+        <in-binding>
+            <bind name="name" type="string" export-name="clientName">
+                <description>The virtual machine name specified by the client.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="computerName"/>
+        </out-binding>
+
+        <description>A fixed name.</description>
+
+        <position x="80.0" y="680.0"/>
+    </workflow-item>
+
+    <workflow-item name="item13" out-name="item6" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationPrefixName">
+        <display-name>getCustomizationPrefixName</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationPrefixName(base) ;
+        </script>
+
+        <in-binding>
+            <bind name="base" type="string" export-name="clientName">
+                <description>Base prefix, to which a unique number is appended.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="computerName"/>
+        </out-binding>
+
+        <description>
+Specifies that a unique name should be generated by concatenating the base string with a number. 
+Virtual machine names are unique across the set of hosts and virtual machines known to the VirtualCenter instance. VirtualCenter tracks the network names of virtual machines as well as hosts. VMware Tools runs in a guest operating system and reports information to VirtualCenter, including the network name of the guest.
+        </description>
+
+        <position x="220.0" y="620.0"/>
+    </workflow-item>
+
+    <workflow-item name="item14" out-name="item13" type="condition" alt-out-name="item12" comparator="0">
+        <display-name>Add number to name</display-name>
+
+        <script encoded="false">
+//Generated by the system, cannot be edited
+return (addNumberToName == true) ;
+        </script>
+
+        <in-binding>
+            <bind name="addNumberToName" type="boolean" export-name="addNumberToName"/>
+        </in-binding>
+        <condition name="addNumberToName" type="boolean" comparator="0" label="null">false</condition>
+
+        <position x="80.0" y="610.0"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item4" catch-name="item9" throw-bind-name="exception" type="task" script-module="com.vmware.library.vc.vm.spec.identity/getCustomizationIdentificationFromCredential">
+        <display-name>getCustomizationIdentificationFromCredential</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.identity").getCustomizationIdentificationFromCredential(domainAdmin,joinDomain,joinWorkgroup) ;
+        </script>
+
+        <in-binding>
+            <bind name="domainAdmin" type="Credential" export-name="domainAdmin">
+                <description>[Optional] This is the domain user account used for authentication if the virtual machine is joining a domain. The user does not need to be a domain administrator, but the account must have the privileges required to add computers to the domain.</description>
+            </bind>
+            <bind name="joinDomain" type="string" export-name="joinDomain">
+                <description>[Optional] The domain that the virtual machine should join. If this value is supplied, then domainAdmin and domainAdminPassword must also be supplied, and the workgroup name must be empty.</description>
+            </bind>
+            <bind name="joinWorkgroup" type="string" export-name="joinWorkgroup">
+                <description>[Optional] The workgroup that the virtual machine should join. If this value is supplied, then the domain name and authentication fields must be empty.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="identification"/>
+        </out-binding>
+
+        <description>The Identification data object type provides information needed to join a workgroup or domain</description>
+
+        <position x="80.0" y="420.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="commandList">
+            <desc>List of commands to run at first user login after customizing the guest OS</desc>
+        </p-param>
+        <p-param name="autoLogon">
+            <desc>Flag to determine whether or not the machine automatically logs on as administrator</desc>
+        </p-param>
+        <p-param name="autoLogonCount">
+            <desc>If the AutoLogon flag is set, then the AutoLogonCount property specifies the number of times the machine should automatically log on as Administrator</desc>
+        </p-param>
+        <p-param name="timeZone">
+            <desc>Time zone for the new virtual machine. Numbers correspond to time zones listed in the Sysprep documentation</desc>
+        </p-param>
+        <p-param name="domainAdmin">
+            <desc>(Optional) Domain user account to use for authentication if the virtual machine is to join a domain. Does not need to be a domain administrator account, but the account must have the necessary privileges to add machines to the domain.</desc>
+        </p-param>
+        <p-param name="joinDomain">
+            <desc>(Optional) Domain that the virtual machine joins. If this value is set, you must set domainAdmin and domainAdminPassword, and you must leave the workgroup name empty.</desc>
+        </p-param>
+        <p-param name="joinWorkgroup">
+            <desc>(Optional) Workgroup that the virtual machine joins. If this value is set, you must leave the domain name and authentication fields empty.</desc>
+        </p-param>
+        <p-param name="licenseMode">
+            <desc>Server licensing mode</desc>
+        </p-param>
+        <p-param name="licenseUsers">
+            <desc>This key is valid only if AutoMode = PerServer</desc>
+        </p-param>
+        <p-param name="fullName">
+            <desc>User's full name</desc>
+        </p-param>
+        <p-param name="orgName">
+            <desc>User's organization</desc>
+        </p-param>
+        <p-param name="productId">
+            <desc>Sysprep requires you to include a valid serial number in the answer file when the mini-setup runs. Workflow ignores this serial number if you installed the original guest OS using a volume-licensed CD.</desc>
+        </p-param>
+        <p-param name="newAdminPassword">
+            <desc>New administrator password. Set the associated plainText flag to false to activate encryption</desc>
+        </p-param>
+        <p-param name="addNumberToName">
+            <desc>Append a number to the name to ensure the name is unique</desc>
+        </p-param>
+        <p-param name="clientName">
+            <desc>The virtual machine name the user specifies</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get a VirtualEthernetCard to change the network.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Clone/Tools/Get a VirtualEthernetCard to change the network.workflow.xml
new file mode 100644 (file)
index 0000000..364ec1c
--- /dev/null
@@ -0,0 +1,572 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item3" object-name="Workflow:name=generic" id="BD8080808080808080808080808080808AC280800122528313869552e41805bb1" version="0.3.2" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Get a VirtualEthernetCard to change the network</display-name>
+
+    <description>Returns a new ethernet card to update a virtual device. Contains only the device key of the given virtual device and the new network.</description>
+
+    <position x="185.0" y="9.045454545454543"/>
+
+    <input>
+        <param name="sourceVirtualEthernetCard" type="Any">
+            <description>VirtualEthernetCard for which to change the network</description>
+        </param>
+        <param name="network" type="Any">
+            <description>vCenter Server network to which to bind the network adapter</description>
+        </param>
+    </input>
+
+    <output>
+        <param name="virtualEthernetCard" type="Any">
+            <description>VirtualEthernetCard object</description>
+        </param>
+    </output>
+
+    <attrib name="key" type="number" read-only="false">
+        <value encoded="n">0.0</value>
+        <description>(Optional) Unique key to distinguish this device from other devices in the same virtual machine. Must be unique. You can only set the key at creation time.</description>
+    </attrib>
+    <attrib name="backing" type="Any" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>(Optional) Any valid VirtualDeviceBackingInfo, depending on the device</description>
+    </attrib>
+    <attrib name="deviceName" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Name of the device on the host system</description>
+    </attrib>
+    <attrib name="notSupportedDeviceType" type="string" read-only="false">
+        <value encoded="n">The device type is not supported</value>
+        <description>Unsupported device types</description>
+    </attrib>
+
+    <workflow-item name="item0" out-name="item6" type="custom-condition" alt-out-name="item16">
+        <display-name>VirtualE1000</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualE1000;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="263.59090909090907"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item7" type="custom-condition" alt-out-name="item2">
+        <display-name>VirtualPCNet32</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualPCNet32;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="390.8636363636363"/>
+    </workflow-item>
+
+    <workflow-item name="item2" out-name="item8" type="custom-condition" alt-out-name="item11">
+        <display-name>VirtualVmxnet</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualVmxnet;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="472.68181818181813"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item13" type="task">
+        <display-name>Get key</display-name>
+
+        <script encoded="false">
+key = sourceVirtualEthernetCard.key;
+if (network == null) throw "Reference Error: network cannot be null";
+deviceName = network.name;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+            <bind name="network" type="Any" export-name="network"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="key" type="number" export-name="key"/>
+            <bind name="deviceName" type="string" export-name="deviceName"/>
+        </out-binding>
+
+        <position x="145.0" y="73.59090909090908"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item0" type="task" script-module="com.vmware.library.vc.vm.spec.config.device.backing.device/getVirtualEthernetCardNetworkBackingInfo">
+        <display-name>getVirtualEthernetCardNetworkBackingInfo</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device.backing.device").getVirtualEthernetCardNetworkBackingInfo(deviceName,network) ;
+        </script>
+
+        <in-binding>
+            <bind name="deviceName" type="string" export-name="deviceName">
+                <description>The name of the device on the host system.</description>
+            </bind>
+            <bind name="network" type="Any" export-name="network">
+                <description>Reference to the network managed object to which this backing applies. This is not used during configuration.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="backing"/>
+        </out-binding>
+
+        <description>The virtual Ethernet card backing class.</description>
+
+        <position x="65.0" y="209.95454545454544"/>
+    </workflow-item>
+
+    <workflow-item name="item5" throw-bind-name="notSupportedDeviceType" type="end" end-mode="1">
+        <position x="185.0" y="818.1363636363635"/>
+    </workflow-item>
+
+    <workflow-item name="item6" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualE1000">
+        <display-name>getVirtualE1000</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualE1000(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>The VirtualE1000 data object type represents an instance of the E1000 virtual Ethernet adapter attached to a virtual machine.</description>
+
+        <position x="345.0" y="273.59090909090907"/>
+    </workflow-item>
+
+    <workflow-item name="item7" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualPCNet32">
+        <display-name>getVirtualPCNet32</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualPCNet32(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>This data object type defines the properties of an AMD Lance PCNet32 Ethernet card attached to a virtual machine.</description>
+
+        <position x="345.0" y="400.8636363636363"/>
+    </workflow-item>
+
+    <workflow-item name="item8" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet">
+        <display-name>getVirtualVmxnet</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualVmxnet(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>The VirtualVmxnet data object type represents an instance of the Vmxnet virtual Ethernet adapter attached to a virtual machine.</description>
+
+        <position x="345.0" y="482.68181818181813"/>
+    </workflow-item>
+
+    <workflow-item name="item9" type="end" end-mode="0">
+        <position x="605.0" y="472.68181818181813"/>
+    </workflow-item>
+
+    <workflow-item name="item10" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet2">
+        <display-name>getVirtualVmxnet2</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualVmxnet2(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>The VirtualVmxnet data object type represents an instance of the Vmxnet virtual Ethernet adapter attached to a virtual machine.</description>
+
+        <position x="345.0" y="564.5"/>
+    </workflow-item>
+
+    <workflow-item name="item11" out-name="item10" type="custom-condition" alt-out-name="item12">
+        <display-name>VirtualVmxnet2</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualVmxnet2;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="554.5"/>
+    </workflow-item>
+
+    <workflow-item name="item12" out-name="item14" type="custom-condition" alt-out-name="item18">
+        <display-name>VirtualVmxnet3</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualVmxnet3;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="645.4090909090909"/>
+    </workflow-item>
+
+    <workflow-item name="item14" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualVmxnet3">
+        <display-name>getVirtualVmxnet3</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualVmxnet3(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>The VirtualVmxnet data object type represents an instance of the Vmxnet virtual Ethernet adapter attached to a virtual machine.</description>
+
+        <position x="345.0" y="655.4090909090909"/>
+    </workflow-item>
+
+    <workflow-item name="item13" out-name="item4" type="custom-condition" alt-out-name="item15">
+        <display-name>Not distributed</display-name>
+
+        <script encoded="false">
+return network instanceof VcNetwork;
+        </script>
+
+        <in-binding>
+            <bind name="network" type="Any" export-name="network"/>
+        </in-binding>
+
+        <position x="145.0" y="136.3181818181818"/>
+    </workflow-item>
+
+    <workflow-item name="item15" out-name="item0" type="task" script-module="com.vmware.library.vc.networking/getVirtualEthernetCardDvPortgroupBackingInfo">
+        <display-name>getVirtualEthernetCardDvPortgroupBackingInfo</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.networking").getVirtualEthernetCardDvPortgroupBackingInfo(deviceName,network) ;
+        </script>
+
+        <in-binding>
+            <bind name="deviceName" type="string" export-name="deviceName">
+                <description>The name of the device on the host system.</description>
+            </bind>
+            <bind name="network" type="Any" export-name="network">
+                <description>Reference to the network managed object to which this backing applies. This is not used during configuration.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="backing"/>
+        </out-binding>
+
+        <description>The virtual Ethernet card backing class. (uses Distributed Virtual Portgroup as input instead of VC:Network object)</description>
+
+        <position x="225.0" y="209.95454545454544"/>
+    </workflow-item>
+
+    <workflow-item name="item16" out-name="item17" type="custom-condition" alt-out-name="item1">
+        <display-name>VirtualE1000e</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualE1000e;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="327.2272727272727"/>
+    </workflow-item>
+
+    <workflow-item name="item17" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualE1000e">
+        <display-name>getVirtualE1000e</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualE1000e(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>The VirtualE1000 data object type represents an instance of the E1000 virtual Ethernet adapter attached to a virtual machine.</description>
+
+        <position x="345.0" y="337.2272727272727"/>
+    </workflow-item>
+
+    <workflow-item name="item18" out-name="item19" type="custom-condition" alt-out-name="item5">
+        <display-name>VirtualSriovEthernetCard</display-name>
+
+        <script encoded="false">
+return sourceVirtualEthernetCard instanceof VcVirtualSriovEthernetCard;
+        </script>
+
+        <in-binding>
+            <bind name="sourceVirtualEthernetCard" type="Any" export-name="sourceVirtualEthernetCard"/>
+        </in-binding>
+
+        <position x="145.0" y="736.8181818181818"/>
+    </workflow-item>
+
+    <workflow-item name="item19" out-name="item9" type="task" script-module="com.vmware.library.vc.vm.spec.config.device/getVirtualSriovEthernetCard">
+        <display-name>getVirtualSriovEthernetCard</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.spec.config.device").getVirtualSriovEthernetCard(backing,connectable,controllerKey,deviceInfo,key,unitNumber,addressType,macAddress,wakeOnLanEnabled) ;
+        </script>
+
+        <in-binding>
+            <bind name="backing" type="Any" export-name="backing">
+                <description>[Optional] Any valid VirtualDeviceBackingInfo, depend on the device itself.</description>
+            </bind>
+            <bind name="connectable" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimVirtualDeviceConnectInfo: Information about restrictions on removing this device while a virtual machine is running. If the device is not removable, then this property is null.</description>
+            </bind>
+            <bind name="controllerKey" type="number" explicitly-not-bound="true">
+                <description>[Optional] Object key that denotes the controller object for this device. This property contains the key property value of the controller device object.</description>
+            </bind>
+            <bind name="deviceInfo" type="Any" explicitly-not-bound="true">
+                <description>[Optional] VimDescription: This property provides a label and summary information for the device.</description>
+            </bind>
+            <bind name="key" type="number" export-name="key">
+                <description>[Optional] This property is a unique key that distinguishes this device from other devices in the same virtual machine. This must be unique. Can only be setted by users at create time</description>
+            </bind>
+            <bind name="unitNumber" type="number" explicitly-not-bound="true">
+                <description>[Optional] Unit number of this device on its controller. This property is null if the controller property is null (for example, when the device is not attached to a specific controller object).  Normally, two devices on the same controller may not be assigned the same unit number.</description>
+            </bind>
+            <bind name="addressType" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address type.  Valid values for address type are: Manual  Statically assigned MAC address.  Generated  Automatically generated MAC address.  Assigned  MAC address assigned by VirtualCenter.</description>
+            </bind>
+            <bind name="macAddress" type="string" explicitly-not-bound="true">
+                <description>[Optional] MAC address assigned to the virtual network adapter. Clients can set this property to any of the allowed address types. The server might override the specified value for "Generated" or "Assigned" if it does not fall in the right ranges or is determined to be a duplicate.</description>
+            </bind>
+            <bind name="wakeOnLanEnabled" type="boolean" explicitly-not-bound="true">
+                <description>[Optional] Indicates whether wake-on-LAN is enabled on this virtual network adapter. Clients can set this property to selectively enable or disable wake-on-LAN.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" export-name="virtualEthernetCard"/>
+        </out-binding>
+
+        <description>The VirtualE1000 data object type represents an instance of the E1000 virtual Ethernet adapter attached to a virtual machine.</description>
+
+        <position x="345.0" y="746.3181818181818"/>
+    </workflow-item>
+
+    <presentation>
+        <p-param name="network">
+            <desc>vCenter Server network to which to bind the network adapter</desc>
+        </p-param>
+        <p-param name="sourceVirtualEthernetCard">
+            <desc>VirtualEthernetCard for which to change the network</desc>
+        </p-param>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Device Management/Add disk.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Device Management/Add disk.workflow.xml
new file mode 100644 (file)
index 0000000..32e5a82
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item4" object-name="Workflow:name=generic" id="BD8080808080808080808080808080801BC280800122528313869552e41805bb1" version="0.2.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Add disk</display-name>
+
+    <description>Adds a virtual disk to a virtual machine.</description>
+    <ref-types>(VC:VirtualMachine)</ref-types>
+
+    <position x="140.0" y="0.0"/>
+
+    <input>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine to which to add the disk</description>
+        </param>
+        <param name="datastore" type="VC:Datastore">
+            <description>Datastore in which to put the virtual disk file</description>
+        </param>
+        <param name="diskIndex" type="number">
+            <description>Disk index</description>
+        </param>
+        <param name="diskSize" type="number">
+            <description>Disk size (in GB)</description>
+        </param>
+        <param name="diskMode" type="VC:VirtualDiskMode">
+            <description>Disk persistence mode</description>
+        </param>
+        <param name="scsiBusNumber" type="number">
+            <description>SCSI controller bus number</description>
+        </param>
+        <param name="thinProvisioned" type="boolean">
+            <description>Use thin provisioning?</description>
+        </param>
+    </input>
+
+    <attrib name="scsiControllerKey" type="number" read-only="false">
+        <value encoded="n">0</value>
+        <description>LSI or Bus Logic SCSI controller key</description>
+    </attrib>
+    <attrib name="task" type="VC:Task" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Task to await</description>
+    </attrib>
+    <attrib name="progress" type="boolean" read-only="false">
+        <value encoded="n">false</value>
+        <description>Log progress while waiting for the task to complete</description>
+    </attrib>
+    <attrib name="pollRate" type="number" read-only="false">
+        <value encoded="n">1.0</value>
+        <description>Polling rate for the task state, in seconds</description>
+    </attrib>
+    <attrib name="noContollerError" type="string" read-only="false">
+        <value encoded="n">Error: No controller found</value>
+        <description>Error if virtual machine has no IDE controller</description>
+    </attrib>
+
+    <workflow-item name="item0" out-name="item1" type="task">
+        <display-name>Add disk</display-name>
+
+        <script encoded="false">
+var configSpec = new VcVirtualMachineConfigSpec();
+var deviceConfigSpecs = new Array();
+var deviceConfigSpec;
+
+// Add/Create the disk
+deviceConfigSpec = System.getModule("com.vmware.library.vc.vm.spec.config.device").createVirtualDiskFlatVer2ConfigSpec(
+       diskSize, datastore, scsiControllerKey, diskIndex, VcVirtualDiskMode.fromString(diskMode.name), thinProvisioned );
+deviceConfigSpecs[0] = deviceConfigSpec;
+
+// List of devices
+configSpec.deviceChange = deviceConfigSpecs;
+
+// Launch the reconfigVM task
+task = vm.reconfigVM_Task( configSpec );
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="scsiControllerKey" type="number" export-name="scsiControllerKey"/>
+            <bind name="diskSize" type="number" export-name="diskSize"/>
+            <bind name="diskMode" type="VC:VirtualDiskMode" export-name="diskMode"/>
+            <bind name="diskIndex" type="number" export-name="diskIndex"/>
+            <bind name="datastore" type="VC:Datastore" export-name="datastore"/>
+            <bind name="thinProvisioned" type="boolean" export-name="thinProvisioned"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="task" type="VC:Task" export-name="task"/>
+        </out-binding>
+
+        <position x="100.0" y="220.0"/>
+    </workflow-item>
+
+    <workflow-item name="item5" out-name="item6" type="task">
+        <display-name>Retrieve Scsi controller found ?</display-name>
+
+        <script encoded="false">
+scsiControllerKey = -1;
+var devices = vm.config.hardware.device;
+var isScsiBusNumberInvalid = true;
+if(scsiBusNumber==null || scsiBusNumber&lt;0)
+       scsiBusNumber=0;
+if ( devices != null )  {
+       for ( device in devices )  {
+               if ( devices[device] instanceof VcVirtualBusLogicController || devices[device] instanceof VcVirtualLsiLogicController 
+               || devices[device] instanceof VcParaVirtualSCSIController || devices[device] instanceof VcVirtualLsiLogicSASController )  {
+                       if(scsiBusNumber==devices[device].busNumber){
+                               scsiControllerKey = devices[device].key;
+                               isScsiBusNumberInvalid = false;
+                               System.log( "SCSI controller found. (Key: " + scsiControllerKey + ")" );
+                               break;
+                       }
+               }
+       }
+}
+if(isScsiBusNumberInvalid){
+       System.log( "SCSI controller not found. The bus number entered is invalid" );
+}
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="scsiBusNumber" type="number" export-name="scsiBusNumber"/>
+        </in-binding>
+
+        <out-binding>
+            <bind name="scsiControllerKey" type="number" export-name="scsiControllerKey"/>
+        </out-binding>
+
+        <position x="100.0" y="100.0"/>
+    </workflow-item>
+
+    <workflow-item name="item6" out-name="item0" type="condition" alt-out-name="item2" comparator="0">
+        <display-name>Scsi controller found ?</display-name>
+
+        <script encoded="false">
+//Generated by the system, cannot be edited
+return (scsiControllerKey &gt;= 0.0) ;
+        </script>
+
+        <in-binding>
+            <bind name="scsiControllerKey" type="number" export-name="scsiControllerKey"/>
+        </in-binding>
+        <condition name="scsiControllerKey" type="number" comparator="5" label="null">0.0</condition>
+
+        <position x="100.0" y="150.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item3" type="task" script-module="com.vmware.library.vc.basic/vim3WaitTaskEnd">
+        <display-name>vim3WaitTaskEnd</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ;
+        </script>
+
+        <in-binding>
+            <bind name="task" type="VC:Task" export-name="task">
+                <description>Task to Wait for</description>
+            </bind>
+            <bind name="progress" type="boolean" export-name="progress">
+                <description>Log progess while waiting for the task</description>
+            </bind>
+            <bind name="pollRate" type="number" export-name="pollRate">
+                <description>Polling rate for the task state [seconds]</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" explicitly-not-bound="true" export-name="NULL"/>
+        </out-binding>
+
+        <description>
+Wait a VIM 3 Task to end.
+When task ended, return the
+        </description>
+
+        <position x="100.0" y="280.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" throw-bind-name="noContollerError" type="end" end-mode="1">
+        <position x="260.0" y="150.0"/>
+    </workflow-item>
+
+    <workflow-item name="item3" type="end" end-mode="0">
+        <position x="140.0" y="330.0"/>
+    </workflow-item>
+
+    <workflow-item name="item4" out-name="item5" type="task">
+        <display-name>check Params</display-name>
+
+        <script encoded="false">
+if (diskSize &lt; 0.01 ) {
+       throw ("Error, invalid parameter. Disk size should be no less than 0.01 ");
+}
+        </script>
+
+        <in-binding>
+            <bind name="diskSize" type="number" export-name="diskSize"/>
+        </in-binding>
+
+        <out-binding/>
+
+        <position x="100.0" y="60.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-step>
+            <title>VM</title>
+            <p-param name="vm">
+                <desc>Virtual machine to which to add the disk</desc>
+                <p-qual name="mandatory">true</p-qual>
+                <p-qual name="show-select-as">list</p-qual>
+                <p-qual name="contextualParameter"/>
+            </p-param>
+        </p-step>
+        <p-step>
+            <title>Disk</title>
+            <p-group>
+                <title>Disk information</title>
+                <desc>'Disk index' must be between 0 and 15 (and not 7 as it's reserved by spec)</desc>
+                <p-param name="datastore">
+                    <desc>Datastore in which to put the virtual disk file</desc>
+                    <p-qual name="mandatory">true</p-qual>
+                    <p-qual name="show-select-as">list</p-qual>
+                </p-param>
+                <p-param name="diskMode">
+                    <desc>Disk persistence mode</desc>
+                    <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+                </p-param>
+                <p-param name="diskIndex">
+                    <desc>Disk index</desc>
+                    <p-qual kind="static" name="numberFormat" type="String">#</p-qual>
+                    <p-qual kind="static" name="minNumberValue" type="Number">0.0</p-qual>
+                    <p-qual kind="static" name="maxNumberValue" type="Number">15.0</p-qual>
+                    <p-qual name="mandatory">true</p-qual>
+                    <p-qual kind="ognl" name="ognlValidator" type="String">(#diskIndex != 7 ? "": "7 is not valid" )</p-qual>
+                </p-param>
+                <p-param name="diskSize">
+                    <desc>Disk size (in GB)</desc>
+                    <p-qual name="mandatory">true</p-qual>
+                    <p-qual kind="static" name="minNumberValue" type="Number">0.01</p-qual>
+                </p-param>
+                <p-param name="scsiBusNumber">
+                    <desc>SCSI controller bus number</desc>
+                    <p-qual kind="static" name="numberFormat" type="String">#</p-qual>
+                    <p-qual kind="static" name="minNumberValue" type="Number">0</p-qual>
+                </p-param>
+                <p-param name="thinProvisioned">
+                    <desc>Use thin provisioning?</desc>
+                </p-param>
+            </p-group>
+        </p-step>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Power Management/Shut down guest OS and wait.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Power Management/Shut down guest OS and wait.workflow.xml
new file mode 100644 (file)
index 0000000..4bdf0ed
--- /dev/null
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="Workflow:name=generic" id="BD80808080808080808080808080808075C280800122528313869552e41805bb1" version="0.2.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Shut down guest OS and wait</display-name>
+
+    <description>Shuts down a guest operating system and waits for the process to complete.</description>
+
+    <position x="280.0" y="0.0"/>
+
+    <input>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine to shut down</description>
+        </param>
+    </input>
+
+    <attrib name="task" type="VC:Task" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Task to await</description>
+    </attrib>
+    <attrib name="progress" type="boolean" read-only="false">
+        <value encoded="n">false</value>
+        <description>Log progress while waiting for the task</description>
+    </attrib>
+    <attrib name="pollRate" type="number" read-only="false">
+        <value encoded="n">1.0</value>
+        <description>Polling rate for the task state, in seconds</description>
+    </attrib>
+    <attrib name="timeout" type="number" read-only="false">
+        <value encoded="n">10.0</value>
+        <description>Timeout before forcing the shutdown, in minutes</description>
+    </attrib>
+
+    <workflow-item name="item0" out-name="item2" type="custom-condition" alt-out-name="item1">
+        <display-name>Suspended?</display-name>
+
+        <script encoded="false">
+return vm.runtime.powerState.value == "suspended";
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+        </in-binding>
+
+        <position x="240.0" y="50.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" out-name="item3" type="task" script-module="com.vmware.library.vc.vm.power/startVM">
+        <display-name>startVM</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.power").startVM(vm,host) ;
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm">
+                <description>VM to start or resume</description>
+            </bind>
+            <bind name="host" type="VC:HostSystem" explicitly-not-bound="true" export-name="NULL">
+                <description>[Optional] The host where the virtual machine is to be powered on. If no host is specified, the current associated host is used. This field must specify a host that is part of the same compute resource that the virtual machine is currently associated with. If this host is not compatible, the current host association is used.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="VC:Task" export-name="task"/>
+        </out-binding>
+
+        <description>Start / Resume a VM. Return the start task</description>
+
+        <position x="400.0" y="60.0"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item1" type="task" script-module="com.vmware.library.vc.basic/vim3WaitTaskEnd">
+        <display-name>vim3WaitTaskEnd</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ;
+        </script>
+
+        <in-binding>
+            <bind name="task" type="VC:Task" export-name="task">
+                <description>Task to Wait for</description>
+            </bind>
+            <bind name="progress" type="boolean" export-name="progress">
+                <description>Log progess while waiting for the task</description>
+            </bind>
+            <bind name="pollRate" type="number" export-name="pollRate">
+                <description>Polling rate for the task state [seconds]</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="Any" explicitly-not-bound="true" export-name="NULL"/>
+        </out-binding>
+
+        <description>
+Wait a VIM 3 Task to end.
+When task ended, return the
+        </description>
+
+        <position x="400.0" y="140.0"/>
+    </workflow-item>
+
+    <workflow-item name="item1" out-name="item4" type="task" script-module="com.vmware.library.vc.vm.power/shutdownVM">
+        <display-name>shutdownVM</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+System.getModule("com.vmware.library.vc.vm.power").shutdownVM(vm,timeout,polling) ;
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+            <bind name="timeout" type="number" export-name="timeout">
+                <description>Timeout in minutes [min]</description>
+            </bind>
+            <bind name="polling" type="number" export-name="pollRate">
+                <description>Polling rate in seconds [s]</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>Shutdown the VM guest and wait for a given time before throwing an error if the VM is still not powered off. If timeout is set to 0, the action don't wait</description>
+
+        <position x="240.0" y="140.0"/>
+    </workflow-item>
+
+    <workflow-item name="item4" type="end" end-mode="0">
+        <position x="280.0" y="170.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-qual name="autostart">true</p-qual>
+        <p-group>
+            <title>Virtual Machine</title>
+            <desc>Virtual Machine to shutdown.</desc>
+            <p-param name="vm">
+                <desc>Virtual machine to shut down</desc>
+            </p-param>
+        </p-group>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Power Management/Start virtual machine and wait.workflow.xml b/vFLOWER/content/Workflows/Library/vCenter/Virtual Machine management/Power Management/Start virtual machine and wait.workflow.xml
new file mode 100644 (file)
index 0000000..3689939
--- /dev/null
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item1" object-name="Workflow:name=generic" id="BD808080808080808080808080808080CCC280800122528313869552e41805bb1" version="0.3.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
+    <display-name>Start virtual machine and wait</display-name>
+
+    <description>Starts a virtual machine and waits for VMware Tools to start.</description>
+    <ref-types>(VC:VirtualMachine)</ref-types>
+
+    <position x="120.0" y="0.0"/>
+
+    <input>
+        <param name="vm" type="VC:VirtualMachine">
+            <description>Virtual machine to start</description>
+        </param>
+        <param name="host" type="VC:HostSystem">
+            <description>[Optional] The host on which to power on the virtual machine. The host must be part of the same compute resource with which the virtual machine is currently associated. Uses the currently associated host if you do not specify a new host or if you specify an incompatible host.</description>
+        </param>
+    </input>
+
+    <attrib name="task" type="VC:Task" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Task to await</description>
+    </attrib>
+    <attrib name="progress" type="boolean" read-only="false">
+        <value encoded="n">false</value>
+        <description>Log progress while waiting for the task to complete</description>
+    </attrib>
+    <attrib name="pollRate" type="number" read-only="false">
+        <value encoded="n">1.0</value>
+        <description>Polling rate for the task state, in seconds</description>
+    </attrib>
+    <attrib name="timeout" type="number" read-only="false">
+        <value encoded="n">5.0</value>
+        <description>Timeout before throwing a timeout exception, in minutes</description>
+    </attrib>
+
+    <workflow-item name="item1" out-name="item7" type="custom-condition" alt-out-name="item0">
+        <display-name>VM is poweredOn?</display-name>
+
+        <script encoded="false">
+return vm.runtime.powerState.value == "poweredOn";
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
+        </in-binding>
+
+        <position x="80.0" y="50.0"/>
+    </workflow-item>
+
+    <workflow-item name="item7" out-name="item5" type="task" interaction="l">
+        <display-name>Already started</display-name>
+
+        <script encoded="false">
+System.log("VM already started");
+        </script>
+
+        <in-binding/>
+
+        <out-binding/>
+
+        <position x="80.0" y="120.0"/>
+    </workflow-item>
+
+    <workflow-item name="item5" out-name="item2" type="task" script-module="com.vmware.library.vc.vm.tools/vim3WaitToolsStarted">
+        <display-name>vim3WaitToolsStarted</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+System.getModule("com.vmware.library.vc.vm.tools").vim3WaitToolsStarted(vm,pollingRate,timeout) ;
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm">
+                <description>VM in which the action look to get the new DNS Name</description>
+            </bind>
+            <bind name="timeout" type="number" export-name="timeout">
+                <description>Timeout before throwing a timeout exception [minutes]</description>
+            </bind>
+            <bind name="pollingRate" type="number" export-name="pollRate">
+                <description>Time between all request information on the tools [seconds]</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>
+Wait for the VMware tools to be up and the guest running
+
+Exception:
+- Timeout: When timeout is reached
+- ReferenceError: When vm is not setted correctly
+        </description>
+
+        <position x="180.0" y="180.0"/>
+    </workflow-item>
+
+    <workflow-item name="item2" type="end" end-mode="0">
+        <position x="220.0" y="210.0"/>
+    </workflow-item>
+
+    <workflow-item name="item0" out-name="item3" type="task" script-module="com.vmware.library.vc.vm.power/startVM">
+        <display-name>startVM</display-name>
+
+        <script encoded="false">
+//Auto generated script, cannot be modified !
+actionResult = System.getModule("com.vmware.library.vc.vm.power").startVM(vm,host) ;
+        </script>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm">
+                <description>VM to start or resume</description>
+            </bind>
+            <bind name="host" type="VC:HostSystem" export-name="host">
+                <description>[Optional] The host where the virtual machine is to be powered on. If no host is specified, the current associated host is used. This field must specify a host that is part of the same compute resource that the virtual machine is currently associated with. If this host is not compatible, the current host association is used.</description>
+            </bind>
+        </in-binding>
+
+        <out-binding>
+            <bind name="actionResult" type="VC:Task" export-name="task"/>
+        </out-binding>
+
+        <description>Start / Resume a VM. Return the start task</description>
+
+        <position x="280.0" y="60.0"/>
+    </workflow-item>
+
+    <workflow-item name="item3" out-name="item5" type="link" linked-workflow-id="B8808080808080808080808080808080C480808001231146624761b79546544c2">
+        <display-name>Wait for task and answer virtual machine question</display-name>
+
+        <in-binding>
+            <bind name="vm" type="VC:VirtualMachine" export-name="vm">
+                <description>Virtual machine for which the task runs</description>
+            </bind>
+            <bind name="task" type="VC:Task" export-name="task">
+                <description>Task to await</description>
+            </bind>
+        </in-binding>
+
+        <out-binding/>
+
+        <description>Waits for a vCenter task to complete or for the virtual machine to ask a question. If the virtual machine requires an answer, accepts user input and answers the question.</description>
+
+        <position x="280.0" y="120.0"/>
+    </workflow-item>
+
+    <presentation>
+        <p-qual name="autostart" type="boolean"/>
+        <p-group>
+            <title>Virtual Machine</title>
+            <desc>Virtual Machine to start.</desc>
+            <p-param name="vm">
+                <desc>Virtual machine to start</desc>
+                <p-qual name="contextualParameter" type="void"/>
+                <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
+            </p-param>
+            <p-param name="host">
+                <desc>Host on which to power on the virtual machine [Optional]</desc>
+                <p-qual kind="static" name="mandatory" type="boolean">false</p-qual>
+            </p-param>
+        </p-group>
+    </presentation>
+</workflow>
diff --git a/vFLOWER/content/Workflows/uio/VirtProv/ clone VM from DB + linux 2.0.workflow.xml b/vFLOWER/content/Workflows/uio/VirtProv/ clone VM from DB + linux 2.0.workflow.xml
new file mode 100644 (file)
index 0000000..45484f7
--- /dev/null
@@ -0,0 +1,1054 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item7" object-name="Workflow:name=generic" id="13f152b9-bdfe-43ca-9399-47e61cb74022" version="2.0.22" api-version="3.1.0" allowed-operations="fve" restartMode="1" resumeFromFailedMode="0">
+    <display-name>clone VM from DB + linux 2.0</display-name>
+
+    <description>
+This workflow is suposed to be scheduled to run every 5 minutes. It will look for new requests where provisioning type is defined as clone. (!= pxe).
+
+As its possible to run more than one instance of this workflow, we will look for the first row with a distincts search. When the flow returns from builing an vm it will look in the db for aditional requests. If none exists it will terminate.
+
+
+Look for DB entries with status = 5.
+- Crate new VM
+- Add inn BOFH
+- Boot VM
+- and more
+    </description>
+
+    <position x="25.0" y="209.04545454545453"/>
+
+    <attrib name="allVMs" type="Array/SQL:ActiveRecord" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Array of virtual machines</description>
+    </attrib>
+    <attrib name="vmCount" type="number" read-only="false">
+        <value encoded="n">0</value>
+        <description>Number of virtual machines in the resource pool</description>
+    </attrib>
+    <attrib name="currentVM" type="number" read-only="false">
+        <value encoded="n">0</value>
+        <description>Index of the virtual machine in the array of virtual machines</description>
+    </attrib>
+    <attrib name="activeVM" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Virtual machine currently being processed</description>
+    </attrib>
+    <attrib name="errorCode" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Error code</description>
+    </attrib>
+    <attrib name="status" type="number" read-only="false">
+        <value encoded="n">5.0</value>
+        <description>Status in database. Staus 5 = bulk</description>
+    </attrib>
+    <attrib name="vmGuestOs" type="VC:VirtualMachineGuestOsIdentifier" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Guest operating system to use with the virtual machine</description>
+    </attrib>
+    <attrib name="vmFolder" type="VC:VmFolder" read-only="false">
+        <value encoded="n">dunes://service.dunes.ch/CustomSDKObject?id='vcsa-test01.uio.no/group-v22'&amp;dunesName='VC:VmFolder'</value>
+        <description>Virtual machine folder</description>
+    </attrib>
+    <attrib name="vmResourcePool" type="VC:ResourcePool" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Resource pool in which to create the virtual machine</description>
+    </attrib>
+    <attrib name="vmHost" type="VC:HostSystem" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Host on which to create the virtual machine</description>
+    </attrib>
+    <attrib name="vmDiskSize" type="number" read-only="false">
+        <value encoded="n">60.0</value>
+        <description>Size of virtual disk in GB</description>
+    </attrib>
+    <attrib name="vmMemorySize" type="number" read-only="false">
+        <value encoded="n">4096.0</value>
+        <description>Virtual machine's memory size in MB</description>
+    </attrib>
+    <attrib name="vmNbOfCpus" type="number" read-only="false">
+        <value encoded="n">1.0</value>
+        <description>Number of virtual processors</description>
+    </attrib>
+    <attrib name="vmNetwork" type="VC:DistributedVirtualPortgroup" read-only="false">
+        <value encoded="n">dunes://service.dunes.ch/CustomSDKObject?id='vcsa-test01.uio.no/dvportgroup-37'&amp;dunesName='VC:DistributedVirtualPortgroup'</value>
+        <description>The network to connect to</description>
+    </attrib>
+    <attrib name="kort_beskrivelse" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Kort beskrivelse av ny VM</description>
+    </attrib>
+    <attrib name="epostliste" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Mail alias for ny VM</description>
+    </attrib>
+    <attrib name="database" type="SQL:Database" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Pointer to database</description>
+    </attrib>
+    <attrib name="mailto1" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Default mailto parameter</description>
+    </attrib>
+    <attrib name="smtp_server1" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Default SMTP server</description>
+    </attrib>
+    <attrib name="smtp_port1" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Default SMTP port</description>
+    </attrib>
+    <attrib name="viktighet" type="number" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Resource group to add VM into</description>
+    </attrib>
+    <attrib name="folder" type="string" read-only="false">
+        <value encoded="n"/>
+        <description>Folder to store the new VM</description>
+    </attrib>
+    <attrib name="VIM" type="VC:SdkConnection" read-only="false">
+        <value encoded="n">dunes://service.dunes.ch/CustomSDKObject?id='vcsa-test01.uio.no'&amp;dunesName='VC:SdkConnection'</value>
+        <description>Pointer to Vcenter object</description>
+    </attrib>
+    <attrib name="template" type="VC:VirtualMachine" read-only="false">
+        <value encoded="n">dunes://service.dunes.ch/CustomSDKObject?id='vcsa-test01.uio.no/vm-125'&amp;dunesName='VC:VirtualMachine'</value>
+        <description>Virtual machine to clone</description>
+    </attrib>
+    <attrib name="datastore" type="VC:Datastore" read-only="false">
+        <value encoded="n">__NULL__</value>
+        <description>Datastore in which to store the virtual machine. If not specified, the current datastore is used</description>
+    </attrib>
+    <attrib name="dnsServerList" type="Array/string" read-only="false">
+        <value encoded="n">#{#string#129.240.2.27#;#string#129.240.2.40#;#string#129.240.2.3#}#</value>
+        <description>(Optional) List of DNS servers for a virtual network adapter with a static IP address</description>
+    </attrib>
+    <attrib name="dnsDomain" type="string" read-only="false">
+        <value encoded="n">uio.no</value>
+        <description>(Optional) DNS domain suffix such as vmware.com</description>
+    </attrib>
+    <attrib name="gateway" type="Array/string" read-only="false">
+        <value encoded="n">#{#string#129.240.255.193#}#</value>
+        <description>(Optional) List of gateways, in order of preference</description>
+    </attrib>