cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2286
Views
2
Helpful
14
Replies

Unable to load YANG file in a new NED

koushik331
Level 1
Level 1

Hi

I'm experimenting with a NED and wrote a simple YANG file to model just the sysName of a HP device.

However, I can't get the YANG file loaded. Here is what I see:

admin@ncs# devices device hp-5900 check-yang-modules verbose

module {

    name hp-5900

    status unknown <---------

}

Does anybody know how to debug further?

Thanks

Kiran

1 Accepted Solution

Accepted Solutions

You're not in config mode in NSO...

View solution in original post

14 Replies 14

frjansso
Cisco Employee
Cisco Employee

Anything if you check the status of the packages in the CLI (show packages)?

Anything in logs/devel.log or logs/ncs-java-vm.log?

Nothing interesting in “show packages”:

packages package hp-5900

package-version 3.0.1

description    "NED package for the HP 5930"

ncs-min-version

directory      /var/opt/ncs/state/packages-in-use/1/hp-5900

component hp-5900

  ned cli ned-id  hp-5900

  ned cli java-class-name com.tailf.packages.ned.hp.HpNedCli

  ned device vendor hp

NAME      VALUE

Something interesting on Xpath.trace:

20-Jun-2017::16:37:03.537 Evaluating XPath for: /devices/device[name='BBTPN51J1R_PE4']/ned-settings:

  ../ncs:device-type/ncs:cli/ncs:ned-id = 'cisco-ios-xr-id:cisco-ios-xr'

exists("/ncs:devices/device{BBTPN51J1R_PE4}/device-type/cli") = true

get_elem("/ncs:devices/device{BBTPN51J1R_PE4}/device-type/cli/ned-id") = cisco-ios-xr-id:cisco-ios-xr

20-Jun-2017::16:37:03.538 XPath for: /devices/device[name='BBTPN51J1R_PE4']/ned-settings returns true

20-Jun-2017::16:37:05.791 Evaluating XPath for: /devices/device[name='hp-5900']/config/ios:EXEC:

  not(../../ncs:module) or ../../ncs:module[ncs:name='tailf-ned-cisco-ios']

get_next(/ncs:devices/device{hp-5900}/module) = {tailf-ned-hp-5900}

exists("/ncs:devices/device{hp-5900}/module{tailf-ned-cisco-ios}") = false

20-Jun-2017::16:37:05.793 XPath for: /devices/device[name='hp-5900']/config/ios:EXEC returns false

20-Jun-2017::16:37:07.006 Evaluating XPath for: /devices/device[name='hp-5900']/config/ios:EXEC:

  not(../../ncs:module) or ../../ncs:module[ncs:name='tailf-ned-cisco-ios']

get_next(/ncs:devices/device{hp-5900}/module) = {tailf-ned-hp-5900}

exists("/ncs:devices/device{hp-5900}/module{tailf-ned-cisco-ios}") = false

20-Jun-2017::16:37:07.008 XPath for: /devices/device[name='hp-5900']/config/ios:EXEC returns false

20-Jun-2017::16:45:39.378 Query(56): Starting evaluation of:

  ncs:devices/device[contains(name,'BBTPN51J1R_PE4')]

Why is it trying to look for cisco-ios when searching for hp-5900?

Thanks

Kiran

Looking at my system, I also see this.. but the (IOS) NED is functional.... what is the actual issue you experience?

I'm unable to configure the HP through NSO:

devices device hp-5900 check-yang-modules verbose

module {

    name hp-5900

    status unknown

}

admin@ncs#

admin@ncs#

admin@ncs#

admin@ncs# devices device hp-5900 config sysname

-----------------------------------------^

syntax error: incomplete path

admin@ncs# devices device hp-5900 config <------- I can't type "?" here and nothing works.

-----------------------------------------^

syntax error: incomplete path

Can you please zip up the NED and I can take a look?

Sent from my iPhone

Here is the NED zip.


Thanks

Kiran

Works for me.

