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

Cisco NX-OS 'switchport' default command - probably again

rslaski
Spotlight
Spotlight

Guys,

I've searched this forum for config differences between Cisco NX-OS device and what NED thinks about it, especially regarding default commands, and most of the replies were around "you have to live with it". But any chances to get the problem below solved?

 

Before applying port configuration in a service, to ensure the port in in a switchport mode (not in a routed mode), I apply the following configuration:

result-xml {
    local-node {
        data <devices xmlns="http://tail-f.com/ns/ncs">
                <device>
                  <name>NX_LEAF111</name>
                  <config>
                    <interface xmlns="http://tail-f.com/ned/cisco-nx">
                      <Ethernet>
                        <name>1/39</name>
                        <enable>
                          <switchport>true</switchport>
                        </enable>

So the whole thing equivalent to '(config-if)# switchport' is inside the following tags:

<enable>
  <switchport>true</switchport>
</enable>

And as such, that part has also been put into a resulting service config, so it is there after the commit:

rslaski@ncs# show running-config devices device NX_LEAF111 config nx:interface Ethernet 1/39 | display xml
<config xmlns="http://tail-f.com/ns/config/1.0">
  <devices xmlns="http://tail-f.com/ns/ncs">
  <device>
    <name>NX_LEAF111</name>
      <config>
      <interface xmlns="http://tail-f.com/ned/cisco-nx">
      <Ethernet refcounter="2"  backpointer="[ /TMPL:TMPL/TMPL:AC[TMPL:name='rsl1'] ]" >
        <name>1/39</name>
        <enable>
          <switchport refcounter="1" >true</switchport>
        </enable>
        <switchport>
          <mode refcounter="1" >access</mode>
          <access>
            <vlan refcounter="1" >71</vlan>
          </access>
        </switchport>
      </Ethernet>
      </interface>
      </config>
  </device>
  </devices>
</config>

The problem is that 'switchport' is a default setting on the platform, so after applying sync-from, it now missing from the config:

rslaski@ncs# show running-config devices device NX_LEAF111 config nx:interface Ethernet 1/39 | display xml 
<config xmlns="http://tail-f.com/ns/config/1.0">
  <devices xmlns="http://tail-f.com/ns/ncs">
  <device>
    <name>NX_LEAF111</name>
      <config>
      <interface xmlns="http://tail-f.com/ned/cisco-nx">
      <Ethernet refcounter="2"  backpointer="[ /TMPL:TMPL/TMPL:AC[TMPL:name='rsl1'] ]" >
        <name>1/39</name>
        <switchport>
          <access>
            <vlan refcounter="1" >71</vlan>
          </access>
        </switchport>
      </Ethernet>
      </interface>
      </config>
  </device>
  </devices>
</config>

And now also the service complains about missing part on the device:

rslaski@ncs# TMPL AC rsl1 check-sync              
in-sync false

rslaski@ncs# TMPL AC rsl1 check-sync outformat xml
result-xml {
    local-node {
        data <devices xmlns="http://tail-f.com/ns/ncs">
                <device>
                  <name>NX_LEAF111</name>
                  <config>
                    <interface xmlns="http://tail-f.com/ned/cisco-nx">
                      <Ethernet>
                        <name>1/39</name>
                        <enable>
                          <switchport>true</switchport>
                        </enable>
                      </Ethernet>
                      <Ethernet>
                        <name>1/71</name>
                        <enable>
                          <switchport>true</switchport>
                        </enable>
                      </Ethernet>
                      <Ethernet>
                        <name>1/73</name>
                        <enable>
                          <switchport>true</switchport>
                        </enable>
                      </Ethernet>
                    </interface>
                  </config>
                </device>
              </devices>
              
    }
}

The impact is that my notrhbound system will constantly complain about service non-compliance, and will keep on re-deploying the service periodically.

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee

I am a little bit on thin ice here, but I would look into the ned settings. I think doing something like

 

devices device nx0 ned-settings cisco-nx-meta:cisco-nx system-interface-defaults handling auto

might be a good start, but we have a number of options available here.

View solution in original post

2 Replies 2

vleijon
Cisco Employee
Cisco Employee

I am a little bit on thin ice here, but I would look into the ned settings. I think doing something like

 

devices device nx0 ned-settings cisco-nx-meta:cisco-nx system-interface-defaults handling auto

might be a good start, but we have a number of options available here.

Can you try a

devices device NX_LEAF111 compare-config

 

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?