RFE: Use ovs idl from neutron

Bug #1622879 reported by Hong Hui Xiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DragonFlow
Fix Released
Wishlist
Hong Hui Xiao

Bug Description

I check the code, there is OvsdbNbApi which is not used by anyone. And dragonflow defines a OvsdbSwitchApi, which is very similar with neutron.agent.ovsdb.impl_idl.OvsdbIdl.

Unlike networking-ovn, which need to connect to ovs nb and ovs sb DB, dragonflow just need to connect ovs db(port 6640 by default). It is very native to just use the ovs interface in neutron. So that we can use the improvement in neutron code to avoid potential issue.

This bug aims to simplify the ovs interaction in dragonflow.

Hong Hui Xiao (xiaohhui)
Changed in dragonflow:
assignee: nobody → Hong Hui Xiao (xiaohhui)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to dragonflow (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/369225

Li Ma (nick-ma-z)
Changed in dragonflow:
importance: Undecided → Wishlist
Li Ma (nick-ma-z)
Changed in dragonflow:
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/369225
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=5fcc39e7045494d8d868e18ea636432af6d2df0d
Submitter: Jenkins
Branch: master

commit 5fcc39e7045494d8d868e18ea636432af6d2df0d
Author: Hong Hui Xiao <email address hidden>
Date: Tue Sep 13 16:24:53 2016 +0800

    Use NeutronOVSDBTransaction instead of Transaction

    impl_idl.Transaction is not used even by neutron, neutron use
    NeutronOVSDBTransaction as transaction class.

    In some ovs command, using Transaction will cause error, for example,
    AddBridgeCommand. This patch just uses NeutronOVSDBTransaction in df.
    It is a subclass of Transaction, which should cover all functionality
    of it. And it works better with neutron code.

    Change-Id: I0ccccea9cbe1eb05c2620155ea949123eba50f0c
    Closes-Bug: #1622898
    Related-Bug: #1622879

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to dragonflow (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/373591

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to dragonflow (master)

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

Changed in dragonflow:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/373624
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=cec525097907ee593a7f4c88c6f7b4f1b0daef1a
Submitter: Jenkins
Branch: master

commit cec525097907ee593a7f4c88c6f7b4f1b0daef1a
Author: Hong Hui Xiao <email address hidden>
Date: Wed Sep 21 11:23:11 2016 +0800

    Use ovs.db.idl to monitor ovsdb

    When the ovs idl client connects to the ovsdb-server, it gets a dump
    of all DB resources. DF can just use the idl to monitor ovsdb. This
    could simplify the code, and save the procedure to explicitly notify
    ovs interface creation.

    Change-Id: I08be04d90f709e54ffb91f2fff4dc3efba9506ed
    Partial-Bug: #1622879

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/373591
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=6c328c761447e754b7b080d0e1cb2c0020d1446a
Submitter: Jenkins
Branch: master

commit 6c328c761447e754b7b080d0e1cb2c0020d1446a
Author: Hong Hui Xiao <email address hidden>
Date: Wed Sep 21 06:02:56 2016 +0800

    Use ovs_port_updated event to update ofport and mac

    Currently, df apps use ovs idl to query the mac of ovs Interface.
    ovs_port_updated event was introduced in [1]. And there is already an
    ovs Interface object in the event. So, df apps can just get mac address
    from that event. This can save a query from ovs db, and also stop abuse
    of ovs idl.

    [1] 19232467d6ee047c482d384b5c685ad5141184ad

    Change-Id: I31d86ce224d43d61cb8861907608248647f10015
    Related-Bug: #1622879

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to dragonflow (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/376087

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/376095

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/376095
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=1718d1c034c7bc0d61f52537bca51ea42a9812bd
Submitter: Jenkins
Branch: master

commit 1718d1c034c7bc0d61f52537bca51ea42a9812bd
Author: Hong Hui Xiao <email address hidden>
Date: Mon Sep 26 11:01:36 2016 +0800

    Remove ovsdb_nb_impl.py

    As a sub-class of api_nb.NbApi, ovsdb_nb_impl.OvsdbNbApi is not used
    anywhere. And the logic in ovsdb_nb_impl is out of date somehow. For
    example, OVN_Southbound listens to 6642, and OVN_Northbound listens to
    6641 by default, however, ovsdb_nb_impl still uses port 6640 to connect
    both OVN_Southbound and OVN_Northbound DB.

    Besides, ovsdb_nb_impl will require installing ovn, which might cause
    confusion to user, as ovn is another distributed sdn controller, compared
    to dragonflow.

    Besides, using ovn db to store nb db might cause conflicts, as ovn db
    change will cause ovn-controller to download OpenFlow, if there is any
    ovn-controller.

    This patch just remove ovsdb_nb_impl.

    Change-Id: I7ddc583146989bcd598b06c49c8190a1c28597f3
    Related-Bug: #1622879

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to dragonflow (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/378413

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/373933
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=038b62b5da426550c1ffd294ed844790951226de
Submitter: Jenkins
Branch: master

commit 038b62b5da426550c1ffd294ed844790951226de
Author: Hong Hui Xiao <email address hidden>
Date: Wed Sep 21 05:18:43 2016 +0800

    Refactor OvsdbSwitchApi

    Current OvsdbSwitchApi provides ovs command sometimes, and outputs result
    directly sometimes. It makes it hard to use. Also, OvsdbSwitchApi uses
    neutron framework to execute ovs command sometimes, and uses idlutils
    directly sometimes. Using idlutils directly will not reconnect ovsdb,
    if timeout.

    This patch does following things:
    1) Create a dedicated ovsdb api, which is a sub class of OvsdbIdl from
    neutron
    2) Make OvsdbSwitchApi execute ovs command, and remove explicit execute()
    call from consumers
    3) Remove directly using idlutils in OvsdbSwitchApi
    4) Remove obselete methods in OvsdbSwitchApi
    5) Remove duplicated command class, which already have defination in
    neutron

    Change-Id: I7e9a7f9337c703673b7817ad47de1223c1b01ec0
    Closes-Bug: #1622879

