VMware {code} Community
helpmeforvmware
Contributor
Contributor

How to identify parent server of a VM ?

hi

I am looking out for a certain way which can be used to identify the parent server of a VM within VM.

Parent server means the server on which particular Virtual Machine is hosted/deployed.

Suppose the VM name is WinVista and it is hosted on Xen server named Xen40; So i what to know that VM Win Vista is hosted on Xen40 server.

is there any CLI utility / file on VM or server / api call which can help ?

thanks in advance.

Reply
0 Kudos
2 Replies
admin
Immortal
Immortal

To identify the server/ESX where the VM is running, you can refer to the VM.runtime.host.name property. This would fetch the name of the Host which runs the particular VM.

I hope this was info which you were looking for, else please correct me!

- Angela

Reply
0 Kudos
helpmeforvmware
Contributor
Contributor

Thanks AngelaS,

I want to know it from within the VM. Suppose i have an application which is running on a VM name it as VM-A, now this application is basically uses VMwase WebService SDK to operate on VMs, now suppose there is a action to stop all vms running on Host let say Host-X, now while stopping all VMs it should not stop VM-A, since i m running my application on it; and my application doesn't know that its running on a VM or on a standalone machine. So i need to bypass the action on VM-A which is running my application. Using some utility i am able know that my application is running on VM, but now the challenge is know the host server.

Thanks & Regards.

Reply
0 Kudos