08-28-2024 07:58 AM - edited 08-28-2024 08:01 AM
Hello Cisco Community,
I’m encountering an issue with Cisco NSO and Netconf while managing loopback interfaces on NX-OS devices. Initially, I had a simple template to configure a loopback interface:
<config-template xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>{$DEVICE_NAME}</name>
<config>
<System xmlns="http://cisco.com/ns/yang/cisco-nx-os-device">
<intf-items>
<lb-items>
<LbRtdIf-list>
<id>lo{id}</id>
<adminSt>{admin_st}</adminSt>
</LbRtdIf-list>
</lb-items>
</intf-items>
</System>
</config>
</device>
</devices>
</config-template>
With this template, the loopback interface configuration was pushed to the device, but the NSO CDB would get out of sync with the actual device configuration. To resolve this, I updated the template to include all the additional configurations that NX-OS applies when a loopback interface is added:
<config-template xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>{$DEVICE_NAME}</name>
<config>
<System xmlns="http://cisco.com/ns/yang/cisco-nx-os-device">
<intf-items>
<lb-items>
<LbRtdIf-list>
<id>lo{id}</id>
<adminSt>{admin_st}</adminSt>
</LbRtdIf-list>
</lb-items>
</intf-items>
<intf-items>
<lb-items>
<LbRtdIf-list>
<id>lo{id}</id>
<rtvrfMbr-items>
<tDn>/System/inst-items/Inst-list[name='default']</tDn>
</rtvrfMbr-items>
</LbRtdIf-list>
</lb-items>
</intf-items>
<inst-items>
<Inst-list>
<name>default</name>
<rsvrfMbr-items>
<RsVrfMbr-list>
<tDn>/System/intf-items/lb-items/LbRtdIf-list[id='lo{id}']</tDn>
</RsVrfMbr-list>
</rsvrfMbr-items>
</Inst-list>
</inst-items>
<pltfm-items>
<intf-items>
<if-items>
<If-list>
<id>lo{id}</id>
</If-list>
</if-items>
</intf-items>
</pltfm-items>
</System>
</config>
</device>
</devices>
</config-template>
After this update, the NSO CDB and the device are in sync, which solved my initial issue. However, a new problem has surfaced: I am no longer able to delete loopback interfaces. When I attempt to delete a loopback interface, I encounter the following error during the commit:
admin@ncs(config)# commit dry-run
cli {
local-node {
data devices {
device SPN01.FAB00.EWR00 {
config {
System {
intf-items {
lb-items {
- LbRtdIf-list lo0 {
- adminSt up;
- rtvrfMbr-items {
- tDn /System/inst-items/Inst-list[name='default'];
- }
- }
}
}
inst-items {
Inst-list default {
rsvrfMbr-items {
- RsVrfMbr-list /System/intf-items/lb-items/LbRtdIf-list[id='lo0'] {
- }
}
}
}
pltfm-items {
intf-items {
if-items {
- If-list lo0 {
- }
}
}
}
}
}
}
}
}
}
admin@ncs(config)# commit
Aborted: RPC error towards SPN01.FAB00.EWR00: operation_failed: Cannot delete object of class:platformIf
admin@ncs(config)#
It seems that the additional configuration elements introduced in the updated template, particularly those related to platformIf, are causing issues during deletion.
Has anyone else experienced this or have any suggestions on how to address this problem? I would appreciate any insights or recommendations on how to properly synchronize NSO with the device while retaining the ability to delete loopback interfaces.
Thank you!
09-02-2024 01:17 PM
Hi, I have.
A couple of possible solutions for you to test and see what you prefer:
1- Add your additional template structure as a pre-create template and not a create template. This will remove the new config from Fastmap and NSO will not try to delete it. The drawback is that the extra config will remain in CDB until you perform a sync-from and the device will be out of sync after delete.
2- Just use the initial template and work with partial-syncs for the nodes that you care about with a crafted action.
3- Contact your NSO team, as presented in dev Days, there are new licensed "generic NETCONF NEDs" that have advanced features, including the potential to skip nodes when reading from the devices.
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