Find which ESXi host a VM is on

Posted by robd on April 21, 2016

To identify the host on which the virtual machine runs, use one of these methods:


Query the vCenter Server database in MSSQL:

  1. Log in to to the Microsoft SQL 2005/2008 Server as an administrator.
  2. Open SQL Management Studio.
  3. Right-click the database that vCenter Server is using.
  4. Open a new query window and ensure that the vCenter Server database is selected.
  5. Run this SQL statement :
    SELECT vpxv_vms.vmid, vpxv_vms.NAME, vpxv_vms.hostid, vpxv_hosts.NAME
    FROM vpxv_vms
    WHERE (
    (vpxv_hosts.hostid = vpxv_vms.hostid)
    AND (vpxv_vms.NAME = '<b><em>virtual_machine_name</em></b>')

    This query returns the virtual machine ID, virtual machine name, host ID, and host name.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.