VMware Cloud Community
aj800
Enthusiast
Enthusiast

How do I get a listing of VMs in a cluster by MAC address?

I made some network configuration changes on physical switches and still have some residual MAC addresses from VMware devices, likely VM interfaces themselves.  I want to identify which VMs they are, so is it possible to list VMs in the cluster by MAC address (either in the vSphere UI or in ESXi CLI), and if so, how do I do it?

0 Kudos
2 Replies
scott28tt
VMware Employee
VMware Employee

PowerCLI?

 


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
ObjectifDubai
Enthusiast
Enthusiast

Hi, 

with PowerCli,  To list the Vms and their MAC addresses

PS D:\> get-view-ViewType VirtualMachine | select NAME , @{N='Mac Address';E={[string]::Join(" , ",$($_.Guest.Net.MacAddress))}}
 
Name            Mac Address                                                                  
----            -----------                                                                  
mavm1     00:50:56:95:d1:e3                                                                                                                          
mavm2     00:50:56:56:05:9b                                                            
mavm3     00:50:56:56:15:15 , 00:50:56:56:1e:1e , 00:50:56:56:1e:1e , 00:50:56:56:5a:1a
mavm4     00:50:56:56:6d:70                                                                                                                      
mavm5     00:50:56:56:14:09                                                            
mavm6     76:31:9a:76:31:9a , 00:50:56:56:35:35 , 02:42:fb:02:42:fb                                                                                                                              
mavm7     00:50:56:95:d6:ef                                
 

 

 

Or To find a vm from its Mac address

$adressMac="00:50:56:56:5a:1a"
 
PS D:\> get-view -ViewType VirtualMachine |
Where-Object{$_.Guest.Net.MacAddress -eq $adressMac} |  
select NAME , @{N='Mac Address';E={[string]::Join(" , ",$($_.Guest.Net.MacAddress))}}
 
Name   Mac Address                                                                  
----   -----------                                                                  
mavm3 00:50:56:56:15:15 , 00:50:56:56:1e:1e , 00:50:56:56:1e:1e , 00:50:56:56:5a:1a
 

 

 

 

0 Kudos