Could not connect physical network device by NETCONF
Hi all,
I want to connect physical network device by NETCONF in OpenDaylight. The physical network device is mx5, and I use the Boron. I refer this URL. http://docs.opendaylight.org/en/stable-boron/user-guide/netconf-user-guide.html
I issued the following API to establish NETCONF connection, and no errors outputed.
curl --user "admin":"admin" -H "Accept: application/xml" -H "Content-type: application/xml" -X POST http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules -d '
<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
<name>mx5-1</name>
<address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">device address</address>
<port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">22</port>
<username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
<password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">password</password>
<yang-module-capabilities xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<capability xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2010-09-24
</capability>
</yang-module-capabilities>
...
As long as watching network topology, it seemd to succeed in connection.
curl -u admin:admin -H "Content-Type: application/json" -X GET http://172.26.201.109:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/mx5-1/ -s | python -m json.tool
{
"node": [
{
"netconf-node-topology:available-capabilities": {
"available-capability": [
"http://xml.juniper.net/netconf/junos/1.0",
"urn:ietf:params:xml:ns:netconf:capability:candidate:1.0",
"urn:ietf:params:netconf:capability:confirmed-commit:1.0",
"http://xml.juniper.net/dmi/system/1.0",
"urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file",
"urn:ietf:params:netconf:capability:candidate:1.0",
"urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0",
"urn:ietf:params:netconf:capability:validate:1.0",
"urn:ietf:params:xml:ns:netconf:base:1.0",
"urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file",
"(urn:ietf:params:xml:ns:yang:ietf-inet-types?revision=2010-09-24)ietf-inet-types",
"urn:ietf:params:xml:ns:netconf:capability:validate:1.0",
"urn:ietf:params:netconf:base:1.0"
]
},
"netconf-node-topology:connection-status": "connected",
"netconf-node-topology:host": "172.26.218.237",
"netconf-node-topology:port": 830,
"netconf-node-topology:unavailable-capabilities": {},
"node-id": "mx5-1"
}
]
}
But, when I issued the API to get the configulation of the physical network device, an error occuered.
curl -u admin:admin -H "Content-Type: application/json" -X GET http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/mx5-1/yang-ext:mount -s | python -m json.tool
{
"errors": {
"error": [
{
"error-message": "Request could not be completed because the relevant data model content does not exist ",
"error-tag": "data-missing",
"error-type": "application"
}
]
}
}
Warnings were outputed in log of the OpenDaylight.
2016-12-27 15:18:58,842 | WARN | oupCloseable-3-2 | NetconfDeviceCommunicator | 302 - org.opendaylight.netconf.sal-netconf-connector - 1.4.1.Boron-SR1 | RemoteDevice{mx5-1}: Session terminated Session closed
2016-12-27 15:18:58,859 | WARN | oupCloseable-3-2 | ReadOnlyTx | 302 ...