[NETCONF-250] Allow over-ride of non-module capabilities Created: 05/Aug/16  Updated: 15/Mar/19  Resolved: 06/Mar/17

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Brian Freeman Assignee: Miroslav Kovac
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive Investigation.zip    

 Description   

We have encountered a device that does not advertise either :writable-running or :candidate capabilities even though it support writable-running. It would be useful to be able to specify the capability to use in the node configuration using something similar to yang-additional-capabilities to add or over ride the capabilities announced by the device. This is a situation where manual netconf can work around the bad hello capabilities exchange but the ODL netconf adaptor can not.

Perhaps something like:

<netconf-additional-capability>
<capability xmlns="urn:opendaylight:netconf-node-topology">
urn:ietf:params:netconf:capability:writable-running:1.0
</capability>
</netconf-additional-capability>



 Comments   
Comment by Om Prakash [ 02/Sep/16 ]

https://git.opendaylight.org/gerrit/#/c/44897/

Comment by Amandeep Singh Rattenpal [ 23/Sep/16 ]

Hi All,

I have investigate the Netconf device discovery and followed the below steps:

1. https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf

2.Inserted the patch into netconf project https://git.opendaylight.org/gerrit/#/c/44897/

3. Installed feature: feature:install odl-restconf-all odl-mdsal-all odl-netconf-mdsal odl-netconf-connector-all

Result: Failed to exchange yang with Cisco Switch.

4. From ODL controller got following logs:

2016-09-22 14:31:33,812 | INFO | config-pusher | ConfigPusherImpl | 136 - org.opendaylight.controller.config-persister-impl - 0.6.0.SNAPSHOT | Successfully pushed configuration snapshot 99-netconf-connector.xml(odl-netconf-connector-all,odl-netconf-connector-all)
2016-09-22 14:31:33,857 | INFO | NioProcessor-11 | ClientSessionImpl | 30 - org.apache.sshd.core - 0.14.0 | Client session created
2016-09-22 14:31:33,874 | INFO | NioProcessor-11 | ClientSessionImpl | 30 - org.apache.sshd.core - 0.14.0 | Start flagging packets as pending until key exchange is done
2016-09-22 14:31:33,877 | INFO | NioProcessor-11 | ClientSessionImpl | 30 - org.apache.sshd.core - 0.14.0 | Server version string: SSH-2.0-Cisco-1.25
2016-09-22 14:31:34,864 | WARN | NioProcessor-11 | AcceptAllServerKeyVerifier | 30 - org.apache.sshd.core - 0.14.0 | Server at /10.61.20.10:22 presented unverified RSA key: 64:48:d8:32:90:17:c4:e4:0a:8a:80:81:74:71:c7:fc
2016-09-22 14:31:34,870 | INFO | NioProcessor-11 | ClientSessionImpl | 30 - org.apache.sshd.core - 0.14.0 | Dequeing pending packets
2016-09-22 14:31:35,077 | INFO | NioProcessor-11 | ClientUserAuthServiceNew | 30 - org.apache.sshd.core - 0.14.0 | Received SSH_MSG_USERAUTH_FAILURE
2016-09-22 14:31:35,083 | INFO | NioProcessor-11 | UserAuthKeyboardInteractive | 30 - org.apache.sshd.core - 0.14.0 | Received
2016-09-22 14:31:35,086 | INFO | NioProcessor-11 | ClientUserAuthServiceNew | 30 - org.apache.sshd.core - 0.14.0 | Received SSH_MSG_USERAUTH_SUCCESS
2016-09-22 14:31:35,238 | WARN | sing-executor-10 | NetconfDevice | 305 - org.opendaylight.netconf.sal-netconf-connector - 1.5.0.SNAPSHOT | RemoteDevice

{gaurav}: Netconf device does not provide all yang models reported in hello message capabilities, required but not provided: [(urn:ietf:params:xml:ns:yang:ietf-inet-types?revision=2010-09-24)ietf-inet-types]
2016-09-22 14:31:35,239 | WARN | sing-executor-10 | NetconfDevice | 305 - org.opendaylight.netconf.sal-netconf-connector - 1.5.0.SNAPSHOT | RemoteDevice{gaurav}

: Attempting to build schema context from required sources
2016-09-22 14:31:35,252 | ERROR | sing-executor-11 | NetconfDevice | 305 - org.opendaylight.netconf.sal-netconf-connector - 1.5.0.SNAPSHOT | RemoteDevice

{gaurav}: Initialization in sal failed, disconnecting from device
java.lang.IllegalStateException: RemoteDevice{gaurav}

