neutron-macvtap-agent fails to start due to interface not having a mac address

Bug #1801030 reported by git.user
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Brian Haley

Bug Description

The same as for linuxbridge-agent:
https://bugs.launchpad.net/neutron/+bug/1669087

diff --git a/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py b/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
index 3a771fbba7..7119d7d2f6 100644
--- a/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
+++ b/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
@@ -112,13 +112,15 @@ class MacvtapManager(amb.CommonAgentManagerBase):

     def get_agent_id(self):
         devices = ip_lib.IPWrapper().get_devices(True)
- if devices:
- mac = ip_lib.get_device_mac(devices[0].name)
- return 'macvtap%s' % mac.replace(":", "")
+ for device in devices:
+ mac = ip_lib.get_device_mac(device.name)
+ if mac:
+ break
         else:
             LOG.error("Unable to obtain MAC address for unique ID. "
                       "Agent terminated!")
             sys.exit(1)
+ return 'macvtap%s' % mac.replace(":", "")

     def get_devices_modified_timestamps(self, devices):
         # TODO(kevinbenton): this should be implemented to detect

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
assignee: nobody → Brian Haley (brian-haley)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/614858
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a58a527494aa40b11b23eca47a8afb60fb24583a
Submitter: Zuul
Branch: master

commit a58a527494aa40b11b23eca47a8afb60fb24583a
Author: Brian Haley <email address hidden>
Date: Thu Nov 1 15:48:18 2018 -0400

    Scan for MAC through all devices in macvtap agent

    The first device the agent happens to pick could be something
    without a MAC address like a 6in6 interface. This was causing
    the agent to fail to start if it was unlucky enough to pick
    that address.

    This patch just adjusts the logic to keep iterating through
    the list until we find a MAC.

    Change-Id: Iba9c7c3cb200e74a78ea885e8d9323de64c2c663
    Closes-Bug: #1801030

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 14.0.0.0b1

This issue was fixed in the openstack/neutron 14.0.0.0b1 development milestone.

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.