Assuming your VM (that is running this pyVmomi script) is running some version of Linux you could use something like dmidecode to find the UUID.
import subprocess
from pyVim import connect
proc = subprocess.Popen(["sudo dmidecode|grep UUID|awk '{print $2}'"], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
uuid = out[:-1]
SI = None
SI = connect.SmartConnect(host=ARGS.host,
user=ARGS.user,
pwd=ARGS.password,
port=ARGS.port)
VM = SI.content.searchIndex.FindByUuid(None, uuid,
True,
False)
HOST = VM.runtime.host
print "Host name: {}".format(HOST.name)
What this will do is execute a system command on the Linux box to find the UUID. VMWare uses the BIOS UUID as the default UUID so dmidecode should work here. Next it will connect to a given vSphere host (in this example I assume a vCenter, but an ESXi host should provide the same results here). Next it will search the inventory looking for a VM with a matching UUID. From there it calls the runtime.host method which will return the HostSystem for the VM. Please note due to clustering that host could change.