VMware Cloud Community
Austinc
Contributor
Contributor
Jump to solution

query vm "Network Adapter Type" ?

Hi, again

Anyone got an idea on how to use VI Toolkit to query the Network Adapter Type - Current adapter:

Essentially I'm wanting to know if a vm has vmxnet, vlance or Flexible network adapter

- for Windows servers that are powered on, I could query the os using WMI... but I'd prefer a query against the ESX host

Thanks

Craig

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

According to the SDK there are 3 NIC types possible.

That is VirtualE1000, VirtualPCNet32 or VirtualVmxnet.

The exact type, afaik, can only be determined by the type of object.

The following script lists all device-types that are connected to a guest.

Based on the returned names you can determine what kind of NIC is defined.

foreach($dev in (Get-View (Get-VM -Name <guest-name>).ID).Config.Hardware.Device){
  $dev.GetType()
}

With an "if" or a "switch" you should be able to extract the information you want.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

According to the SDK there are 3 NIC types possible.

That is VirtualE1000, VirtualPCNet32 or VirtualVmxnet.

The exact type, afaik, can only be determined by the type of object.

The following script lists all device-types that are connected to a guest.

Based on the returned names you can determine what kind of NIC is defined.

foreach($dev in (Get-View (Get-VM -Name <guest-name>).ID).Config.Hardware.Device){
  $dev.GetType()
}

With an "if" or a "switch" you should be able to extract the information you want.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Austinc
Contributor
Contributor
Jump to solution

awesome - that's good enough for me.

Thanks

0 Kudos