bad default for my_ip if 8.8.8.8 is unreachable

Bug #1193013 reported by Mathew Odden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Davanum Srinivas (DIMS)

Bug Description

The detection method for the configuration option my_ip seems to assume that 8.8.8.8 will always be routable from a compute host and chooses 127.0.0.1 as a fall back if there is no route to the google DNS (8.8.8.8)

See here:

https://github.com/openstack/nova/blob/master/nova/netconf.py#L38

Falling back to 127.0.0.1 doesn't seem useful, so I am wondering if there is a better option here.

Some pdb information while debugging:

> /usr/lib/python2.6/site-packages/nova/netconf2.py(40)_get_my_ip()
-> csock.connect(('8.8.8.8', 80))
(Pdb) n
error: (101, 'Network is unreachable')
> /usr/lib/python2.6/site-packages/nova/netconf2.py(40)_get_my_ip()
-> csock.connect(('8.8.8.8', 80))

Tags: network
Revision history for this message
Russell Bryant (russellb) wrote :

This is the kind of thing that's better to specify than let the app try to guess anyway, IMO.

tags: added: nework
Mathew Odden (locke105)
tags: added: network
removed: nework
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/34389

Changed in nova:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/34389
Committed: http://github.com/openstack/nova/commit/7b97d363524fbd471289070557d1b8ffe9c06758
Submitter: Jenkins
Branch: master

commit 7b97d363524fbd471289070557d1b8ffe9c06758
Author: Davanum Srinivas <email address hidden>
Date: Tue Jun 25 08:54:53 2013 -0400

    Better default for my_ip if 8.8.8.8 is unreachable

    Run if route/show, extract ipv4 addresses and pick the first one.
    Fall back to 127.0.0.1 as before if we don't find anything
    or if we have running the ip route/show commands

    Fixes LP# 1193013

    Change-Id: If73f0f6bf67f858f7506220debab0f74cc9e3cb4

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
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.