Name

FindRunningVMs

Description

@vmlist = FindRunningVMs($hostHandle, $timeoutInSeconds);

Returns the virtual machines running on the host associated with hostHandle. The first element in the list is an error code.

Parameters

hostHandle
The host handle returned by HostConnect().

timeoutInSeconds
must be -1.

Return Value

A list, with an error code as the first entry, and running Virtual Machine names following.

Remarks

FindRunningVMs() is a shortcut to FindItems($hostHandle, VIX_FIND_RUNNING_VMS, $timeoutInSeconds)

Side Effects

None.

Requirements

use VMware::Vix::Simple;
use VMware::Vix::API::Constants;

Example

my @vms = FindRunningVMs($hostHandle, 100);
my $err = shift @vms;
die "Error $err finding running VMs ", GetErrorText($err),"\n" if $err != VIX_OK;

print "VMs: @vms\n";

Copyright (C) 2007-2011 VMware, Inc. All rights reserved.