VMware Host - Create Snapshot
Declaration
<AMVMWAREVM ACTIVITY="create_snapshot" VMPATH="text" SNAPNAME="text" SNAPDESC="text" TIMEOUT="number" OPENVMTIMEOUT="number" INCLUDEMEMORY="yes/no" HOSTTYPE="text (options)" SERVER="text" USERNAME="text" PASSWORD="text" />
Description: Creates a snapshot of an existing virtual machine. A snapshot records virtual machine conditions at the time of the snapshot, including the virtual machine's power state and data written to virtual disks. To revert to a snapshot, use the Revert to Snapshot action.
Practical Usage
Useful for performing backups. Also useful for check pointing virtual machine states, for example in a test laboratory where you require specific settings for given test conditions.
Connection Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Connection |
|
|
|
|
Indicates where this activity's connection properties should originate from. Different parameters become active depending on the option selected. This is a visual parameter used only during design-time, therefore, contains no properties or markups. The available options are:
|
Session |
Text |
Yes if Connection set to Session |
VMOpsSession1 |
SESSION="VMO101" |
The name of a session (created in a previous step) in which to link this activity. This parameter is active only if the Connection parameter is set to Session. |
Host type |
Text (options) |
Yes if Connection set to Host |
VIServer |
|
The type of VM host to establish a connection with. This parameter is active only if the Connection parameter is set to Host. The available options are:
|
Host name |
Text |
Yes |
(Empty) |
SERVER="host.server.com" |
The hostname 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 |
No |
(Empty) |
USERNAME="MsPacman" |
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 |
No |
(Empty) |
PASSWORD="encrypted" |
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. |
Connection Timeout (seconds) |
Number |
No |
60 |
CONNECTIONTIMEOUT="20" |
The maximum time out value in seconds that this activity should wait for a response from the host. |
Virtual Machine
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Virtual machine path |
Text |
Yes |
(Empty) |
VMPATH="C:\VMFolder\VMfile.vmx" |
The path of the virtual machine configuration (.vmx) file in which to create a snapshot of. This parameter varies by product platform. With ESX/ESXi hosts and VMware Server 2.0, use a URL of the form "https://<hostName>:<port>/sdk" where <hostName> is either the DNS name or IP address, and <port> might be optional; credentials are required even for connections made locally. With VMware Workstation, use undef to connect to the local host. With VMware Server 1.0.x, use a DNS name or IP address for remote connections, or the same as Workstation for local connections. |
Name |
Text |
No |
(Empty) |
SNAPNAME="Snapshot3" |
A user-defined name for the snapshot. |
Description |
Text |
No |
(Empty) |
SNAPDESC="Backup" |
A user-defined description for the snapshot. |
Include memory |
Yes/No |
No |
No |
INCLUDEMEMORY="yes" |
Specifies whether to include |
Timeout (seconds) |
Number |
No |
60 |
TIMEOUT="5" |
The time out value in seconds that this activity should wait for a response from the host. |
Open VM timeout (seconds) |
Number |
No |
60 |
OPENVMTIMEOUT="5" |
The maximum time period in seconds during which this activity must successfully connect to the specified VMware product or the task times out. |
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: Create snapshot "myVirtualMachine" of virtual machine "F:\Virtual Machines\Windows 7 x86\Windows 7.vmx". Snapshot description is "Create a snapshot". Capture the full state of a running virtual machine, including the memory. Use default VM session.
<AMVMWAREVM ACTIVITY="create_snapshot" VMPATH="F:\Virtual Machines\Windows 7 x86\Windows 7.vmx" SNAPNAME="myVirtualMachine" SNAPDESC="Create a snapshot" INCLUDEMEMORY="yes" />