Changed in dragonflow:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to dragonflow (master)

Reviewed: https://review.openstack.org/378413
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=70020c87dee775e693a7e73609fb4e715a333a12
Submitter: Jenkins
Branch: master

commit 70020c87dee775e693a7e73609fb4e715a333a12
Author: Hong Hui Xiao <email address hidden>
Date: Wed Sep 28 15:29:12 2016 +0800

    Optimize get_local_ports_to_ofport_mapping

    get_local_ports_to_ofport_mapping will be called when process port.
    It will return all information of chassises and logical ports in
    current node. However, only one chassis or one port will be used.

    When the topology is huge, for example, thousands of chassises and ports,
    it will be time/resource consuming to call the method.

    This patch makes the method just return the wanted information.

    Related-Bug: #1622879

    Change-Id: Ifb51575de444fa28e48a6330debdb72ba37a565c

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/376087
Committed: https://git.openstack.org/cgit/openstack/dragonflow/commit/?id=d17ae9705a4f585fe3e87a398823dc983cf985c1
Submitter: Jenkins
Branch: master

commit d17ae9705a4f585fe3e87a398823dc983cf985c1
Author: Hong Hui Xiao <email address hidden>
Date: Sun Sep 25 22:48:07 2016 +0800

    Refactor ovsdb_vswitch_impl.py

    The ovsdb_vswitch_impl.py contains everything about ovs, for example,
    commands, connection, idl. This fact makes the file hard to maintain.

    This patch separates ovsdb_vswitch_impl.py into several files

    ovsdb/commands.py:The customized ovs db command for df
    ovsdb/impl_idl.py: The classes to connect ovs db
    ovsdb/objects.py: The customized ovs object model for df
    ovsdb/vswitch_impl.py: The interface to manage ovs

    Besides, some obselete code is removed.

    Change-Id: Ie359268a2e72fe1f57b1a2d9dc7fad4f388e0a38
    Related-Bug: #1622879

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.