VM Operations - List Snapshots

Declaration

<AMVMWAREVM ACTIVITY="list_esnapshots" VMPATH="text" RESULTDATASET="text (dataset name)" TIMEOUT="number" />

See Also

VM Operations - Clone, VM Operations - Connect, VM Operations - Create Snapshot, VM Operations - Delete, VM Operations - Delete Snapshot, VM Operations - Disconnect, VM Operations - Install Tools, VM Operations - List Registered VMs, VM Operations - List Running VMs, VM Operations - List Snapshots, VM Operations - Pause, VM Operations - Power Off, VM Operations - Power On, VM Operations - Register VMs, VM Operations - Reset, VM Operations - Revert to Snapshots, VM Operations - Suspend, VM Operations - Unregister VM

Description

Gathers information about existing VM snapshots and populates a dataset with the results.

Practical Usage

See Description.

Parameters

Virtual Machine Properties

Property

Type

Required

Default

Markup

Description

Virtual machine path

Text

Yes

(Empty)

VMPATH="C:\VMFolder\VMfile.vmx"

The absolute path of the virtual machine configuration (.vmx) file in which to gather snapshots. 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.

Timeout (seconds)

Number

No

(Empty)

TIMEOUT="50"

The time out value in seconds that this activity should wait for a response from the host.

Create and populate dataset with Virtual Machine information

Text

Yes

(Empty)

RESULTDATASET="theDataset"

The name of the dataset in which to create and populate with the list of VM snapshots. More details regarding the fields that this dataset creates can be found below under Notes.

 

Connection Properties

These properties allow you to create a custom connection for this activity or link it to a session previously established (using the Connect activity) that contains pre-defined connection parameters.

Property

Type

Required

Default

Markup

Description

Provide Connection

 

 

 

 

Indicates where this activity's connection should originate from. Different parameters become active depending on the option selected. The available options are:

  • Custom (Default) - A custom set of credentials will be entered for this activity. Select this option if performing a single operation.

  • Session Based - Credentials should derive from a session created in a previous step with the use of the Connect activity. This allows several operations to be linked to a single session, eliminating redundancy. Multiple sessions can exist in a single task.

Host Type

Text (options)

Yes

VIServer

HOSTTYPE="Workstation"

The type of VM host to establish a connection with. The available options are:

  • VMware Server (1.0x)

  • VMware Workstation

  • VMware VI Server (ESX/ESXi, vCenter, VMware Server 2.0)(Default)

  • VMware Player

This parameter is active only if the Provide Connection parameter is set to Custom.

Host

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

No

(Empty)

USERNAME="theUser"

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="AM1DWVc+PAIZ6"

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

(Empty)

CONNECTIONTIMEOUT="20"

The maximum time out value in seconds that this activity should wait for a response from the host.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the dataset assigned is named theDataset).

Name

Type

Return Value

theDataset.Description

Text

Returns a description of the snapshot.

theDataset.DisplayName

Text

Returns the display name associated to the snapshot.

theDataset.IsReplayable

True/False

Returns true if the snapshot is replayable, false if not.

theDataset.Path

Text

Returns the path of the snapshot.

theDataset.PowerState

Number

Returns the power state of the snapshot.

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or AutoMate extended functions, which can be entered by surrounding the expression in percentage signs (example: %FileDateTime(myVar)% or %myVar%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on function

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample task populates a dataset with the list of available snapshots. It then loops through the dataset and displays the display name associated to each snapshot in a message box.

 

<AMVMWAREVM ACTIVITY="connect" HOSTTYPE="VIServer" SERVER="209.223.157.77" USERNAME="root" PASSWORD="AM1hd66umsQRtNbulaHHhbEOBF423belTvAaME" />

<AMVMWAREVM ACTIVITY="list_snapshots" VMPATH="[HPvd01_001] Win7x86_1/Win7x86.vmx" RESULTDATASET="theDataset" />

<AMLOOP TYPE="DATASET" DATASET="theDataset">

     <AMMESSAGEBOX>%theDataset.DisplayName%</AMMESSAGEBOX>

</AMLOOP>

<AMVMWAREVM ACTIVITY="disconnect" />

 

↑ Top of Page