første xml update
[virt-orchestrator.git] / vFLOWER / content / Workflows / Library / vCenter / Virtual Machine management / Power Management / Start virtual machine and wait.workflow.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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">
3     <display-name>Start virtual machine and wait</display-name>
4
5     <description>Starts a virtual machine and waits for VMware Tools to start.</description>
6     <ref-types>(VC:VirtualMachine)</ref-types>
7
8     <position x="120.0" y="0.0"/>
9
10     <input>
11         <param name="vm" type="VC:VirtualMachine">
12             <description>Virtual machine to start</description>
13         </param>
14         <param name="host" type="VC:HostSystem">
15             <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>
16         </param>
17     </input>
18
19     <attrib name="task" type="VC:Task" read-only="false">
20         <value encoded="n">__NULL__</value>
21         <description>Task to await</description>
22     </attrib>
23     <attrib name="progress" type="boolean" read-only="false">
24         <value encoded="n">false</value>
25         <description>Log progress while waiting for the task to complete</description>
26     </attrib>
27     <attrib name="pollRate" type="number" read-only="false">
28         <value encoded="n">1.0</value>
29         <description>Polling rate for the task state, in seconds</description>
30     </attrib>
31     <attrib name="timeout" type="number" read-only="false">
32         <value encoded="n">5.0</value>
33         <description>Timeout before throwing a timeout exception, in minutes</description>
34     </attrib>
35
36     <workflow-item name="item1" out-name="item7" type="custom-condition" alt-out-name="item0">
37         <display-name>VM is poweredOn?</display-name>
38
39         <script encoded="false">
40 return vm.runtime.powerState.value == "poweredOn";
41         </script>
42
43         <in-binding>
44             <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
45         </in-binding>
46
47         <position x="80.0" y="50.0"/>
48     </workflow-item>
49
50     <workflow-item name="item7" out-name="item5" type="task" interaction="l">
51         <display-name>Already started</display-name>
52
53         <script encoded="false">
54 System.log("VM already started");
55         </script>
56
57         <in-binding/>
58
59         <out-binding/>
60
61         <position x="80.0" y="120.0"/>
62     </workflow-item>
63
64     <workflow-item name="item5" out-name="item2" type="task" script-module="com.vmware.library.vc.vm.tools/vim3WaitToolsStarted">
65         <display-name>vim3WaitToolsStarted</display-name>
66
67         <script encoded="false">
68 //Auto generated script, cannot be modified !
69 System.getModule("com.vmware.library.vc.vm.tools").vim3WaitToolsStarted(vm,pollingRate,timeout) ;
70         </script>
71
72         <in-binding>
73             <bind name="vm" type="VC:VirtualMachine" export-name="vm">
74                 <description>VM in which the action look to get the new DNS Name</description>
75             </bind>
76             <bind name="timeout" type="number" export-name="timeout">
77                 <description>Timeout before throwing a timeout exception [minutes]</description>
78             </bind>
79             <bind name="pollingRate" type="number" export-name="pollRate">
80                 <description>Time between all request information on the tools [seconds]</description>
81             </bind>
82         </in-binding>
83
84         <out-binding/>
85
86         <description>
87 Wait for the VMware tools to be up and the guest running
88
89 Exception:
90 - Timeout: When timeout is reached
91 - ReferenceError: When vm is not setted correctly
92         </description>
93
94         <position x="180.0" y="180.0"/>
95     </workflow-item>
96
97     <workflow-item name="item2" type="end" end-mode="0">
98         <position x="220.0" y="210.0"/>
99     </workflow-item>
100
101     <workflow-item name="item0" out-name="item3" type="task" script-module="com.vmware.library.vc.vm.power/startVM">
102         <display-name>startVM</display-name>
103
104         <script encoded="false">
105 //Auto generated script, cannot be modified !
106 actionResult = System.getModule("com.vmware.library.vc.vm.power").startVM(vm,host) ;
107         </script>
108
109         <in-binding>
110             <bind name="vm" type="VC:VirtualMachine" export-name="vm">
111                 <description>VM to start or resume</description>
112             </bind>
113             <bind name="host" type="VC:HostSystem" export-name="host">
114                 <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>
115             </bind>
116         </in-binding>
117
118         <out-binding>
119             <bind name="actionResult" type="VC:Task" export-name="task"/>
120         </out-binding>
121
122         <description>Start / Resume a VM. Return the start task</description>
123
124         <position x="280.0" y="60.0"/>
125     </workflow-item>
126
127     <workflow-item name="item3" out-name="item5" type="link" linked-workflow-id="B8808080808080808080808080808080C480808001231146624761b79546544c2">
128         <display-name>Wait for task and answer virtual machine question</display-name>
129
130         <in-binding>
131             <bind name="vm" type="VC:VirtualMachine" export-name="vm">
132                 <description>Virtual machine for which the task runs</description>
133             </bind>
134             <bind name="task" type="VC:Task" export-name="task">
135                 <description>Task to await</description>
136             </bind>
137         </in-binding>
138
139         <out-binding/>
140
141         <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>
142
143         <position x="280.0" y="120.0"/>
144     </workflow-item>
145
146     <presentation>
147         <p-qual name="autostart" type="boolean"/>
148         <p-group>
149             <title>Virtual Machine</title>
150             <desc>Virtual Machine to start.</desc>
151             <p-param name="vm">
152                 <desc>Virtual machine to start</desc>
153                 <p-qual name="contextualParameter" type="void"/>
154                 <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
155             </p-param>
156             <p-param name="host">
157                 <desc>Host on which to power on the virtual machine [Optional]</desc>
158                 <p-qual kind="static" name="mandatory" type="boolean">false</p-qual>
159             </p-param>
160         </p-group>
161     </presentation>
162 </workflow>