Sometimes an administrator may need to match a MAC address to a specific virtual machine. For example, if an ARP request gets two different responses, or different clients resolve the same IP address to different MAC addresses, usually caused by a duplicate IP address in use in an environment.
vCenter 8.0
vCenter 7.0
Duplicate IP address usage can result in the same IP address resolving to different MAC addresses as both NICs respond to the ARP request.
To identify the owner of a specific MAC address, execute the following at a BASH prompt on your vCenter Server Appliance:
/opt/vmware/vpostgres/current/bin/psql -h localhost -U postgres -d VCDB -c "select e.name as vm_name, n.mac_address as mac_address, e.id as vm_id, v.file_name as vm_file, h.dns_name as esxi_name, h.ip_address as esxi_ip from vpx_entity e, vpx_vm v, vpx_host h, vpx_nic n where e.id=(select entity_id from vpx_nic where mac_address='00:0c:29:##:##:##') and v.id=e.id and v.id=n.entity_id and v.host_id=h.id;"
You should receive output similar to the following showing the name and ID of the VM along with the path to the VM files and details of the ESXi host which is currently hosting the VM:
vm_name | mac_address | vm_id | vm_file | esxi_name | esxi_ip----------+-------------------+-------+-----------------------------------------------------------+----------------+--------------- Your_VM | 00:0c:29:##:##:## | X | ds:///vmfs/volumes/datastore_UUID/Folder_name/Your_VM.vmx | esxi_host_fqdn | ###.###.###.###