nova-network fails to initialize gateway device if the interface address has 'dynamic' flag

Bug #1408142 reported by Tomoki Sekiyama
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Tomoki Sekiyama

Bug Description

If the network interface address has dynamic flag, nova-network fails to start.
This is because ip addr command only accept 'dynamic' flag for IPv6 address, but not for IPv4 address.

For example:

$ ip addr show dev eth0 scope global
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 52:54:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.96/23 brd 192.168.1.255 scope global dynamic eth0
       valid_lft 2225sec preferred_lft 2225sec

$ ip addr del 192.168.0.96/23 brd 192.168.1.255 scope global dynamic eth0 dev eth0
Error: either "local" is duplicate, or "dynamic" is a garbage.

To fix this problem, 'dynamic' should be omitted.
Note that, this issue is triaged in LinuxBridgeInterfaceDriver.ensure_bridge(), but not in initialize_gateway_device().

Exception thrown in startup (or first instance's boot):

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 455, in fire_timers
    timer()
  File "/usr/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 58, in __call__
    cb(*args, **kw)
  File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 212, in main
    result = function(*args, **kwargs)
  File "/opt/stack/nova/nova/openstack/common/service.py", line 492, in run_service
    service.start()
  File "/opt/stack/nova/nova/service.py", line 164, in start
    self.manager.init_host()
  File "/opt/stack/nova/nova/network/manager.py", line 1815, in init_host
    super(FlatDHCPManager, self).init_host()
  File "/opt/stack/nova/nova/network/manager.py", line 330, in init_host
    self._setup_network_on_host(ctxt, network)
  File "/opt/stack/nova/nova/network/manager.py", line 1824, in _setup_network_on_host
    self._initialize_network(network)
  File "/opt/stack/nova/nova/network/manager.py", line 1488, in _initialize_network
    self.l3driver.initialize_gateway(network)
  File "/opt/stack/nova/nova/network/l3.py", line 106, in initialize_gateway
    linux_net.initialize_gateway_device(dev, network_ref)
  File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 431, in inner
    return f(*args, **kwargs)
  File "/opt/stack/nova/nova/network/linux_net.py", line 885, in initialize_gateway_device
    run_as_root=True, check_exit_code=[0, 2, 254])
  File "/opt/stack/nova/nova/network/linux_net.py", line 1247, in _execute
    return utils.execute(*cmd, **kwargs)
  File "/opt/stack/nova/nova/utils.py", line 164, in execute
    return processutils.execute(*cmd, **kwargs)
  File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 224, in execute
    cmd=sanitized_cmd)
ProcessExecutionError: Unexpected error while running command.
Command: sudo nova-rootwrap /etc/nova/rootwrap.conf ip addr del 192.168.123.1/23 brd 192.168.124.255 scope global dynamic dev br100
Exit code: 255
Stdout: u''
Stderr: u'Error: either "local" is duplicate, or "dynamic" is a garbage.\n'

Tags: network
description: updated
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/145378

Changed in nova:
assignee: nobody → Tomoki Sekiyama (tsekiyama)
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/145378
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=40661b11a8e1cbb843b996ec48925b24bb53001c
Submitter: Jenkins
Branch: master

commit 40661b11a8e1cbb843b996ec48925b24bb53001c
Author: Tomoki Sekiyama <email address hidden>
Date: Tue Jan 6 17:57:29 2015 -0500

    Ignore 'dynamic' addr flag on gateway initialization

    When initializing the gateway device, if 'dynamic' flag is present
    but not ignored, the 'ip addr del' command will fail and nova-network
    will fail to startup.
    In LinuxBridgeInterfaceDriver, it is correctly ignored.
    This adds the same handling of flags in initialize_gateway_device.

    Change-Id: Id03e9659a5bec549d6b119cd0ced595875baf0c9
    Closes-Bug: #1408142
    Related-Bug: #1274611

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