cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1095
Views
0
Helpful
2
Replies

Shared create on list keys?

grundler
Level 1
Level 1
We ran into an issue with two different services stepping on each-others' toes when writing BGP config to a Nexus device.  Service A touches the device first, initially populating the BGP config on the router, and then Service B comes along later and adds some additional peers.  The device config in CDB looks like the following:
 
```
<config>
  <router xmlns="http://tail-f.com/ned/cisco-nx">
    <bgp refcounter="2" backpointer="[ /ncs:services/svcA /ncs:services/svcB ]">
    <id>65001</id>
     ...
    <neighbor refcounter="1" backpointer="[ /ncs:services/svcA]" >
      <id>1.2.3.4</id>
    </neighbor>
    <neighbor refcounter="1" backpointer="[ /ncs:services/svcB ]" >
      <id>4.5.6.7</id>
    </neighbor>
```
 
What is confusing me is that the refcounter and backpointers indicate that both services have 'ownership' of the data in the /devices tree like I expected to see, but after deploying service B, service A goes out of sync.  If I do a re-deploy dry-run, service A wipes out the changes that were created by service B.  Can someone clue me in on what I'm missing?
2 Replies 2

snovello
Cisco Employee
Cisco Employee
We should see the template for this service. My guess is you don’t have the default tags=’merge’ behavior. That would behave as you are expecting.

My understanding is that 'merge' is the default behavior if no tag is used:

 

Here is the template applied by Service A:

      <router xmlns="http://tail-f.com/ned/cisco-nx">

        <ospf>
          <id>CORE</id>
          <bfd/>
          <router-id>{$loopback0}</router-id>
        </ospf>

        <bgp>
          <id>{/evpn-overlay/as-number}</id>
          <log-neighbor-changes/>
          <template>
            <peer>
              <name>{/name}-PEERS</name>
              <update-source>loopback0</update-source>
              <address-family>
                <proto>l2vpn</proto>
                <type>evpn</type>
                <route-reflector-client/>
                <send-community>
                  <attr>extended</attr>
                </send-community>
              </address-family>
              <remote-as>{/evpn-overlay/as-number}</remote-as>
            </peer>
          </template>
          <?foreach {/evpn-overlay/leaf/name}?>
          <neighbor>
            <id>{deref(current())/../loopback-ipv4-address}</id>
            <description>{current()}</description>
            <inherit>
              <peer>{/name}-PEERS</peer>
            </inherit>
          </neighbor>
          <?end?>
        </bgp>
      </router>

 

Here is the template for Service B:

    <device>
      <name>{/downstream/device}</name>
      <config>
        <router xmlns="http://tail-f.com/ned/cisco-nx">
          <bgp>
            <id>{$peer-asn}</id>
            <neighbor>
              <id>{$core-ip}</id>
              <inner-remote-as>
                <remote-as>{$core-asn}</remote-as>
              </inner-remote-as>
              <description>{/upstream/device}</description>
              <inherit>
                <peer>{$remote-peer-group}</peer>
              </inherit>
            </neighbor>
          </bgp>
        </router>
      </config>
    </device>
Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?