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

Error Element Only Exist for a NED-ID

Hi Guys,

I have created a template in NSO with the new NED for iOS XRv. I created .YANG and XML file then compile it but I got this error message in NSO package status:

netlab@ncs# show packages package oper-status 
packages package a10-acos-cli-3.0
 oper-status up
packages package alu-sr-cli-3.4
 oper-status up
packages package cisco-asa-cli-6.6
 oper-status up
packages package cisco-ios-cli-3.0
 oper-status up
packages package cisco-ios-cli-3.8
 oper-status up
packages package cisco-iosxr-cli-3.0
 oper-status up
packages package cisco-iosxr-cli-3.5
 oper-status up
packages package cisco-iosxr-cli-7.18
 oper-status up
packages package cisco-nx-cli-3.0
 oper-status up
packages package dell-ftos-cli-3.0
 oper-status up
packages package juniper-junos-nc-3.0
 oper-status up
packages package ospf-underlay
 oper-status file-load-error
 oper-status error-info "ospf-underlay-template.xml:39 Element: 'prefix-sid' only exists for ned-id: cisco-iosxr-cli-7.18:cisco-iosxr-cli-7.18"

In fact, the new version of Cisco XRv NED has been installed successfully.

I have modified the Makefile of ospf-underlay package template as below:

Spoiler

all: fxs
.PHONY: all

# Include standard NCS examples build definitions and rules
include $(NCS_DIR)/src/ncs/build/include.ncs.mk

src=$(wildcard yang/*.yang)
DIRS = ../load-dir
FXS = $(SRC:yang/%.yang=../load-dir/%.fxs)

## Uncomment and patch the line below if you have a dependency to a NED
## or to other YANG files
# YANGPATH += ../../<ned-name>/src/ncsc-out/modules/yang \
# ../../<pkt-name>/src/yang

YANGPATH += ../../cisco-iosxr-cli-7.18/src/ncsc-out/modules/yang
NCSCPATH = $(YANGPATH:%=--yangpath %)
YANGERPATH = $(YANGPATH:%=--path %)

fxs: $(DIRS) $(FXS)
.PHONY: fxs

$(DIRS):
mkdir -p $@

../load-dir/%.fxs: yang/%.yang
$(NCSC) `ls $*-ann.yang > /dev/null 2>&1 && echo "-a $*-ann.yang"` \
$(NCSCPATH) -c -o $@ $<
clean:
rm -rf $(DIRS)
.PHONY: clean

Anybody know what is the missing steps/config that I should do?

Please find attached my YANG and XML configuration per your reference. Really appreciate and thanks for your help.

 

Regards,

-Rp

1 ACCEPTED SOLUTION

Accepted Solutions

yfherzog
Cisco Employee
Cisco Employee

It complains that the XR NED that you have highlighted is supporting those configs, while the other XR NEDs that you have there don't.

In this case, the others seems to be the generic ones shipped with NSO, so I think you can just delete then from the packages dir, reload packages, and you should be good.

View solution in original post

2 REPLIES 2

yfherzog
Cisco Employee
Cisco Employee

It complains that the XR NED that you have highlighted is supporting those configs, while the other XR NEDs that you have there don't.

In this case, the others seems to be the generic ones shipped with NSO, so I think you can just delete then from the packages dir, reload packages, and you should be good.

gmuloche
Cisco Employee
Cisco Employee

Hello,

 

as an alternative to Yftach's answer - in the case you *would* need to keep both NEDs (though it is most probably not the case here) you could use the following syntax (described in the documentation of NSO 5.x in nso_cdm_migration guide in the section "Service Handling of ambiguous device models" - "Template Service"):

 

<config-template xmlns="http://tail-f.com/ns/config/1.0">
  <devices xmlns="http://tail-f.com/ns/ncs">
    <device foreach="{apache-device}">
      <name>{current()}</name>
      <config>
        <?if-ned-id apache-nc-1.0:apache-nc-1.0?>
          <vhosts xmlns="urn:apache">
            <vhost>
              <hostname>{/vhost}</hostname>
              <doc-root>/srv/www/{/vhost}</doc-root>
            </vhost>
          </vhosts>
        <?elif-ned-id apache-nc-1.1:apache-nc-1.1?>
          <public xmlns="urn:apache">
            <vhosts>
              <vhost>
                <hostname>{/vhost}</hostname>
                <aliases>{/vhost}.public</aliases>
                <doc-root>/srv/www/{/vhost}</doc-root>
              </vhost>
            </vhosts>
          </public>
        <?end?>
      </config>
    </device>
  </devices>
</config-template>

So in your case adding an if for the ned-id version 7.17 of of the NED around your template.

 

Regards,

 

Guillaume

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: