VMware Guest - Disconnect

Declaration

<AMVMWAREGUEST ACTIVITY="disconnect" SESSION="text" />

Description: Disconnects a VMware guest OS connection and ends a VMware session initially established using the Connect activity.

Practical Usage

Disconnects a currently connected VMware guest operating system connection.

Connection Parameters

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.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

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" />