VM Operations - List Registered VMs

 

Declaration

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

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

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

Parameters

Virtual Machine Properties

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.

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.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 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: Get list of registered virtual machines and store it into dataset "theDataset". Use default VM session.

 

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

 

↑ Top of Page