aradford123 / PnPTools

Other
5 stars 4 forks source link

pnp_server #1

Open GGabriele opened 7 years ago

GGabriele commented 7 years ago

Hi @aradford123 ,

probably this isn't the right place for this, but I'm sure you're the best to ask and that's the only way I have :)

I'm trying to use the pnp_server from the DevNet Downloads section to perform a configuration upgrade on a Cisco csr1kv device (no APIC-EM involved). My policy file looks like this:

[PID:CSR1000V,VID:V00,SN:9KXI0D7TVFI]
001:config-upgrade {
        $src_location = "http://10.0.0.5:9455/backup_1.cfg"
        $src_uri = ""
        $apply_to = "running"
        $abortOnSyntaxFault = "No"
        $reload_reason = ""
        $reload_delayIn = ""
        $reload_user = ""
        $reload_saveConfig = ""
        $detail_type = "all"
        $noReload = "Yes"
    }

I've configured the pnp profile on the device and it successfully connect to the server.

The problem is that I'm seeing inconsistent behaviour, meaning that sometime it apply the configuration while other times it makes the device to crash and reboot (using the exact same policy and configuration files).

Am I doing anything wrong here? Is it a known bug? Do you have any suggestion to mitigate this issue?

FYI: @jedelman8

aradford123 commented 7 years ago

hmm. I have not done much lately with the open pnp server. Just a dumb q, what version of IOS are you running on CSR?

GGabriele commented 7 years ago

This one

r1#show version
Cisco IOS XE Software, Version 16.03.01
Cisco IOS Software [Denali], CSR1000V Software (X86_64_LINUX_IOSD-UNIVERSALK9-M)                                                                                        , Version 16.3.1, RELEASE SOFTWARE (fc3)
aradford123 commented 7 years ago

thanks . What discovery mechanism are you using? DHCP/DNS/Bootstrap?

GGabriele commented 7 years ago

I just configured the pnp profile on the device and it already had an IP address, so I guess it's the default...I just wanted to make sure the device runs the expected configuration stored on the server.

aradford123 commented 7 years ago

yeap, easiest way to test. "debug pnp all" is also another good command to run on CSR to help troubleshoot.

GGabriele commented 7 years ago

Yeah I was monitoring the process with that command and everything was looking cool on the client/server connection side.

How does the server load the config to the device? Does it just run copy http://10.0.0.5:9455/backup_1.cfg run ?

aradford123 commented 7 years ago

ok. I got around to testing this. I did a couple of things differently to you. 1) I put the http server off box. The app looks like it is single threaded, so i thought it was safer. 2) ran 16.4 code 3) used dhcp to provsion the pnp profile to make testing easier... i just needed to "wr er" and i was good to reload.

It worked perfectly 4 times in a row. The only time i had an issue was when i browsed to the URL of the pnpserver (to look at the file system). it seemed to hang then (until i interupted the process), then it resumed. It did not crash the box, but the pnp-server was blocked.

Did you want to try putting the config into a different HTTP server? Adam

aradford123 commented 7 years ago

oh, to answer the question, yes, the way you have specified it, it will copy straight to running.

I think another way to do this would be to do a file-xfer, then config-copy. That should also work