VMware {code} Community
rtao
Contributor
Contributor

How to query the network bond address using vSphere API?

I need to query the IP address after auto-deploying a VM using vSphere API, in order to do some remote auto-configuration. But the VM has all NICs bonded together(see following ifconfig output).

I have the VMware tools installed, and then retrieved the GuestInfo object of the VM using the API, but seems GuestInfo only provides information of the NICs, which in my case do not show any IP address. So is there a way to query the bonding address?

My vSphere SDK version: 5.1.0

VM: CentOS 5.4

Ifconfig output of the VM:

[root@Test-VM ~]# ifconfig
bond0     Link encap:Ethernet  HWaddr 00:50:56:AC:79:C4
          inet addr:10.10.94.182  Bcast:10.10.95.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:46344 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33292 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3125678 (2.9 MiB)  TX bytes:2731206 (2.6 MiB)
eth0      Link encap:Ethernet  HWaddr 00:50:56:AC:79:C4
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:5555 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8983 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:420875 (411.0 KiB)  TX bytes:1260600 (1.2 MiB)
          Base address:0x2000 Memory:d8940000-d8960000
eth1      Link encap:Ethernet  HWaddr 00:50:56:AC:79:C5
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:13599 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8161 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:901761 (880.6 KiB)  TX bytes:495803 (484.1 KiB)
          Base address:0x2040 Memory:d8960000-d8980000

Any help is greatly appreciated!!

Tags (3)
0 Kudos
0 Replies