VMware {code} Community
nishtek
Contributor
Contributor

getting esxi information from vm

Hi all.

i want to find the host information from vm's info.

right now i have the object id of a VM. i want to find the host's MORef  to do some processing.

i guess there will be some top->down approach will be there but it will be good to have some bottom->up approach where i can directly use vm's data to find host's info(MORef or ObjectID).

any lead in this regard will be helpful.

thanks in advance,

Nishchay

0 Kudos
5 Replies
keshavkant
Enthusiast
Enthusiast

Hi

C:\Program Files\VMware\VMware Tools\VMwareToolboxCmd.exe This utility provide some information about ESX(i) and guestOS configuration including basic resource statistics.

0 Kudos
nishtek
Contributor
Contributor

Hi keshavkant,

thanks for your reply, but this is not exactly what i want.

i want to get the esxi host information like host Object ID or its MORef using the VM"s object id.

@all-> any help in this regard.

Thanks

Nishchay

0 Kudos
stumpr
Virtuoso
Virtuoso

You'll need some identifier from the GuestOS (HW UUID, IP Address).  Then you can query for that VM in the vCenter API.  Once you have the VM, you can get the current HostSystem of that VM from *runtime.host*.

Reuben Stump | http://www.virtuin.com | @ReubenStump
0 Kudos
nishtek
Contributor
Contributor

thanks stumpr ,

that helped

0 Kudos
kumoh123
Contributor
Contributor

Hi stumpr,

I have similar problem. This VMware vCloud Suite SDK for REST for vSphere 6.0 was downloaded. But I am still confused how to configure it.

FYI, I want to collect information by regularly. Could you please help me?

Regards

Yoga T

0 Kudos