Cannot obtain tunnel-related information
budnyjj opened this issue · comments
I am trying to setup GRE tunnel with of-config. However, I cannot get information about tunnel setup in openvswitch:
# ovs-vsctl add-br my-br
# ovs-vsctl set Interface my-br type=gre
# ovs-vsctl set Interface my-br options="df_default="true", in_key=flow, local_ip="0", out_key=flow, remote_ip=flow"
# ovs-vsctl show
aebe82a0-6993-4786-a896-ad7e16cde7d7
Bridge my-br
Port my-br
Interface my-br
type: gre
options: {df_default="true", in_key=flow, local_ip="0", out_key=flow, remote_ip=flow}
Bridge ofc-bridge
fail_mode: secure
Port ofc-bridge
Interface ofc-bridge
type: internal
Get-config output:
<?xml version='1.0' encoding='UTF-8'?>
<ns0:capable-switch xmlns:ns0="urn:onf:config:yang">
<ns0:id>openvswitch</ns0:id>
<ns0:resources>
<ns0:port>
<ns0:name>my-br</ns0:name>
<ns0:configuration>
<ns0:admin-state>down</ns0:admin-state>
<ns0:no-receive>false</ns0:no-receive>
<ns0:no-forward>false</ns0:no-forward>
<ns0:no-packet-in>false</ns0:no-packet-in>
</ns0:configuration>
</ns0:port>
<ns0:port>
<ns0:name>ofc-bridge</ns0:name>
<ns0:requested-number>666</ns0:requested-number>
<ns0:configuration>
<ns0:admin-state>down</ns0:admin-state>
<ns0:no-receive>false</ns0:no-receive>
<ns0:no-forward>false</ns0:no-forward>
<ns0:no-packet-in>false</ns0:no-packet-in>
</ns0:configuration>
</ns0:port>
</ns0:resources>
<ns0:logical-switches>
<ns0:switch>
<ns0:id>my-br</ns0:id>
<ns0:datapath-id>00:00:1e:00:0b:6e:7c:4f</ns0:datapath-id>
<ns0:resources>
<ns0:port>my-br</ns0:port>
</ns0:resources>
</ns0:switch>
<ns0:switch>
<ns0:id>ofc-bridge</ns0:id>
<ns0:datapath-id>00:01:02:03:04:05:06:07</ns0:datapath-id>
<ns0:lost-connection-behavior>failSecureMode</ns0:lost-connection-behavior>
<ns0:resources>
<ns0:port>ofc-bridge</ns0:port>
</ns0:resources>
</ns0:switch>
</ns0:logical-switches>
</ns0:capable-switch>
I expect to get more information about my-br tunnel: type, local-endpoint-address, remote-endpoint-address, as mentioned in of-config 1.2 spec...
What I am doing wrong?
The wrong (or just unrecommended) is your approach to create configuration data via ovs-vsctl() and then access them by of-config.
The problem is that of-config has 2 tunnel types (tunnel and ipgre-tunnel) that actually maps both to the gre type in OVSDB. Therefore, ofc-server adds an external-id into the OVSDB when it creates a tunnel. This id helps then to show the correct type according to the of-config data model.