cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Mounting XRv (or ASR9K) from ODL or Cisco OSC using NETCONF/YANG

2848
Views
0
Helpful
2
Comments
Cisco Employee

First ensure that you're running XR 5.3 or later.


Then ensure that in XR you've done "crypto key generate dsa" and that your config contains:

netconf-yang agent

     ssh

!

ssh server v2

ssh server netconf port 830

note that on XR 5.3.0 you'll see:

ssh server v2

ssh server netconf port 830

netconf-yang agent ssh

Then use Postman or RESTClient to POST to http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/controller-config/yang-ext:mount/config:modules:

{

    "config:module": [

        {

            "type": "odl-sal-netconf-connector-cfg:sal-netconf-connector",

            "name": "xrv",

            "odl-sal-netconf-connector-cfg:address": "172.23.29.125",

            "odl-sal-netconf-connector-cfg:port": 830,

            "odl-sal-netconf-connector-cfg:username": "cisco",

            "odl-sal-netconf-connector-cfg:password": "cisco",

            "odl-sal-netconf-connector-cfg:tcp-only": false,

            "odl-sal-netconf-connector-cfg:binding-registry": {

                "type": "opendaylight-md-sal-binding:binding-broker-osgi-registry",

                "name": "binding-osgi-broker"

            },

            "odl-sal-netconf-connector-cfg:between-attempts-timeout-millis": 2000,

            "odl-sal-netconf-connector-cfg:processing-executor": {

                "type": "threadpool:threadpool",

                "name": "global-netconf-processing-executor"

            },

            "odl-sal-netconf-connector-cfg:max-connection-attempts": 0,

            "odl-sal-netconf-connector-cfg:sleep-factor": 1.5,

            "odl-sal-netconf-connector-cfg:client-dispatcher": {

                "type": "odl-netconf-cfg:netconf-client-dispatcher",

                "name": "global-netconf-dispatcher"

            },

            "odl-sal-netconf-connector-cfg:dom-registry": {

                "type": "opendaylight-md-sal-dom:dom-broker-osgi-registry",

                "name": "dom-broker"

            },

            "odl-sal-netconf-connector-cfg:event-executor": {

                "type": "netty:netty-event-executor",

                "name": "global-event-executor"

            },

            "odl-sal-netconf-connector-cfg:connection-timeout-millis": 20000

        }

    ]

}

note that you'll need to change the IP address above - and potentially the name, port, username and password.

also note that for Cisco OSC the URL is different:

https://localhost/controller/restconf/config/opendaylight-inventory:nodes/node/controller-config/yang-ext:mount/config:modules.

and also note that from Lithium this is also available at:

http://localhost8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules

and finally note that from Beryllium the older "opendaylight-inventory" will no longer be supported.


One thing to remember for ODL is you need the right set of features installed to get ODL to connect to its own NETCONF NBI for config and to then be able to connect to XR.  odl-mdsal-broker, odl-restconf and odl-netconf-connector-ssh should suffice.  For Cisco OSC those features will all be pre-installed.

After you post the config you can then do a GET to:

http://localhost:8181/restconf/operational/opendaylight-inventory:nodes/node/xrv  (assuming your XR node is called xrv) to check that the node has mounted ok (it may take a few seconds to mount).

once XR mounts you should see something like:

{

}

2 Comments
Beginner

Hi,

I tried mounting IOS XRV v 6.0 and v 5.3.2 on to ODL using restconf, but its unsuccessful

Trace logs are mentioned below:

IOS XRv version: 6.0

[06/24/16 11:17:07.685 UTC 26f1 1147094] ERR: nc_sm_process_rpc_get_schema_message:3844 Failed to open yang schema file: /pkg/yang/Cisco-IOS-XR-ip-udp-oper-sub4.yang

[06/24/16 11:17:07.685 UTC 26f2 1147094] TRC: nc_pxs_send:222 SERVER->CLIENT 539 (iov: 10f6a460)

[06/24/16 11:17:07.685 UTC 26f3 2085086] TRC: nc_px_fdout_handler:562 SSH PIPE OUTPUT cond: 0x2, fd 45, ctx 42099c0

[06/24/16 11:17:07.905 UTC 26f4 1147094] TRC: nc_pxs_ipc_notify_callback_fn:325 IPC_NOTIFY_SENDSTATUS (iov: 10f6a460)

IOS XRV version: 5.3.2

[06/24/16 10:45:21.026 UTC 2dcc 1462539] ERR: nc_sm_process_rpc_get_schema_message:3818 Failed to open yang schema file: /pkg/yang/rpol-types.yang

[06/24/16 10:45:21.026 UTC 2dcd 1462539] TRC: nc_pxs_send:216 SERVER->CLIENT 540

[06/24/16 10:45:21.026 UTC 2dce 2081037] TRC: nc_px_fdout_handler:565 SSH PIPE OUTPUT cond: 0x2, fd 42, ctx 42099c0

Kindly help

Cisco Employee

I'm hitting the same issue.  Did you solve it?

CreatePlease to create content