VMware Cloud Community
sachi2403
Contributor
Contributor

How to get MAC IDs of VMs of Hosts that are added in vifp list using VI SDK Java API ?

Hi all,

How to get MAC IDs of VMs of Hosts that are added in vifp list using VI SDK Java API ?

I also want to get the MAC IDs of Hosts that are added in the vifp list, using VI SDK JAVA API only...

I've looked into "Class HostNetworkInfo", but it does not contain any member which represents MAC ID...

Please help me in this regard...

Thanks in advance

Sachi

0 Kudos
1 Reply
lamw
Community Manager
Community Manager

Assuming you know how to obtain moref to VirtualMachine, you will need to iterate through the VM's virtual hardware to look for VirtualEthernetCard device - http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.device.VirtualEtherne... Once you have the virtual devices that are of type ethernet cards, then you can extract the MAC Address by using the macAddress property.

If you're new to VMware API/SDKs, I would recommend taking a look at this document - http://communities.vmware.com/docs/DOC-7270

0 Kudos