VMware Guest - Disconnect |
<AMVMWAREGUEST ACTIVITY="disconnect" SESSION="text" /> |
Description:
Disconnects a VMware guest OS connection and ends a VMware session initially established using the Connect activity.
Disconnects a currently connected VMware guest operating system connection.
Connection
Property |
Type |
Required |
Default |
Markup |
Description |
Session |
Text |
No |
GuestOSOpsSession1 |
SESSION="MySession" |
The session name associated to the guest OS connection to disconnect. Disconnecting an existing connection also ends the session associated with that connection. |
NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder. |
Description: This task uses several VMware Guest OS activities. It creates a session using the Connect activity, logs onto the guest VMware using the Login activity, and checks if a specific guest file exists on the host using the File Exists activity. If the guest file exists, it is copied over to the host machine using the Copy activity. The task ends with a Disconnect step. Comments are included in the task to explain each step.
<AMVARIABLE NAME="myVar"></AMVARIABLE> <!-- Create a guest session. --> <AMVMWAREGUEST ACTIVITY="connect" HOSTTYPE="Workstation" VMPATH="C:\Users\Username\Documents\Virtual Machines\Windows Server 2008 x86\Windows Server 2008 (experimental).vmx" GUESTUSERNAME="Techsupport" GUESTPASSWORD="AM1ag7WmWg7U1xbulaHHhbEOLvMrSDiPrC4aME" CONSOLE="yes" LAUNCHGUI="yes" OPENVMTIMEOUT="90" POWERONTIMEOUT="90" /> <!-- Log onto guest. --> <AMVMWAREGUEST ACTIVITY="login" LOGINUSERNAME="Techsupport" LOGINPASSWORD="AM1ag7WmWg7U1xbulaHHhbEOLvMrSDiPrC4aME" LOGINCONSOLE="yes" TIMEOUT="3000" /> <!-- Check if a specific guest file exists. --> <AMVMWAREGUEST ACTIVITY="file_exists" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" RESULTVARIABLE="myVar" /> <!-- If guest file exists, copy it over to the host machine. --> <AMIF EXPRESSION="%myVar% = True"> <AMVMWAREGUEST COPYFROM="guest_to_host" GUESTFILE="C:\Users\techsupport\Desktop\hello.txt" HOSTFILE="C:\Users\techsupport\Desktop\hello.txt" /> </AMIF> <!-- Close Connection --> <AMVMWAREGUEST ACTIVITY="disconnect" />
|