cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
998
Views
0
Helpful
3
Replies

CAT9K_IOSXE Guestshell ZTP - works only for python not shell script ?

gnijs
Level 4
Level 4

Hello,

 

Can someone confirm that on a Cat9000 ZTP is only triggered when the DHCP bootfile option returns a .py file ??

So i have made a nice shell script to do ZTP, but the guestshell is not triggered when i point the bootfile to a .sh file ??

 

Loading http://1.1.1.1/ztp/ztp.sh
Loading http://1.1.1.1/ztp/ztp.sh

 

(-> he loads the file, path detected via dhcp boot option)


Press RETURN to get started!


*Jun 26 09:10:31.078: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named TP-self-signed-115474158 has been generated or imported
*Jun 26 09:10:31.079: %SSH-5-ENABLED: SSH 1.99 has been enabled
*Jun 26 09:10:31.120: %PKI-4-NOCONFIGAUTOSAVE: Configuration was modified. Issue "write memory" to save new IOS PKI configuration
*Jun 26 09:10:31.121: %PNP-6-HTTP_CONNECTING: PnP Discovery trying to connect to PnP server http://72.163.8.46/pnp/HELLO
*Jun 26 09:10:31.173: %CRYPTO_ENGINE-5-KEY_ADDITION: A key named TP-self-signed-115474158.server has been generated or imported
*Jun 26 09:10:31.596: %AN-6-AN_ABORTED_BY_CONSOLE_INPUT: Autonomic disabled due to User intervention on console. configure 'autonomic' to enable it.
*Jun 26 09:10:32.499: %LINK-5-CHANGED: Interface Vlan1, changed state to administratively down
*Jun 26 09:10:32.807: %PLATFORM_PM-6-MODULE_INSERTED: SFP module inserted with interface name Te1/1/1
*Jun 26 09:10:37.916: %PLATFORM_PM-6-MODULE_INSERTED: SFP module inserted with interface name Te1/1/8

 

(-> when it is a .py file, it triggers guestshell here, but when it is a .sh file, it doesn't ??)


%Error opening tftp://255.255.255.255/http://1.1.1.1/ztp/ztp.sh (Timed out)

 

 

 

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

ZTP requires Python scripts.  You can have a Python script invoke your .sh after copying it down (or encode it in the script and write it to disk once running in guestshell), but I think it would be better to port your logic from Bash to Python.

**bleep**. I think i am just going to spawn a new bash shell from within python. Problem with python is that from within python it is difficult to install new modules and how about adding environment variables for proxy or DNS access....in bash, you just source some downloaded .sh scripts.

With the dohost command, you could likely do what you need from Bash to bootstrap.  In terms of additional Python libraries, you could still download stuff and then "import" it.

Review Cisco Networking for a $25 gift card