VMware {code} Community
jusemancio
Contributor
Contributor
Jump to solution

VCenter Inventory

Good morning,

for my degree thesis i need to print the complete Vcenter (VSphere5.0) inventory whit java.  I'm using the SDK example "browser" but i can't associate which VMs belong to Hosts. How can i associate VMs to Hosts? Thank you very much since now.

giuseppe

0 Kudos
1 Solution

Accepted Solutions
togtog
Hot Shot
Hot Shot
Jump to solution

Hi Giuseppe!

How can i associate VMs to Hosts?


I have not even taken a look at example "browser" but here a quick pointer, maybe it helps:

Managed Object VirtualMachine provides a nested property pointing to the host system responsible for running the virtual machine in question as follows

VM.runtimeinfo.host

The other way arround would be via Managed Object HostSystem as follows

HS.vm[]

Hope this helps and good luck with your thesis 😉

Thomas G.

View solution in original post

0 Kudos
4 Replies
togtog
Hot Shot
Hot Shot
Jump to solution

Hi Giuseppe!

How can i associate VMs to Hosts?


I have not even taken a look at example "browser" but here a quick pointer, maybe it helps:

Managed Object VirtualMachine provides a nested property pointing to the host system responsible for running the virtual machine in question as follows

VM.runtimeinfo.host

The other way arround would be via Managed Object HostSystem as follows

HS.vm[]

Hope this helps and good luck with your thesis 😉

Thomas G.
0 Kudos
sivadevel
Enthusiast
Enthusiast
Jump to solution

Hi,

The hierarchy is like this if it is a Esx host.

Folder -> Data Center -> Host -> VMs.

For a vCenter the hierarchy could be(Could be because Cluster should be configured by you).

Folder -> Data Center -> Cluster -> Host -> VMs

With the IP and credentials you can derive the folder and rest is just a child entity to the object each object. Let me know if you need more details.

./Siva.,

jusemancio
Contributor
Contributor
Jump to solution

Thank you very much to all!

giuseppe

0 Kudos
togtog
Hot Shot
Hot Shot
Jump to solution

Hi Giuseppe!

You are welcome and thanks for awarding points.

Thomas G.
0 Kudos