你的 ovs 连接了吗?即使没有连接开关,它仍然是可能的
在配置存储中创建一个网桥。
从操作存储中对拓扑执行 GET 操作,看看您是否有权限
节点id等URI应该是:
/restconf/operational/network-topology:network-topology/topology/ovsdb:1
仅看到 ovsdb:1 并不表示您的 ovs 已连接。那只是
表示您实际上是在 odl 中运行 ovsdb 南行。
我安装了 ovsdb 并且没有连接 ovs 的设置示例:
# curl -u admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/ovsdb:1 | python -m json.tool
{
"topology": [
{
"topology-id": "ovsdb:1"
}
]
}
现在,连接我的 ovs:
# ovs-vsctl set-manager tcp:127.0.0.1:6640
# ovs-vsctl show | egrep connec
is_connected: true
# ovs-vsctl show
28bde339-8db8-4848-a1fc-4a9ecc81b5c3
Manager "tcp:127.0.0.1:6640"
is_connected: true
ovs_version: "2.9.0"
[root@jamo-rc701 karaf-0.9.0-SNAPSHOT]# curl -u admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/ovsdb:1 | python -m json.tool
{
"topology": [
{
"node": [
{
"node-id": "ovsdb://uuid/28bde339-8db8-4848-a1fc-4a9ecc81b5c3",
"ovsdb:connection-info": {
"local-ip": "127.0.0.1",
"local-port": 6640,
"remote-ip": "127.0.0.1",
"remote-port": 60478
},
"ovsdb:datapath-type-entry": [
{
"datapath-type": "ovsdb:datapath-type-netdev"
},
{
"datapath-type": "ovsdb:datapath-type-system"
}
],
"ovsdb:db-version": "7.15.1",
"ovsdb:interface-type-entry": [
{
"interface-type": "ovsdb:interface-type-lisp"
},
{
"interface-type": "ovsdb:interface-type-geneve"
},
{
"interface-type": "ovsdb:interface-type-gre"
},
{
"interface-type": "ovsdb:interface-type-system"
},
{
"interface-type": "ovsdb:interface-type-vxlan"
},
{
"interface-type": "ovsdb:interface-type-internal"
},
{
"interface-type": "ovsdb:interface-type-stt"
},
{
"interface-type": "ovsdb:interface-type-tap"
},
{
"interface-type": "ovsdb:interface-type-patch"
}
],
"ovsdb:manager-entry": [
{
"connected": true,
"number_of_connections": 1,
"target": "tcp:127.0.0.1:6640"
}
],
"ovsdb:openvswitch-external-ids": [
{
"external-id-key": "hostname",
"external-id-value": "localhost"
},
{
"external-id-key": "system-id",
"external-id-value": ""
},
{
"external-id-key": "rundir",
"external-id-value": "/var/run/openvswitch"
}
],
"ovsdb:ovs-version": "2.9.0"
}
],
"topology-id": "ovsdb:1"
}
]
}
请注意 ovs-vsctl show 说 is_connected: true,并注意
实际的节点 ID