Arista ML2 driver doesn't synchronize HA networks with EOS correctly

Bug #1494310 reported by Benoît Knecht
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-arista
Fix Committed
High
Shashank Hegde

Bug Description

Running Openstack Kilo and networking-arista from master (1aa15e8).

With some HA networks already created in Neutron (created automatically when adding HA routers), restarting the CVX and neutron-server lead to those networks disappearing from EOS (not listed by "show openstack networks" anymore).

The problem seems to come from _cleanup_db() in neutron/plugins/ml2/drivers/arista/mechanism_arista.py, which is called by initialize() in the same file:

def _cleanup_db(self):
    """Clean up any uncessary entries in our DB."""
    db_tenants = db_lib.get_tenants()
    for tenant in db_tenants:
        neutron_nets = self.ndb.get_all_networks_for_tenant(tenant)
        neutron_nets_id = []
        for net in neutron_nets:
            neutron_nets_id.append(net['id'])
        db_nets = db_lib.get_networks(tenant)
        for net_id in db_nets.keys():
            if net_id not in neutron_nets_id:
                db_lib.forget_network(tenant, net_id)

Since HA networks have no tenant_id, they won't be returned by self.ndb.get_all_networks_for_tenant(tenant), so they will be removed from the DB and won't be added to EOS during synchronization (checking the arista_provisioned_nets table in the neutron database shows that the HA networks are indeed missing, while they are listed by "neutron net-list").

Changed in neutron:
assignee: nobody → Shashank Hegde (hegde-shashank)
affects: neutron → networking-arista
Changed in networking-arista:
importance: Undecided → High
Changed in networking-arista:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-arista (master)

Reviewed: https://review.openstack.org/225343
Committed: https://git.openstack.org/cgit/openstack/networking-arista/commit/?id=36c441dbdc02404c4049d0f3b057a169fe857235
Submitter: Jenkins
Branch: master

commit 36c441dbdc02404c4049d0f3b057a169fe857235
Author: Shashank Hegde <email address hidden>
Date: Fri Sep 18 14:42:18 2015 -0700

    Fixed HA router network cleanup

    On neutron restart, the internal network created for HA router was cleaned up
    as there was no tenant associated with that network. This patch ensures that
    networks without tenant id are handled correctly.

    Closes-Bug: 1494310

    Change-Id: I0d9db9bc8fa48ac211fee5fde6aa3e2dc8455361

Changed in networking-arista:
status: In Progress → Fix Committed
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.