cloud-install fails with multiple IP addresses

Bug #1472090 reported by Trent Lloyd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-installer
New
Undecided
Unassigned

Bug Description

cloud-install fails completely when multiple IP addresses exist on the machine. Generally looking at the code, it is not remotely equipped to handle this situation and multiple cleanups would be required.

The specific error I receive is:
2015-07-07 13:41:52 + /usr/share/cloud-installer/bin/ip_range.py 10.48.134.15/25 10.48.134.5/25 10.48.134.6/25 10.48.134.15
2015-07-07 13:41:52 Traceback (most recent call last):
2015-07-07 13:41:52 File "/usr/share/cloud-installer/bin/ip_range.py", line 79, in <module>
2015-07-07 13:41:52 if args >= 3 else ip_range(network)
2015-07-07 13:41:52 File "/usr/share/cloud-installer/bin/ip_range.py", line 78, in <listcomp>
2015-07-07 13:41:52 ip_low, ip_high = ip_range_max(network, [ip_address(arg) for arg in argv[2:]]) \
2015-07-07 13:41:52 File "/usr/lib/python3.4/ipaddress.py", line 54, in ip_address
2015-07-07 13:41:52 address)
2015-07-07 13:41:52 ValueError: '10.48.134.5/25' does not appear to be an IPv4 or IPv6 address

This particular part can be fixed (and the installer continues a few steps) by changing common/common.sh:ipNetwork() to add "|head -n1" to the end like so:
ipNetwork()
{
        ip addr show $1 | awk '/^ inet / { print $2 }' | head -n1
}

However there are numerous other related issues with this code:
 - ipNetwork() as well as various other functions including ipAddress(), ipNetmask(), getInterfaces() etc make no attempt to filter a single IP and/or interface. A quick fix as above would be to use |head -n1, however usage should be reviewed to ensure no where actually wants multiple IPs.
 - Due to getInterfaces(), the interface 'em1' is listed 4 times under the "Select network interface" menu (once for each IP).
 - The various functions use a mixture of deprecated "ifconfig", "ip" and "route". It would make most sense to simply use "ip" (iproute2) for everything. Possible issues that may arise from this is handling of alias interface names (e.g. em1:6) that may or may not exist depending on which tool is used. Another possible issue is that some IP networks, such as those used with Infiniband (IPoIB) have larger MAC addresses that ifconfig cannot show correctly.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

What version of the installer are you using?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.