: No more sources for schema context
at org.opendaylight.netconf.sal.connect.netconf.NetconfDevice$SchemaSetup.setUpSchema(NetconfDevice.java:479)[305:org.opendaylight.netconf.sal-netconf-connector:1.5.0.SNAPSHOT]
at org.opendaylight.netconf.sal.connect.netconf.NetconfDevice$SchemaSetup.run(NetconfDevice.java:428)[305:org.opendaylight.netconf.sal-netconf-connector:1.5.0.SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_91]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_91]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_91]
2016-09-22 14:31:35,255 | WARN | sing-executor-11 | NetconfDeviceCommunicator | 305 - org.opendaylight.netconf.sal-netconf-connector - 1.5.0.SNAPSHOT | RemoteDevice

{gaurav}

: Session terminated Session closed

What should be the next step ?

Comment by Om Prakash [ 23/Sep/16 ]

it seems that device don't support get-schema , so you need to side load those yang file of capability reported by the device in hello message.

Comment by Jakub Morvay [ 23/Sep/16 ]

Yeah, I think Om is right. Please see https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Connecting_to_a_device_not_supporting_netconf_monitoring for more info.

But anyway how is this related to this bug?

Comment by Amandeep Singh Rattenpal [ 27/Sep/16 ]

Initially, We have encountered a device that does not advertise either :writable-running or :candidate capabilities even though it support writable-running.

So we merged the updated patch to netconf project manually in our local system, after doing that we are getting this error. That's why my query related to this bug.

Comment by Jakub Morvay [ 27/Sep/16 ]

Ok AmanDeep,

If it is not confidential, can you please post here your device's configuration? Also, have you merged latest patchset?

Comment by Amandeep Singh Rattenpal [ 28/Sep/16 ]

**Configurations **

<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<!-- Loopback connection to netconf server in controller using netconf-connector -->
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
<name>gaurav</name>
<address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">"IP"</address>
<port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">"port"</port>
<username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">"username"</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>
<tcp-only xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">false</tcp-only>
<reconnect-on-changed-schema xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">true</reconnect-on-changed-schema>
<event-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:netty">prefix:netty-event-executor</type>
<name>global-event-executor</name>
</event-executor>
<binding-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">prefix:binding-broker-osgi-registry</type>
<name>binding-osgi-broker</name>
</binding-registry>
<dom-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">prefix:dom-broker-osgi-registry</type>
<name>dom-broker</name>
</dom-registry>
<client-dispatcher xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:config:netconf">prefix:netconf-client-dispatcher</type>
<name>global-netconf-dispatcher</name>
</client-dispatcher>
<processing-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:threadpool</type>
<name>global-netconf-processing-executor</name>
</processing-executor>
<keepalive-executor xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:threadpool">prefix:scheduled-threadpool</type>
<name>global-netconf-ssh-scheduled-executor</name>
</keepalive-executor>
</module>
</modules>
</data>
</configuration>
<required-capabilities>
<![CDATA[urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf?module=odl-sal-netconf-connector-cfg&revision=2015-08-03]]>
</required-capabilities>
</snapshot>

    • We have merged the latest patch **
Comment by Jakub Morvay [ 29/Sep/16 ]

Have you also put the ietf-inet-types model's yang schema into the ODL cache/schema folder?

Comment by Amandeep Singh Rattenpal [ 10/Oct/16 ]

Yes we have included ietf-inet-types@2010-09-24.yang & ietf-inet-types@2013-07-15.yang.

Moreover, The capabilities also added into 99-Configurations file.

Comment by Amandeep Singh Rattenpal [ 10/Oct/16 ]

After adding the NonModuleCapabilities getting repository issues. Solved the repository issues and added the 99-netconf-connector.xml file into karaf target.

Now, getting exception after installing netconf-connector-all feature.

Please find the attached logs and other configuration files.

Comment by Amandeep Singh Rattenpal [ 10/Oct/16 ]

Attachment Investigation.zip has been added with description: logs and configuration files

Comment by Jakub Morvay [ 12/Oct/16 ]

Amandeep can you please try this with the newest patchset? I have fixed possible null pointer exception..

What exactly are these repository issues you are talking about and how have you fixed them?

Comment by Amandeep Singh Rattenpal [ 13/Oct/16 ]

Repository issues are with netconf project. I was not able to build the project after adding non module capabilities.

Initially, i skipped the test cases and build the project then with test cases. After changing in yang and build the project online able to solve the issues.

Moreover, i will include the new patch and get back to you. Basically i am getting semantic errors after including 99-netconf-connector.xml. please look into that do i need to add more capabilities.?

Comment by Om Prakash [ 22/Jan/17 ]

Hi Jakub, Please let me know if I need to do more on this defect .

Comment by Miroslav Kovac [ 21/Feb/17 ]

https://git.opendaylight.org/gerrit/#/c/44897/

Generated at Wed Feb 07 20:14:32 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.