pyvcloud
pyvcloud copied to clipboard
get_primary_ip does not return the primary_ip
Hello,
I currently have a vApp with on VM. On the VM there are 3 interfaces, in the following order:
- net1 POOL
- net2 DHCP
- net3 DHCP
When I try to use vapp.get_primary_ip(my_vm_name) it does not return the primary IP because it stops at the first interface in the XML.
Here is what looks like the XML returned by the API (from pyvcloud.log):
<ovf:VirtualHardwareSection …>
…
<ovf:Item>
…
<rasd:AddressOnParent>1</rasd:AddressOnParent>
<rasd:Connection ns10:ipAddressingMode="DHCP" ns10:primaryNetworkConnection="false">net-2</rasd:Connection>
…
</ovf:Item>
<ovf:Item>
…
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:Connection ns10:ipAddressingMode="POOL" ns10:ipAddress="10.0.128.3" ns10:primaryNetworkConnection="true">net-1</rasd:Connection>
…
<ovf:Item>
…
<rasd:AddressOnParent>2</rasd:AddressOnParent>
<rasd:Connection ns10:ipAddressingMode="DHCP" ns10:primaryNetworkConnection="false">net-3</rasd:Connection>
…
</ovf:Item>
…
</ovf:VirtualHardwareSection>
vCloud director: 10.2.0.17008054