Re: [controller-dev] Netconf plugin testing


Reinaldo Penno <rapenno@...>
 

Your errors seems a network problem. Maybe you have another configuration somewhere? I looked at "public abstract class AbstractNetconfSessionNegotiator" and the change in state happens when the Netconf session can not be established.

A breakpoint in the start() method will probably tell you what is going on

   private void start() {
        final NetconfMessage helloMessage = this.sessionPreferences.getHelloMessage();
        logger.debug("Session negotiation started with hello message {}", XmlUtil.toString(helloMessage.getDocument()));

        channel.pipeline().addLast(NAME_OF_EXCEPTION_HANDLER, new ExceptionHandlingInboundChannelHandler());

        timeout = this.timer.newTimeout(new TimerTask() {
            @Override
            public void run(final Timeout timeout) {
                synchronized (this) {
                    if (state != State.ESTABLISHED) {
                        logger.debug("Connection timeout after {}, session is in state {}", timeout, state);
                        final IllegalStateException cause = new IllegalStateException(
                                "Session was not established after " + timeout);
                        negotiationFailed(cause);
                        changeState(State.FAILED);
                    } else if(channel.isOpen()) {
                        channel.pipeline().remove(NAME_OF_EXCEPTION_HANDLER);
                    }
                }
            }
        }, connectionTimeoutMillis, TimeUnit.MILLISECONDS);

        // FIXME, make sessionPreferences return HelloMessage, move NetconfHelloMessage to API
        sendMessage((NetconfHelloMessage)helloMessage);
        changeState(State.OPEN_WAIT);
    }

Anyway

Just tested it. I did not see such an error.

GET http://127.0.0.1:8080/restconf/operational/opendaylight-inventory:nodes/node/libnetconfd/yang-ext:mount

{
    "data": {
        "toaster": {
            "toasterManufacturer": "CESNET, z.s.p.o.",
            "toasterModelNumber": "toaster",
            "toasterStatus": "down"
        },
        "netconf-state": {
            "datastores": {
                "datastore": [
                    {
                        "name": "running"
                    },
                    {
                        "name": "startup"
                    },
                    {
                        "name": "candidate"
                    }
                ]
            },
            "sessions": {
                "session": [
                    {
                        "session-id": 2529,
                        "transport": "netconf-ssh",
                        "username": "repenno",
                        "source-host": "10.0.1.14",
                        "login-time": "2014-04-02T05:13:47Z",
                        "in-rpcs": 14,
                        "in-bad-rpcs": 0,
                        "out-rpc-errors": 0,
                        "out-notifications": 0
                    }
                ]
            },
            "schemas": {
                "schema": [
                    {
                        "identifier": "toaster",
                        "version": "2009-11-20",
                        "format": "yin",
                        "namespace": "http://netconfcentral.org/ns/toaster",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "toaster",
                        "version": "2009-11-20",
                        "format": "yang",
                        "namespace": "http://netconfcentral.org/ns/toaster",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-acm",
                        "version": "2012-02-22",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-acm",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-acm",
                        "version": "2012-02-22",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-acm",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-with-defaults",
                        "version": "2010-06-09",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-with-defaults",
                        "version": "2010-06-09",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "notifications",
                        "version": "2008-07-14",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:netconf:notification:1.0",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "notifications",
                        "version": "2008-07-14",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:netconf:notification:1.0",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "nc-notifications",
                        "version": "2008-07-14",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:netmod:notification",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "nc-notifications",
                        "version": "2008-07-14",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:netmod:notification",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-notifications",
                        "version": "2011-08-07",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-notifications",
                        "version": "2011-08-07",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-monitoring",
                        "version": "2010-10-04",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf-monitoring",
                        "version": "2010-10-04",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf",
                        "version": "2011-03-08",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:netconf:base:1.0",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-netconf",
                        "version": "2011-03-08",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:netconf:base:1.0",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-yang-types",
                        "version": "2010-09-24",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-yang-types",
                        "version": "2010-09-24",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-inet-types",
                        "version": "2010-09-24",
                        "format": "yin",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types",
                        "location": [
                            "NETCONF"
                        ]
                    },
                    {
                        "identifier": "ietf-inet-types",
                        "version": "2010-09-24",
                        "format": "yang",
                        "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types",
                        "location": [
                            "NETCONF"
                        ]
                    }
                ]
            },
            "statistics": {
                "netconf-start-time": "2014-04-02T05:13:47Z",
                "in-bad-hellos": 0,
                "in-sessions": 1,
                "dropped-sessions": 0,
                "in-rpcs": 14,
                "in-bad-rpcs": 0,
                "out-rpc-errors": 0,
                "out-notifications": 0
            }
        },
        "netconf": {
            "streams": {
                "stream": [
                    {
                        "name": "NETCONF",
                        "description": "NETCONF Base Notifications",
                        "replaySupport": true,
                        "replayLogCreationTime": "2014-03-25T01:18:06Z"
                    }
                ]
            }
        },
        "nacm": {
            "denied-operations": 0,
            "denied-data-writes": 0,
            "denied-notifications": 0
        }
    }
}


