|
VMware Host - Connect |
Declaration
<AMVMWAREVM ACTIVITY="connect" SESSION="text" HOSTTYPE="text (options)" SERVER="text" USERNAME="text" PASSWORD="text" CONNECTIONTIMEOUT="number" /> |
Description
Connects to the specified host and creates a session in which to associate subsequent VM steps. This activity allows simultaneous connections within a single task using the same username/password. If the virtual machine is on a host running VMware Server, you can connect to that host whether it is a local or remote host. VMware Workstation currently allows you to manipulate virtual machines only from the local host.
Practical Usage
Essentially used to connect to an arbitrary host using the name of the host machine, along with a user name and password identifying a valid user account on the machine. This allows you to access any networked host machine that is running VMware Server from a single client machine.
Parameters
Connection
Property |
Type |
Required |
Default |
Markup |
Description |
Host type |
Text (options) |
Yes |
VMware VI Server |
|
Specifies the VMware software running on the host where the virtual machine is located. The available options are:
|
Host name |
Text |
Yes |
(Empty) |
SERVER="host.server.com" |
The host name or IP address of the computer where the virtual machine is located. This parameter is active only if the Host Type parameter is set to VMware Server or VMware VI Server. |
Username |
Text |
Yes |
(Empty) |
USERNAME="brucelee" |
The username identifying a valid user account on the machine. This parameter is active only if the Host Type parameter is set to VMware Server or VMware VI Server. |
Password |
Text |
Yes |
(Empty) |
PASSWORD="password" |
The password identifying a valid user account on the machine. This parameter is active only if the Host Type parameter is set to VMware Server or VMware VI Server. |
Session |
Text |
Yes |
VMOpsSession1 |
SESSION="VMSession3" |
The name of the session in which to identify this connection. This allows several VMware activities to be linked to a specific session. Numerous sessions can be used within a single task. The default session name is VMOpsSession1. |
Connection timeout |
Number |
No |
60 |
CONNECTIONTIMEOUT="50" |
The maximum time period in seconds during which a connection must be established between the guest and host, otherwise, the step times out. The default value is 60 seconds. |
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
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.
<!-- 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\Windows7 x86\Windows 10.vmx" TIMEOUT="3" OPENVMTIMEOUT="3" SOFT="YES" TOOLSTIMEOUT="3" />
<!-- Disconnect virtual machine connection / End session -->
<AMVMWAREVM ACTIVITY="disconnect" SESSION="VMOpsSession1" />