cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1090
Views
10
Helpful
3
Replies

correct xmlns for BGP service package

DeanMoore
Level 1
Level 1

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'
}
1 Accepted Solution

Accepted Solutions

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:

Screen Shot 2020-02-24 at 10.38.35 AM.png

in cisco-ios-cli-3.0 - the "bgp" layer in timers does not exist:

Screen Shot 2020-02-24 at 10.38.27 AM.png

 

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:

https://community.cisco.com/t5/nso-developer-hub-discussions/error-element-only-exist-for-a-ned-id/m-p/4034137

 

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

View solution in original post

3 Replies 3

DeanMoore
Level 1
Level 1

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
}

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:

Screen Shot 2020-02-24 at 10.38.35 AM.png

in cisco-ios-cli-3.0 - the "bgp" layer in timers does not exist:

Screen Shot 2020-02-24 at 10.38.27 AM.png

 

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:

https://community.cisco.com/t5/nso-developer-hub-discussions/error-element-only-exist-for-a-ned-id/m-p/4034137

 

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

gmuloche,

 

Thank you, that worked perfectly, I removed the conflicting NEDs and it worked right away.

 

I owe you a beer