]> git.uio.no Git - virt-orchestrator.git/blob - vFLOWER/content/Workflows/Library/vCenter/Guest operations/Processes/Run program in guest.workflow.xml
første endring registrert
[virt-orchestrator.git] / vFLOWER / content / Workflows / Library / vCenter / Guest operations / Processes / Run program in guest.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="C98080808080808080808080808080805E80808001322751030482b80adf61e7c" version="0.0.0" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
3     <display-name>Run program in guest</display-name>
4
5     <description>
6 Starts a program in the guest operating system.
7 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.
8     </description>
9
10     <position x="100.0" y="50.0"/>
11
12     <input>
13         <param name="vmUsername" type="string">
14             <description>Username for the virtual machine</description>
15         </param>
16         <param name="vmPassword" type="SecureString">
17             <description>Password for the virtual machine</description>
18         </param>
19         <param name="vm" type="VC:VirtualMachine">
20             <description>Virtual machine</description>
21         </param>
22         <param name="interactiveSession" type="boolean">
23             <description>This is set to true if the client wants an interactive session in the guest.</description>
24         </param>
25         <param name="programPath" type="string">
26             <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>
27         </param>
28         <param name="arguments" type="string">
29             <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>
30         </param>
31         <param name="workingDirectory" type="string">
32             <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>
33         </param>
34         <param name="environment" type="Array/string">
35             <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>
36         </param>
37     </input>
38
39     <output>
40         <param name="result" type="number">
41             <description>The pid of the program started.</description>
42         </param>
43     </output>
44
45     <workflow-item name="item0" type="end" end-mode="0">
46         <position x="384.5" y="45.40909090909091"/>
47     </workflow-item>
48
49     <workflow-item name="item1" out-name="item0" type="task">
50         <display-name>Scriptable task</display-name>
51
52         <script encoded="false">
53 var host = vm.sdkConnection;
54
55 var guestOperationsManager = host.guestOperationsManager;
56 var guestAuth = new VcNamePasswordAuthentication();
57 guestAuth.username = vmUsername;
58 guestAuth.password = vmPassword;
59 guestAuth.interactiveSession = interactiveSession;
60
61 var guestProgramSpec = new VcGuestProgramSpec();
62 guestProgramSpec.programPath = programPath;
63 guestProgramSpec.arguments = arguments;
64 guestProgramSpec.workingDirectory = workingDirectory;
65 guestProgramSpec.envVariables = environment;
66
67 var processManager = guestOperationsManager.processManager;
68 result = processManager.startProgramInGuest(vm , guestAuth , guestProgramSpec);
69         </script>
70
71         <in-binding>
72             <bind name="vmUsername" type="string" export-name="vmUsername"/>
73             <bind name="vmPassword" type="SecureString" export-name="vmPassword"/>
74             <bind name="vm" type="VC:VirtualMachine" export-name="vm"/>
75             <bind name="programPath" type="string" export-name="programPath"/>
76             <bind name="arguments" type="string" export-name="arguments"/>
77             <bind name="workingDirectory" type="string" export-name="workingDirectory"/>
78             <bind name="environment" type="Array/string" export-name="environment"/>
79             <bind name="interactiveSession" type="boolean" export-name="interactiveSession"/>
80         </in-binding>
81
82         <out-binding>
83             <bind name="result" type="number" export-name="result"/>
84         </out-binding>
85
86         <position x="204.5" y="55.40909090909091"/>
87     </workflow-item>
88
89     <presentation>
90         <p-param name="vmUsername">
91             <desc>Username for the virtual machine</desc>
92         </p-param>
93         <p-param name="vmPassword">
94             <desc>Password for the virtual machine</desc>
95         </p-param>
96         <p-param name="vm">
97             <desc>Virtual machine</desc>
98             <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
99         </p-param>
100         <p-param name="interactiveSession">
101             <desc>Set to 'Yes' if you want an interactive session in the guest.</desc>
102         </p-param>
103         <p-group>
104             <title>Program path</title>
105             <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>
106             <p-param name="programPath">
107                 <desc>Program path</desc>
108                 <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
109             </p-param>
110         </p-group>
111         <p-group>
112             <title>Arguments</title>
113             <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>
114             <p-param name="arguments">
115                 <desc>Arguments</desc>
116             </p-param>
117         </p-group>
118         <p-group>
119             <title>Working directory</title>
120             <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>
121             <p-param name="workingDirectory">
122                 <desc>Working directory</desc>
123             </p-param>
124         </p-group>
125         <p-group>
126             <title>Environment</title>
127             <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>
128             <p-param name="environment">
129                 <desc>Environment</desc>
130             </p-param>
131         </p-group>
132     </presentation>
133 </workflow>