user1155051
user1155051

Reputation: 1

Using the VMware SDK, Java, vCenter how do you get all the Networks attached to a VM?

I get the VM object and do a retrieve of the Networks but I only get one. Event if the VM has several NICS on different networks.

Upvotes: 0

Views: 1391

Answers (2)

Stuart Siegler
Stuart Siegler

Reputation: 1736

I realize this is old, but if it helps....

You can do it easily with PowerCli:

PS > connect-viserver xxx.xxx.xxx.xxx -Port 443  -User xxx -Password xxx
PS > Get-NetworkAdapter -VM  xxx.xxx.com

Name                 Type       NetworkName  MacAddress         WakeOnLan
                                                                 Enabled
----                 ----       -----------  ----------         ---------
Network adapter 1    e1000      xxx          xx:yy:zz:ad:46:46       True
Network adapter 2    e1000      xxx          xx:yy:zz:ad:46:4b       True

Upvotes: 0

Evan Powell
Evan Powell

Reputation: 960

According to the API reference, the 'network' property on the VirtualMachine managed object should get you what you want. I've used this property before, and I believe it works just fine.

What call are you making, and what results do you get? An example would help debug the problem.

Upvotes: 1

Related Questions