Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access virtual machine host information #28

Open
ThreepE0 opened this issue Mar 16, 2018 · 0 comments
Open

How to access virtual machine host information #28

ThreepE0 opened this issue Mar 16, 2018 · 0 comments

Comments

@ThreepE0
Copy link

ThreepE0 commented Mar 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant