In my application I need to use the OVSDB manager to spawn ports and bridges on OVS switches running on separate hosts. As I need to use in-band control, I need to use an "active manager", i.e. the OVS switch initiates the OVSDB connection to the manager.

It appears that the OVSDB manager library provided in Ryu is a bit incomplete. I can use it to add ports, but I need to add bridges as well.

I tried to implement a function similar to the add_port function to add bridges, but the bridges do not show up on the OVS switches. The code is included below:

from ryu.services.protocols.ovsdb import event as ovsdb_event
import uuid

def create_bridge(manager, system_id, bridge_name):
    bridge_uuid = uuid.uuid4()
    interface_uuid = uuid.uuid4()
    port_uuid = uuid.uuid4()
    def _create_bridge(tables, insert):

        bridge = insert(tables['Bridge'], bridge_uuid)
        setattr(bridge, 'name', bridge_name)

        interface = insert(tables['Interface'], interface_uuid)
        setattr(interface, 'name', bridge_name)
        setattr(interface, 'type', 'internal')

        port = insert(tables['Port'], port_uuid)
        setattr(port, 'name', bridge_name)

        port.interfaces = [interface]
        bridge.ports = [port]

        return interface_uuid, port_uuid, bridge_uuid

    req = ovsdb_event.EventModifyRequest(system_id, _create_bridge)
    return manager.send_request(req)

The result returned is as follows:

EventModifyReply<system_id=s1, status=success, insert_uuids={UUID('8b70c13a-a31f-47a2-aee4-0980784bda16'): UUID('673427e2-0ad1-40ae-a946-c5a506bc54b6'), UUID('783af59e-118c-4c2e-ac21-8d8ac55624dd'): UUID('1d400a21-a2f8-4bbb-aa7a-0f5186e9ce60'), UUID('f156cb87-d57c-4c74-8706-d012c41ea0d0'): UUID('44a526d7-820b-4396-b99f-0bf2195021f5')}, error_msg=None>

But no new bridges show up on my OVS switches. Any pointers on what's missing, or am I doing something wrong?

Thanks in advance,
- Thomas

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to