VMware {code} Community
woryn
Contributor
Contributor

How to map Virtual Nic card with its ethernet number?

From vSphere SDK we can get Virtual Nic card's details but there is no where I was able to find which ethernet number it is associated with.

Is there a way to figure out this mapping? Thank you.  

0 Kudos
1 Reply
doskiran
Enthusiast
Enthusiast

If I understand the question correctly, guess you are looking for the mapping details of VM vnic to guest OS ethernet interface. Please let me know if you are looking for any other details.

Sample program to print the Virtual machine network details(Nic name, IPv4, Mac, Nic Key, Portgroup) using vSphere java API. - PrintVMNetworkDetails.java 

Output:

Network Adatpter     IP4Address         Mac                  Key      Portgroup                                                                                         
----------------     ----------         ---                  ---      ---------                                                                                       
Network adapter 1    10.10.10.6         00:15:23:31:c9:22    4000     VM Network                                                                                       
Network adapter 2    10.20.20.7         07:89:61:14:38:66    4001     dvPortgroup                                                                                       

Using the above VM network details it is easy to map the guest OS ethernet number.

0 Kudos