VMware Networking Community
WajihRehman
Contributor
Contributor

How to find the VM-ID or VM Name if we know the MAC address?

Hello,

For learning purpose , I starting building and mapping different tables using NSX Central commands.  I know which MAC address of VMs ( along with their IPs)  ; which VTEPs they are on. What are the host ID and addresses etc.

However, I can not identify any command which can help me identify which VM has that MAC address? I saw some post where it is suggested to use PowerCLI to find mac-VM information. But can anyone guide me if this is possible with NSX central command?

Many thanks for your support.

Tags (1)
Reply
0 Kudos
3 Replies
Sreec
VMware Employee
VMware Employee

Usually for such output net-stats -l on ESXI is the best option - you could run this via powercli as well. If you want to pull MAC-VM Name mapping via NSX cli , one way which i know is like below

1.  show cluster all details -> to get all Host-ID

2. show host host-id -> to get all VM-ID

3. show vm vm-id -> This will fetch vnic-id for the vm.

4. show vnic vnic-id  . As you can see in the below ouput - not only MAC mapping it also list VXLAN ID ,VTEP and DVS info which might be useful as well.

pastedImage_0.png

Cheers,
Sree | VCIX-5X| VCAP-5X| VExpert 7x|Cisco Certified Specialist
Please KUDO helpful posts and mark the thread as solved if answered
WajihRehman
Contributor
Contributor

Thanks Sreec.

I was wondering how would I identify the VM-ID?  Do you mean that I need to execute the below commands for every VM? If so then this will become huge task and might not be practical.

2. show host host-id -> to get all VM-ID

3. show vm vm-id -> This will fetch vnic-id for the vm.

Please clarify

Reply
0 Kudos
Sreec
VMware Employee
VMware Employee

Yeah it is bit tedious going VM by VM method. I'm unsure about any other options because your ask is slightly different ,its not a default ARP/MAC table output you are looking

Cheers,
Sree | VCIX-5X| VCAP-5X| VExpert 7x|Cisco Certified Specialist
Please KUDO helpful posts and mark the thread as solved if answered