Skip to content

How to access virtual machine host information #28

@ThreepE0

Description

@ThreepE0

Trying to figure out how to get information about the host for a given virtual machine.

Tried:
$virtualMachines = $vhost->findAllManagedObjects('VirtualMachine', array('parent', 'name', 'guest'));
but accessing $vm->parent or $vm->host or $vm->hostSystem doesn't get me to the eSXI machine running the vm.

Tried:
$hosts = $vhost->findAllManagedObjects('HostSystem', array('name')); foreach($hosts as $host){ echo '<h1>'.$host->name.'</h1>'; var_dump($host->findAllManagedObjects('VirtualMachine', array('parent', 'name', 'guest')); }
But it doesn't look like running 'findAllManagedObjects' on the host is supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions