VMware Host - List Registered VMs

Declaration

<AMVMWAREVM ACTIVITY="list_registeredvms" RESULTDATASET="text" 
SESSION="VMSession2" />

Description: Retrieves information in regards to all registered virtual machines and populates a dataset with the results. Ample information can be gathered, such as path, display name, power state, allocated memory, CPU count and much more.

Practical Usage

Ideally used as a means to manage multiple registered VMs (added to inventory).

Virtual Machine Parameters

Property

Type

Required

Default

Markup

Description

Create and populate dataset with virtual machine information

Text

Yes

(Empty)

RESULTDATASET="theDataset"

The name of the dataset in which to populate with information in regards to the registered virtual machines. 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.

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.CPUCount

Number

Returns the number of processors.

theDataset.IsPaused

True/False

Returns whether the registered VM is paused. True if it paused, false if it is not paused.

theDataset.IsRecording

True/False

Returns true if the registered VM is recording, false if it is not.

theDataset.IsReplaying

True/False

Returns true if the registered VM is replaying, otherwise returns false.

theDataset.IsRunning

True/False

Returns true if the registered VM is running, false if it is not.

theDataset.IsSuspended

True/False

Returns true if the registered VM is suspended, false if it is not.

theDataset.MemorySize

Number

Returns the total memory size allocated to the registered VM.

theDataset.PathName

Text

Returns the path of the registered VM. (Example: [HPvd01_001] WinServer2008x64_1/WinServer2008x64.vmx)

theDataset.PowerState

Number

Returns the power state of the registered VM.

theDataset.Description

Text

Returns a description of the registered VM.

theDataset.DisplayName

Text

Returns the display name associated to the registered VM.

theDataset.IsReplayable

True/False

Returns true if the registered VM is replayable, false if not.

theDataset.Path

Text

Returns the path of the registered VM.

Expressions, Variables and Functions

All text fields allow the use of expressions such as variables, functions or 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 theInsert Expression (%)button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions

More on the expression builder

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Get list of registered virtual machines and store it into dataset "theDataset". Use default VM session.

<AMVMWAREVM ACTIVITY="list_registeredvms" 
RESULTDATASET="theDataset" />