Please note that you have an error in your netsim/Makefile, it still references the original NED, which leads me to ask, did you ever rebuild the entire NED?


admin@ncs# show packages package oper-status | notab

packages package hp-5900

oper-status up

admin@ncs(config)# devices device hp config hp:sysname ?

Possible completions:

  <WORD> - This system's network name (max 32 chars)

Glad it worked for you..

I just did a "make all" in the src directory to rebuild the NED. Is that not sufficient?

Thanks

Kiran

Try a make clean all...

I did that - but still no luck - not sure what I'm doing different...

[agrahki@nj51nsoc1v src]$ make clean all

rm -rf ncsc-out/* ../load-dir/* ncsc-out/*

rm -f ../jar/*.jar

rm -f java/src/com/tailf/packages/ned/hp/namespaces/*.java

cd java && ant clean

Buildfile: /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/build.xml

clean:

   [delete] Deleting directory /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/build

   [delete] Deleting: /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/shared-jar/hp-ns.jar

   [delete] Deleting: /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/private-jar/hp.jar

BUILD SUCCESSFUL

Total time: 0 seconds

cd ../netsim && make clean

make[1]: Entering directory `/opt/ncs/ncs-4.3.1/packages/neds/hp-5900/netsim'

make[1]: Leaving directory `/opt/ncs/ncs-4.3.1/packages/neds/hp-5900/netsim'

/opt/ncs/current/bin/ncsc --ncs-compile-module yang/tailf-ned-hp-5900-id.yang \

                --ncs-device-dir ncsc-out \

        --ncs-skip-statistics \

                --ncs-device-type cli-ned && \

  cp ncsc-out/modules/fxs/tailf-ned-hp-5900-id.fxs ../load-dir

/opt/ncs/current/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.tailf.packages.ned.hp.namespaces --emit-java java/src/com/tailf/packages/ned/hp/namespaces/HpId.java ncsc-out/modules/fxs/tailf-ned-hp-5900-id.fxs

/opt/ncs/current/bin/ncsc --ncs-compile-module yang/tailf-ned-hp-5900.yang \

                --ncs-device-dir ncsc-out \

        --ncs-skip-statistics \

                --ncs-device-type cli-ned && \

  cp ncsc-out/modules/fxs/tailf-ned-hp-5900.fxs ../load-dir

/opt/ncs/current/bin/ncsc --java-disable-prefix --exclude-enums --fail-on-warnings --java-package com.tailf.packages.ned.hp.namespaces --emit-java java/src/com/tailf/packages/ned/hp/namespaces/hp.java ncsc-out/modules/fxs/tailf-ned-hp-5900.fxs

cd java && ant -q all

    [javac] /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/src/com/tailf/packages/ned/hp/HpNedCli.java:125: warning: [deprecation] CONNECT_CONNECTION_REFUSED in NedWorker has been deprecated

    [javac]                 worker.connectError(NedWorker.CONNECT_CONNECTION_REFUSED,

    [javac]                                              ^

    [javac] /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/src/com/tailf/packages/ned/hp/HpNedCli.java:125: warning: [deprecation] connectError(int,String) in NedWorker has been deprecated

    [javac]                 worker.connectError(NedWorker.CONNECT_CONNECTION_REFUSED,

    [javac]                       ^

    [javac] /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/src/com/tailf/packages/ned/hp/HpNedCli.java:141: warning: [deprecation] NedException(String) in NedException has been deprecated

    [javac]                 throw new NedException("Authentication failed");

    [javac]                       ^

    [javac] /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/src/com/tailf/packages/ned/hp/HpNedCli.java:178: warning: [deprecation] NedCapability(String,String,String,String,String,String) in NedCapability has been deprecated

    [javac]                     capas[0] = new NedCapability(

    [javac]                                ^

    [javac] /opt/ncs/ncs-4.3.1/packages/neds/hp-5900/src/java/src/com/tailf/packages/ned/hp/HpNedCli.java:203: warning: [deprecation] NedException(String) in NedException has been deprecated

    [javac]                 new NedException("Failed to read device version string");

    [javac]                 ^

    [javac] 5 warnings

BUILD SUCCESSFUL

Total time: 0 seconds

cd ../netsim && make all

make[1]: Entering directory `/opt/ncs/ncs-4.3.1/packages/neds/hp-5900/netsim'

/opt/ncs/current/netsim/confd/bin/confdc  -c -o tailf-ned-hp-5900.fxs  ../src/yang/tailf-ned-hp-5900.yang

/opt/ncs/current/netsim/confd/bin/confdc -c --export none -o aaa.fxs /opt/ncs/current/netsim/confd/src/confd/aaa/tailf-aaa.yang

/opt/ncs/current/netsim/confd/bin/confdc -c --export none -a /opt/ncs/current/netsim/confd/src/confd/yang/ietf-netconf-acm-ann.yang\

         -o ietf-netconf-acm.fxs /opt/ncs/current/netsim/confd/src/confd/yang/ietf-netconf-acm.yang

/opt/ncs/current/netsim/confd/bin/confdc -c confd.c.cli

/opt/ncs/current/netsim/confd/bin/confdc -c confd.i.cli

make[1]: Leaving directory `/opt/ncs/ncs-4.3.1/packages/neds/hp-5900/netsim'

[agrahki@nj51nsoc1v src]$

[agrahki@nj51nsoc1v src]$ ncs_cli -Cvu admin

Connected to CLI server

cli: sending version

cli: sending username

cli: sending ip

cli: sending type

cli: sending groups

cli: sending hostname

cli: sending ttyname

cli: sending cwd

cli: sending terminal

cli: sending ssh_connection info

cli: sending CLI style

cli: sending uid

cli: sending gid

cli: sending gids

cli: sending width

cli: sending height

cli: sending interactive

cli: sending noaaa

cli: sending stop_on_error

admin connected from 10.134.9.238 using ssh on nj51nsoc1v

admin@ncs# packages reload

reload-result {

    package Itential Tools

    result true

}

reload-result {

    package cisco-ios

    result true

}

reload-result {

    package cisco-iosxr

    result true

}

reload-result {

    package cisco-nx

    result true

}

reload-result {

    package hp-5900

    result true

}

System message at 2017-06-22 08:26:34...

    Subsystem stopped: ncs-dp-10-cisco-ios:IOSDp

System message at 2017-06-22 08:26:34...

    Subsystem started: ncs-dp-12-cisco-ios:IOSDp

admin@ncs# admin@ncs# admin@ncs# devices device hp-5900 ?

Possible completions:

  check-sync              Check if the NCS config is in sync with the device

  check-yang-modules      Check if NCS and the device have compatible YANG modules

  compare-config          Compare the actual device config with the NCS copy

  config                  NCS copy of the device configuration

  connect                 Connect to the device

  delete-config           Delete the config in NCS without deleting it in the device

  disconnect              Close all sessions to the device

  live-status             Status data fetched from the device

  live-status-protocol    Additional protocols for the live-tree (read-only)

  netconf-notifications   NETCONF notifications from the device

  ping                    ICMP ping the device

  scp-from                Secure copy file to the device

  scp-to                  Secure copy file to the device

  ssh                     SSH connection configuration

  sync-from               Synchronize the config by pulling from the device

  sync-to                 Synchronize the config by pushing to the device

admin@ncs# devices device hp-5900 config hp?

                                         ^

% Invalid input detected at '^' marker.

admin@ncs# devices device hp-5900 config hp:sysname ?

                                         ^

% Invalid input detected at '^' marker.

admin@ncs# devices device hp-5900 config hp:sysname ?

                                         ^

% Invalid input detected at '^' marker.

admin@ncs# devices device hp-5900 config hp:sysname

-----------------------------------------^

You're not in config mode in NSO...

Phew - That finally worked!

Thanks for patiently helping with this!

You're welcome!