VMware Host - Disconnect
Declaration
<AMVMWAREVM ACTIVITY="disconnect" SESSION="text" />
Description
Disconnects a virtual machine connection and ends a previously established session.
Practical usage
See Description.
Parameters
Connection
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Session | Text | Yes | (Empty) | SESSION="VMSession2" | The name of the session in which to disconnect. |
Example
NOTE:
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task creates a VM session, powers on a VM image and creates a VM snapshot. Thereafter, it powers off the VM image and disconnects the VM connection. Comments are embedded to provide details about each operation.
Copy
<!-- Create virtual machine connection of host type "Workstation" / Create and start session named "VMOpsSession1" -->
<AMVMWAREVM ACTIVITY="connect" HOSTTYPE="Workstation" SESSION="VMOpsSession1" />
<!-- Power on virtual OS image -->
<AMVMWAREVM SESSION="VMOpsSession1" VMPATH="F:\Virtual Machines\Windows Server 2008 x64\Windows Server 2008 x64 .vmx" LAUNCHGUI="YES" />
<!-- Create a snapshot -->
<AMVMWAREVM ACTIVITY="create_snapshot" SESSION="VMOpsSession1" VMPATH="F:\VirtualMachines\Windows 10 x86\Windows 10.vmx" SNAPNAME="Test_Snapshot" SNAPDESC="Createasnapshot" INCLUDEMEMORY="YES" />
<!-- Power off virtual machine -->
<AMVMWAREVM ACTIVITY="poweroff_vm" SESSION="VMOpsSession1" VMPATH="F:\Virtual Machines\Windows 10 x86\Windows 10.vmx" TIMEOUT="3" OPENVMTIMEOUT="3" SOFT="YES" TOOLSTIMEOUT="3" />
<!-- Disconnect virtual machine connection / End session -->
<AMVMWAREVM ACTIVITY="disconnect" SESSION="VMOpsSession1" />