VMware Support Community
chubbarabia
Contributor
Contributor

Locate the vmware vm from the mac address

greetings,,,

kindly advise,

I have a mac address flapping between the core switches, so I went thru many articles to know from the mac address how can I know the vm name or IP address,

I was trying to use the below command from the Esxi:

find /vmfs/volumes/ | grep .vmx$ | while read i; do grep -i "0e:00:70:3b:58:ac" "$i" && echo "$i"; done

but it bounced back the attached error, I think because it's connected to SAN storage,

even, I have tried=d to execute the command in vCenter cli:

select * from VPX_NIC where MAC_ADDRESS = '00:50:56:xx:yy:zz';

again it's bounced back an error that "from" is not valid

 

please advise urgently,

thanks

chubbarabia_0-1641368071560.png

 

0 Kudos
2 Replies
fabio1975
Commander
Commander

Ciao 

I suggest you use PowerCLI whit this command:

 

$cred = Get-Credential

Connect-ViServer <vcenter or ESXi> -Credential $cred

Get-VM | Get-NetworkAdapter | Where {$_.MacAddress -eq "00:50:56:86:04:9b"} | Select-Object Parent,Name,MacAddress

fabio1975_0-1641369310609.png

 

Fabio

Visit vmvirtual.blog
If you're satisfied give me a kudos

0 Kudos
bluefirestorm
Champion
Champion

The MAC OUI 0e:00:70 does not seem to exist.

It does not belong to any of the VMware OUI.

VMware MAC OUI are these
00:05:69 VMware, Inc.
00:0C:29 VMware, Inc.
00:1C:14 VMware, Inc.
00:50:56 VMware, Inc.

https://www.wireshark.org/tools/oui-lookup.html

Unless your organisation has a practice of creating your own MAC address, it is quite unlikely to belong a VM. But if you do have that practice, presumably you would already have to maintain a list internally so as not to present any conflict and you wouldn't have to write a script to find it.

0 Kudos