cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
850
Views
0
Helpful
7
Replies

Questions on how NSO pnp Day0 works

previousqna
Level 5
Level 5

Hi team,

 

 

I’m using the NSO pnp package and I’m looking for information on how to use the day0 file which is specified in the pnp map.

 

 

My CPE only seems to come up with the default CPE.txt file (see attached) which is in the cisco=pnp/cfg directory. If I change the name, no good.

 

Also, how are these $variables used and where are they specified?

 

 

If I add a simple ios command to the CPE.txt file (in packages/cisco-pnp/cfg) (I.e. hostname foo), it doesn’t work.

 

 

Any help appreciated. Need to get this working for customer PoC.

 

 

John

 

 

packages package cisco-pnp

 

package-version 1.2

 

description     "NED package for supporting Cisco PNP"

 

ncs-min-version [ 4.2 ]

 

directory       ./state/packages-in-use/1/cisco-pnp

 

component CiscoPnpSubscriber

 

  application java-class-name com.cisco.pnp.CiscoPnpSubscriber

 

  application start-phase phase2

 

component pnp-rfs

 

  callback java-class-name [ com.cisco.pnp.PnpRFS ]

 

oper-status up

7 Replies 7

previousqna
Level 5
Level 5

Hi folks,

 

 

I figured it out. I was editing the file in the packages directory but was not doing a packages reload. So the cfg files being actively used were in the

 

/state/packages-in-use/1/cisco-pnp/cfg directory.

 

 

But still, if anyone has info on how the day0 variables work that would be helpful in the future.

Following is an example which I tested with PnP package 1.2.

 

 

=== CPE.txt

 

hostname $HOSTNAME

 

 

== NSO configuration

 

pnp map xxxxx

 

cfg-properties variable HOSTNAME

 

  value router1

You may change the name of the day0 file (CPE.txt) by using the cli command pnp map serialnumber day0-file <strng [CPE.txt] >

 

 

In adding a PnP device I am using the following config to map a serial number to a PnP device:

 

 

  1. Pnp map serial number to hostname
    1. pnp map serialnumber
    2. host hostname
    3. device-name hostname
    4. domain cisco.com
    5. username cisco (need to have authgroup/username mapping in order to log on to remote PnP device
    6. device-type cli
    7. ned-id cisco-ios
    8. day0-file myday0file.txt  (here is where you can change the name of the CPE.txt file.

  

 

If anyone has a better or alternative approach, please let me know.

I got the variable piece all working.

 

 

Two more questions for the team:

 

 

(1) There is command called “pnp reset” which is suppose to restore the device to day—1 configurations. See:

 

 

admin@ncs# pnp reset ?

 

Possible completions:

 

  clean  - Restore device to day--1 config.

 

  serial -

 

 

Does anyone know how this works? (as it’s not working for me). I have a day—1-config in CPE flash. Also, what is the difference between the “clean” option and just inputing the S/N.

 

 

(2) How does the pnp package differentiate between different CPE platforms (which may have different interface numbering, which could be a variable in the day0). I know vMS

 

handles this, but I’m not sure if they wrote their own service or if this is a feature in the pnp package.

For interface map let´s try the following:

 

 

admin@ncs# show running-config pnp interface-map

 

pnp interface-map C19[0-9][0-9]

 

wan GigabitEthernet0/1

 

lan GigabitEthernet0/0

 

!

 

pnp interface-map C29[0-9][0-9]

 

wan GigabitEthernet0/1

 

lan GigabitEthernet0/0

 

!

 

pnp interface-map C39[0-9][0-9]

 

wan GigabitEthernet0/1

 

lan GigabitEthernet0/0

 

!

 

pnp interface-map C819

 

wan GigabitEthernet0

 

lan FastEthernet0

 

!

 

pnp interface-map C891

 

wan GigabitEthernet0

 

lan FastEthernet0

 

!

 

pnp interface-map C892

 

wan GigabitEthernet8

 

lan GigabitEthernet0

 

!

 

pnp interface-map ISR4351

 

wan GigabitEthernet0/0/1

 

lan GigabitEthernet0/0/0

 

!

 

 

I am trying to figure out how the CSR is presented but I think with a show pnp profile on the CPE we can know it and change accordingly.

 

 

There is also a parameter in the pnp interface map named config-restore-file flash:day--1-config

 

 

We can try that and or maybe let´s try first adding the interface map, that may be the reason why it is not going back to day--1-config

 

 

Hope it heps.

BTW the CSR1000V is like this:

 

 

!

 

pnp interface-map CSR1000V

 

wan GigabitEthernet1

 

lan GigabitEthernet2

 

!

Pnp reset waits for the next time the device connects via PnP, then asks it to “copy flash:day—1-config startup-config” and then reload. There were some versions that we also had inserted a wait in between to make sure that IOS had time to complete saving the config before reloading. Otherwise, we had problem with the config missing some of later parts of the config. It would occasionally take longer than 5 seconds to complete saving the startup-config.

 

 

If its not working, enable PNP traces raw and at least look at what is being sent down to the device.