Sometimes we need to know on which host is running a VM.
Is always a pain to discover this when you don’t have your vCenter running.
You can check the VM logs etc.,(looking for something similar to 2012-10-10T02:04:01.999Z| vmx| Hostname=name_of_host)
In my opinion, the best option is just run a query directly in the vCenter DB.
Just run this simple query in the vCenter DB(should be VIM_VCDB, or just VCDB)
SELECT vpxv_vms.vmid, vpxv_vms.NAME, vpxv_vms.hostid, vpxv_hosts.NAME
FROM vpxv_vms
JOIN vpxv_hosts on VPXV_VMS.HOSTID = VPXV_HOSTS.HOSTID
WHERE (
(vpxv_hosts.hostid = vpxv_vms.hostid)
AND (vpxv_vms.NAME = ‘virtual_machine_name’)
)
This will give you in a simple line the VM and the host that is running.
Note: Check VMware KB2004187 for more details
Hope this can help.
Note: Share this article, if you think is worth sharing.
Leave A Comment
You must be logged in to post a comment.