How to get the name and IP of the host of a VMware virtual machine?
<p>My program is running inside a VMware virtual machine, my purpose is to get some information about the machine which this vm is hosted on.</p>

<p>I've already done some googling and find a library called <code>pyVmomi</code>.</p>

<p>But I still can't figure out how to get the information I want.</p>

<p>The samples are almost all about getting all vms or all hosts, and there is not obvious way I can adapt them for getting information about the <em>current</em> machine.</p>