On Tue, Apr 1, 2014 at 5:49 PM, Madhusudhan Kandadai <madhusudhan.opendaylight@...> wrote:
Reinaldo,

I figured out my problem just now. That is because of incorrect port mentioned in 04-libnetconfd.xml. As I installed netopeer using docker and it uses port 1831:830 for talking to netconf server. So, I used port# 1831 in that xml, username & pwd as "root". Then, I am able to get the correct GET request as mentioned in the wiki. Have attached the response for your kind reference.

In the meanwhile, I am getting the error in OSGi command line: Did you face this error before:

2014-04-01 17:44:52.624 PDT [pool-39-thread-1] DEBUG o.o.c.n.u.AbstractNetconfSessionNegotiator - Connection timeout after HashedWheelTimeout(deadline: 1198888 ms ago, ), session is in state OPEN_WAIT
2014-04-01 17:44:52.632 PDT [pool-34-thread-2] ERROR o.o.c.s.c.n.NetconfDevice#libnetconfd - Netconf client NOT started. 
java.lang.IllegalStateException: Unable to create NetconfClient{label=libnetconfd, sessionId=0}
at org.opendaylight.controller.netconf.client.NetconfClient.get(NetconfClient.java:73) ~[na:na]
at org.opendaylight.controller.netconf.client.NetconfClient.<init>(NetconfClient.java:105) ~[na:na]
at org.opendaylight.controller.netconf.client.NetconfClient.clientFor(NetconfClient.java:83) ~[na:na]
at org.opendaylight.controller.sal.connect.netconf.NetconfDevice$3.run(NetconfDevice.java:268) ~[na:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_51]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Session was not established after HashedWheelTimeout(deadline: 1483740 ms ago, )
at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:37) ~[na:na]
at org.opendaylight.controller.netconf.client.NetconfClient.get(NetconfClient.java:69) ~[na:na]
... 8 common frames omitted
Caused by: java.lang.IllegalStateException: Session was not established after HashedWheelTimeout(deadline: 1483740 ms ago, )
at org.opendaylight.controller.netconf.util.AbstractNetconfSessionNegotiator$2.run(AbstractNetconfSessionNegotiator.java:115) ~[na:na]
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:542) ~[na:na]
at io.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440) ~[na:na]
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:381) ~[na:na]
... 1 common frames omitted
2014-04-01 17:44:52.633 PDT [pool-39-thread-1] DEBUG o.o.c.n.u.AbstractNetconfSessionNegotiator - Changing state from : OPEN_WAIT to : FAILED

Thanks,
Madhusudhan
On Tuesday, April 1, 2014 5:24 PM, Reinaldo Penno <rapenno@...> wrote:
I will test again later today and get back to you.

In the meantime, can you test something simple? Change header to <Accept: application/xml> and perform GET again.  I seem to remember an issue around that.

The error below seem network related. I will retest anyway.




On Tue, Apr 1, 2014 at 3:59 PM, Madhusudhan Kandadai <madhusudhan.opendaylight@...> wrote:
Thanks Reinaldo.

I installed docker image mentioned at https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Docker_image and I am able to see the response sent by server in XML after doing "ssh root@localhost -p 1831 -s netconf."

I have created an xml mentioned at https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Editing_Netconf_Client_Configuration_by_Creating_Initial_Controller_Config_File and named it as "04-libnetconfd.xml". Have enabled the logs at logback.xml. After restarting the controller, when I issue GET request "http://localhost:8080/restconf/operational/opendaylight-inventory:nodes" I do get the following response:

{
    "nodes": {
        "node": [
            {
                "id": "libnetconfd"
            }
        ]
    }
}


Sorry for my repeated question.

Thanks,
Madhusudhan
On Friday, March 28, 2014 6:38 PM, Reinaldo Penno <rapenno@...> wrote:


On Fri, Mar 28, 2014 at 2:45 PM, Madhusudhan Kandadai <madhusudhan.opendaylight@...> wrote:
Thanks Reinaldo. I have two scenarios in testing netconf SB plugin:

