VMware {code} Community
janetdoyle
Contributor
Contributor

Getting a list of Adapter Types

Hi,

I'm able to add a virtual nic. But I've hard-coded the adapter type. Is there an API to get list of adapter types (E100, VMNEXT2, etc) that I can chose from when adding a nic to a VM?

Thanks,

Jan

0 Kudos
6 Replies
lamw
Community Manager
Community Manager

Yep, take a look at the virtual hardware that is of type VirtualEthernetCard - http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.device.VirtualEthe...

There are basically 4 types: vmxnet2,vmxnet3,e1000 and pcnet32

The vSphere API reference is a great place for these type of quesitons - http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/index.html and make sure you utilize the search functionality

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
janetdoyle
Contributor
Contributor

William,

I know all the types -- but how do I know which adapter type I can add to a vm? Is there a query function that says, "this particular VM you can only use VirtualE1000, VirtualVmxnet2 ...

For example when going through vSphere Client, edit setting, add ethernet adapter, it gives me two options of Adapter Type:

1. Flexible

2. VMXNET 2 (enhanced)

How can I get that list by using the SDK/APIs?

Thanks,

Jan

0 Kudos
lamw
Community Manager
Community Manager

I'm not aware of a public API that provides this "supported" list, it may either be a default ... OR it's doing some local logic on the client side based on the guestOS that was selected. You can probably get that list by looking at the guestOS documentation and build that into your script/application but I don't know of a method that does this for you.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
janetdoyle
Contributor
Contributor

William,

You think its linked to the GuestOS not the ESX host?

0 Kudos
lamw
Community Manager
Community Manager

Well it's a little of both, depending on the version of ESX(i) you're running, you may have certain available Network Adapter types. (e.g. with vSphere 4.x the introduction of vmxnet3 is available, else prior to 4.x it was vmxnet2), this is one scenario. The other, is certain guestOSes supports only certain adapters and as I mentioned, you'll find more details in the guestOS documentation which you may also need to check for.

=========================================================================

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
srinivasaraojav
Contributor
Contributor

Might be this useful to decide which adapter to use.

http://www.vmware.com/files/pdf/virtual_networking_concepts.pdf

In a nutshell, if your guest OS is 64-bit, use e1000, and if it is a 32bit OS use e1000 or vlance

-Srinivas

0 Kudos