02-21-2020 03:00 AM
Morning,
I'm struggling with part of NSO service package creation.
Although I was able to push config to a specific device via restconf I want to move the BGP config to a service template.
When I reload the package I get an error as per below but not sure what I should be putting in its place.
This is my template xml
<config>
<ip xmlns="urn:ios">
<route>
<ip-route-interface-list>
<prefix>{/neighbour_static}</prefix>
<mask>{/neighbour_mask}</mask>
<interface>{/neighbour_interface}</interface>
</ip-route-interface-list>
</route>
</ip>
<router xmlns="urn:cisco-ios-cli-3.8">
<bgp>
<as-no>{/local_as}</as-no>
<bgp>
<log-neighbor-changes/>
</bgp>
<neighbor>
<id>{/remote_ip}</id>
<remote-as>{/remote_as}</remote-as>
</neighbor>
<auto-summary>false</auto-summary>
<timers>
<bgp>
<keepalive>10</keepalive>
<holdtime>30</holdtime>
</bgp>
</timers>
</bgp>
</router>
</config>This is the yang model, I know its not perfect but it would be ok.
container static_route {
leaf neighbour_static {
type inet:ipv4-address;
}
leaf neighbour_mask {
type inet:ipv4-address;
}
leaf neighbour_interface {
type string;
}
}
container bgp {
leaf local_as {
type uint32;
}
container neigbour {
leaf neighbour_ip {
type inet:ipv4-address;
}
leaf remote_as {
type uint32;
}
}
}and finally the error I get when issuing package reload
reload-result {
package bgp-service
result false
info bgp-service-template.xml:21 Unknown namespace: 'urn:cisco-ios-cli-3.8'
}
Solved! Go to Solution.
02-24-2020 01:43 AM
Hello -
so here is what I think is happening:
0. Assumption you have NSO 5.x
1. you have the two default NEDs loaded for cisco-ios (that is 3.0 and 3.8 - you can check with `show packages package oper-status`)
2. the error comes from the `bgp` keyword inside timers
in cisco-ios-cli-3.8 - you have an intermediate "bgp" layer in timers:
in cisco-ios-cli-3.0 - the "bgp" layer in timers does not exist:
The error comes from the fact that your templates is trying to configure this leaf for an "ambiguous" namespace.
Essentially this is the same error as in:
And the solutions are:
1. remove the cisco-ios-cli-3.0 if you don't need it - packages reload (first answer in the thread)
2. Use the <?if ned-id ...?> syntax in your template as described in the second answer of the thread and in nso_cdm_migration guide in the section "Service Handling of ambiguous device models" - "Template Service" - and packages reload
Regards
Guillaume
02-21-2020 03:05 AM - edited 02-21-2020 03:05 AM
After adding xmlns="urn:ios" I get this output which is where I got the cisco-ios-cli-3.8 from
reload-result {
package bgp-service
result false
info bgp-service-template.xml:33 Element: 'bgp' only exists for ned-id: cisco-ios-cli-3.8:cisco-ios-cli-3.8
}
02-24-2020 01:43 AM
Hello -
so here is what I think is happening:
0. Assumption you have NSO 5.x
1. you have the two default NEDs loaded for cisco-ios (that is 3.0 and 3.8 - you can check with `show packages package oper-status`)
2. the error comes from the `bgp` keyword inside timers
in cisco-ios-cli-3.8 - you have an intermediate "bgp" layer in timers:
in cisco-ios-cli-3.0 - the "bgp" layer in timers does not exist:
The error comes from the fact that your templates is trying to configure this leaf for an "ambiguous" namespace.
Essentially this is the same error as in:
And the solutions are:
1. remove the cisco-ios-cli-3.0 if you don't need it - packages reload (first answer in the thread)
2. Use the <?if ned-id ...?> syntax in your template as described in the second answer of the thread and in nso_cdm_migration guide in the section "Service Handling of ambiguous device models" - "Template Service" - and packages reload
Regards
Guillaume
02-24-2020 07:24 AM
gmuloche,
Thank you, that worked perfectly, I removed the conflicting NEDs and it worked right away.
I owe you a beer
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide