02-16-2018 03:25 AM - edited 03-08-2019 01:53 PM
Hi, so i have a number of 3050s with come shipped with an old IOS Version 03.07.04E. This version has a bug with the 40Gb SFPs we have. So, using ZTP i've got a config script hosted on a tftp server which downloads the new Everest firmware but i need to make the switch reboot at the end. Any ideas how i do this?
currently the config file that's pulled down and run during ZTP looks like this:
hostname netdevice ip domain-name MYDOMAIN crypto key generate rsa modulus 2048 aaa new-model aaa authentication login default local aaa authorization console aaa authorization exec default local user-name cisco secret cisco privilege 15 ip ssh version 2 ip ssh time-out 90 ip scp server enable line vty 0 15 do write memory do copy ftp://192.168.0.128/cat3k_caa-universalk9.16.06.02.SPA.bin flash: boot system switch all flash:cat3k_caa-universalk9.16.06.02.SPA.bin do write memory
After this is complete i'd like the switch to reboot. I've tried variations of do reload and do reload\ny but nothing seems to work.
Thanks in advance.
Solved! Go to Solution.
02-16-2018 06:30 AM
tried that too, but i also don't want to wait 10 minutes. This is the version that works:
hostname netdevice ip domain-name DOMAIN crypto key generate rsa modulus 2048 aaa new-model aaa authentication login default local aaa authorization console aaa authorization exec default local user-name cisco secret cisco privilege 15 ip ssh version 2 ip ssh time-out 90 ip scp server enable line vty 0 15 do write memory do copy ftp://192.168.0.128/cat3k_caa-universalk9.16.06.02.SPA.bin flash: boot system switch all flash:cat3k_caa-universalk9.16.06.02.SPA.bin do write memory ! event manager applet reload event none sync yes action 1.0 syslog msg "router about to reload" action 2.0 reload exit ! do event manager run reload
needed the do even manager run reload at the end. i'm 100% new to EEM but it makes sense now. You build your command then run it when ready. pretty cool
02-16-2018 03:29 AM
02-16-2018 03:30 AM
Hi there,
Why don't you use an EEM script, something like:
! event manager applet RELOAD event time countdown time 10 action 1.0 cli command "reload" !
cheers,
Seb.
02-16-2018 03:44 AM
Do i simply add that on to the end of my script?
02-16-2018 03:59 AM
Yes, a similar technique is used with APIC-EM builds on some switches.
cheers,
Seb.
02-16-2018 06:13 AM
So i just tried this...
hostname netdevice ip domain-name SOMEDOMAIN crypto key generate rsa modulus 2048 aaa new-model aaa authentication login default local aaa authorization console aaa authorization exec default local user-name cisco secret cisco privilege 15 ip ssh version 2 ip ssh time-out 90 ip scp server enable line vty 0 15 do write memory do copy ftp://192.168.0.128/cat3k_caa-universalk9.16.06.02.SPA.bin flash: boot system switch all flash:cat3k_caa-universalk9.16.06.02.SPA.bin do write memory ! event manager applet RELOAD action 1.0 cli command "reload" !
But nothing happened. it's like it just ignored the event manager line. What did i do wrong? remember this is on a 3850 IOS-XE Version 03.07.04E. Is the syntax correct?
The is the output on the terminal:
Would you like to enter the initial configuration dialog? [yes/no]: Loading config.sh from 192.168.0.128 (via Vlan1): ! [OK - 559 bytes] The name for the keys will be: netdevice.SOMEDOMAIN % The key modulus size is 2048 bits % Generating 2048 bit RSA keys, keys will be non-exportable... [OK] (elapsed time was 4 seconds) Building configuration... Compressed configuration from 4421 bytes to 1843 bytes[OK] Destination filename [cat3k_caa-universalk9.16.06.02.SPA.bin]? Accessing ftp://192.168.0.128/cat3k_caa-universalk9.16.06.02.SPA.bin... Loading cat3k_caa-universalk9.16.06.02.SPA.bin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 409853870/4096 bytes] 409853870 bytes copied in 313.540 secs (1307182 bytes/sec) Building configuration... Compressed configuration from 4489 bytes to 1904 bytes[OK] Startup-config is ignored. So, HTTP Secure server configuration not done Press RETURN to get started!
02-16-2018 06:18 AM
What happened to the
event time countdown time 10
..line?
! event manager applet RELOAD event time countdown time 10 action 1.0 cli command "reload" !
02-16-2018 06:30 AM
tried that too, but i also don't want to wait 10 minutes. This is the version that works:
hostname netdevice ip domain-name DOMAIN crypto key generate rsa modulus 2048 aaa new-model aaa authentication login default local aaa authorization console aaa authorization exec default local user-name cisco secret cisco privilege 15 ip ssh version 2 ip ssh time-out 90 ip scp server enable line vty 0 15 do write memory do copy ftp://192.168.0.128/cat3k_caa-universalk9.16.06.02.SPA.bin flash: boot system switch all flash:cat3k_caa-universalk9.16.06.02.SPA.bin do write memory ! event manager applet reload event none sync yes action 1.0 syslog msg "router about to reload" action 2.0 reload exit ! do event manager run reload
needed the do even manager run reload at the end. i'm 100% new to EEM but it makes sense now. You build your command then run it when ready. pretty cool
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