cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1876
Views
5
Helpful
4
Replies

How to Configure Southbound Locked Devices

crench92
Spotlight
Spotlight

So if I have a set of southbound-locked devices in the CDB, how can I use them when testing service configuration?  Currently, I get an error indicating:

 

"Python cb_create error. item does not exist (1): No capabilities found for device: SDPRouter1. Has a sync-from the device been performed?"
 
I think this happens with real devices during the initial sync operation but since my devices aren't "real", I have nothing to sync-to or from.  I'm just trying to test my service config against the NED.
4 Replies 4

u.avsec
Spotlight
Spotlight

You can look up what kind of capabilities a typical device you are adding has and add those capabilities yourself. Doesn't have to be all the capabilities, just the ones necessary to allow configuration of the device.

 

Then afterwards when you do first sync-to/from actual capabilities will be synced. So this is not breaking anything (as much as I know). 

 

Example capabilities that I use to fake a device:

 

CISCO_XE: Set[str] = {
    'http://tail-f.com/ns/ncs-ned/cli-allow-abbrev-keys',
    'http://tail-f.com/ns/ncs-ned/show-partial?path-format=key-path',
    'http://tail-f.com/ns/ncs-ned/show-stats-path',
    'urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim',
    'urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08&module=ietf-interfaces',
    'urn:ietf:params:xml:ns:yang:ietf-ip?revision=2014-06-16&module=ietf-ip',
    'urn:ios?revision=2021-02-11&module=tailf-ned-cisco-ios',
    'urn:ios-stats?revision=2021-02-11&module=tailf-ned-cisco-ios-stats',
}

CISCO_XR: Set[str] = {
    'http://tail-f.com/ned/cisco-ios-xr?revision=2020-02-21&module=tailf-ned-cisco-ios-xr',
    'http://tail-f.com/ned/cisco-ios-xr-stats?revision=2020-02-21&module=tailf-ned-cisco-ios-xr-stats',
    'http://tail-f.com/ns/ncs-ned/cli-allow-abbrev-keys',
    'http://tail-f.com/ns/ncs-ned/show-partial?path-format=cmd-path-modes-only',
    'http://tail-f.com/ns/ncs-ned/show-stats-path',
    'urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim',
    'urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08&module=ietf-interfaces',
    'urn:ietf:params:xml:ns:yang:ietf-ip?revision=2014-06-16&module=ietf-ip',
}

Be careful though to not configure something that doesn't exist on the actual device since after you pull something like this off all you are interacting with is pure device model. This means interface Ge 100000/2020202020/202020202/38437893274 is possible but clearly won't be on the device.

 

Well, how is this configured in NSO?  From the error I get, this is operational data.

 

admin@ncs(config)# load merge test_capability.xml

Loading.

Error: on line 5: object is not writable: /ncs:devices/ncs:device[ncs:name='SDPRouter1']/ncs:capability

 

root@nso-0:/# cat test_capability.xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>SDPRouter1</name>
<capability>
<uri>http://tail-f.com/ns/ncs-ned/cli-allow-abbrev-keys</uri>
</capability>
<capability>
<uri>http://tail-f.com/ns/ncs-ned/show-partial?path-format=key-path</uri>
</capability>
<capability>
<uri>http://tail-f.com/ns/ncs-ned/show-stats-path</uri>
</capability>
<capability>
<uri>urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim</uri>
</capability>
<capability>
<uri>urn:ietf:params:xml:ns:yang:ietf-interfaces</uri>
<revision>2014-05-08</revision>
<module>ietf-interfaces</module>
</capability>
<capability>
<uri>urn:ietf:params:xml:ns:yang:ietf-ip</uri>
<revision>2014-06-16</revision>
<module>ietf-ip</module>
</capability>
<capability>
<uri>urn:ios</uri>
<revision>2022-03-18</revision>
<module>tailf-ned-cisco-ios</module>
</capability>
<capability>
<uri>urn:ios-stats</uri>
<revision>2022-03-18</revision>
<module>tailf-ned-cisco-ios-stats</module>
</capability>
</device>
</devices>
</config>

If you are doing it via CLI: devices device test add-capability uri

Just to add here that there are two other ways to configure capabilities, you can copy them from a capability profile or from another device:

admin@lower-nso-1> request devices device ex0 copy-capabilities from-
Possible completions:
from-device from-profile

Copying from a working device is particularly useful. So, if you have another device of the same NED that is working, you can just copy its capabilities.