(a) Have LINC switch in another VM which actually runs netconf code. I tried to make it work in testing netconf plugin by starting LINC switch in another VM. Have changed IP address, username,port(I used 830 for ssh and put"false" in tcp-only), enabled the log. Unable to recollect where I got stuck. I am still refining it to get more details about this

(b) Have configured netopeer in another VM and followed the steps mentioned at https://groups.google.com/forum/#!topic/libnetconf/sVaj8tYYZC0. While doing make && make install for netopeer - server, 

I got this error: .obj/src/server_comm_dbus.o: In function `comm_loop':
server_comm_dbus.c:(.text+0xee3): undefined reference to `server_sessions_get_by_ncid'. This is similar to the one : http://pastebin.com/vcvZp4bm. I could not find any resolution there.

Just checking whether anyone working/worked on this netconf plugin faced this error before? If yes, could you advise on how to overcome this error?

Thanks,
Madhusudhan

On Tuesday, March 25, 2014 6:04 PM, Reinaldo Penno <rapenno@...> wrote:
okay, there seems a confusion.

ODL has an internal Netconf server. This server is used for configuration of internal ODL stuff. 

In order to test the Netconf SB plug-in you need an _external_ Netconf server device - outside ODL. This can be a number of devices or a stand-alone daemon like netopeer running Netconf Server code.










On Tue, Mar 25, 2014 at 4:42 PM, Madhusudhan Kandadai <madhusudhan.opendaylight@...> wrote:
Hi Reinaldo,

I believe netconf server will be started automatically after starting the controller. Here is the following lines called from config.ini. (Please correct me if I am wrong)
 
# Netconf startup configuration
netconf.tcp.address=127.0.0.1
netconf.tcp.port=8383

netconf.tcp.client.address=127.0.0.1
netconf.tcp.client.port=8383

netconf.ssh.address=0.0.0.0
netconf.ssh.port=1830
netconf.ssh.pk.path = ./configuration/RSA.pk


so, do you think I have to change the ip address, port#, which are defined at 02-libnetconfd.xml according to the one mentioned above? If not, can you please shed some light on this ? Sorry if this is a basic question.

Thanks,
Madhusudhan

On Monday, March 24, 2014 8:20 PM, Reinaldo Penno <rapenno@...> wrote:
Which device are you using as a netconf server? You have to substitute the IP address on the example by the IP address of your  netconf device. You need to make sure netconf is running on the device, etc.




On Mon, Mar 24, 2014 at 7:52 PM, Madhusudhan Kandadai <madhusudhan.opendaylight@...> wrote:
Thanks Reinaldo. I actually took the latest controller from wget https://jenkins.opendaylight.org/integration/job/integration-project-centralized-integration/lastSuccessfulBuild/artifact/distributions/base/target/distributions-base-0.1.2-SNAPSHOT-osgipackage.zip, created a file named "04-libnetconfd.xml" in opendaylight/configuration/initial

Then started the controller using of13 plugin, but I could not see any notification like this:

2014-02-12 04:42:10.043 PST [pool-23-thread-1] INFO  o.o.c.s.c.n.NetconfDevice#libnetconfd - Starting Netconf Client on: /10.0.1.27:830

Am I doing something wrong?

Thanks,
Madhusudhan


On Monday, March 24, 2014 7:37 PM, Reinaldo Penno <rapenno@...> wrote:
If the file is correct, nothing else is needed and a netconf session will be established between ODL and netconf server (device)
 


On Mon, Mar 24, 2014 at 4:45 PM, Madhusudhan Kandadai <madhusudhan.opendaylight@...> wrote:
Hello,

I am interested in performing testing on netconf plugin. I have netconf server and just want to configure ODL. I have gone through the below links on how to test netconf plugin: https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf and https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf:Example_Configuration

If I understand correctly:

1. Should I need to configure yumapro-13.04. If yes, I found the documentation at https://github.com/pikagrue/test-repository-2/tree/master/yumapro-13.04. I am trying hard to install yumapro-13.04 and can you point me the right link for installing the same.
2. Once done with the above step, I *think* I can go to this step https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Connecting_to_the_Controller_Configuration_Server and follow the sequence in order.

Does anybody worked on testing netconf plugin, so I need to ask the sequence to get familiar in testing netconf plugin.

Thanks in advance!

Madhusudhan

_______________________________________________
controller-dev mailing list
controller-dev@...
https://lists.opendaylight.org/mailman/listinfo/controller-dev

















Join integration-dev@lists.opendaylight.org to automatically receive all group messages.