Posted on June 12, 2020 12:23 pm
 |  Asked by Taeil Nam
 |  128 views
RESOLVED
0
0
Print Friendly, PDF & Email

Good day,

I have some questions about ZTP bootstrap script.

I wonder which file is the bootstrap script file in CVP when the switch get bootstrap file from “http://<IP address used CVP>/ztp/bootstrap”.

Additionally, can i download the bootstrap script file from CVP and operate script from the switch manually?

Please let me know which file is the bootstrap file in CVP.

My purpose is automatically add device to CVP using script and not using ZTP mode.

Thank you.

0
Posted by Tamas Plugor
Answered on June 12, 2020 1:49 pm

Hi Taeil,

Can you describe in more details what are you trying to achieve here? Will the device still be in ZTP mode or they are already running in production?

If the latter you do not need the bootstrap script, you can just use the provisioning REST API to onboard the devices. You can find the CloudVision API documentation in the Settings menu or by going to /web/api/

POST /inventory/devices

body example for multiple device addition:

 

{
'data': [ {"host": %host1, "deviceID": %deviceID1},
{"host2": %host2, "deviceID": %deviceID2}
..... ]
}

We have a wrapper for this on our github page, please check out https://github.com/aristanetworks/cvprac

The add_devices_to_inventory is using that same API

If you want to further automate things, I highly recommend you to check out our ansible-avd and ansible-cvp repos:

https://github.com/aristanetworks/ansible-cvp

https://github.com/aristanetworks/ansible-avd

 

To answer your initial questions, the bootstrap file is only available on-demand, when queried by an EOS switch. It's built by multiple files which can be found in the ztp pods on CVP.

[root@cva-1-cvp ~]# kubectl get pod -l app=ztp
NAME READY STATUS RESTARTS AGE
ztp-ftdv4 1/1 Running 0 9d
ztp-qbc56 1/1 Running 0 9d
ztp-rbmth 1/1 Running 0 9d

[root@cva-1-cvp ~]# kubectl exec -it ztp-ftdv4 bash
bash-4.4$ cd /ztp/resources/
bash-4.4$ ls -l
total 28
-rw-rw-r-- 1 root root 1046 Jan 30 03:37 bootstrap_conf.yaml
-rwxrwxr-x 1 root root 24299 Jan 30 03:37 bootstrap_script

Those are the two files based on which the bootstrap file is built, which is requested via DHCP option 67, outside of ztp you won't need that. The bootstrap is a python script that generates only a minimal config, which will be only temporarily be used by the switch, you need to have the final configs in static configlets or generated configlets by configlet builders that you can attach at the container or device level in Network Provisioning, for which you can also use the REST APIs.

You can also reach out to your local SE/AM team who can help you demo these and in case you hit any issues you can send us an email to support@arista.com and one of us would be more than happy to help!

Thanks,
Tamas

0
Posted by Taeil Nam
Answered on June 17, 2020 7:23 pm

Hi Tamas,

Appreciate your response.
I wonder the switch which is not ZTP mode can use the bootstrap for add device to CVP.
According to your response, i think this operation is impossible.
I tried execute the bootstrap_script (python file) on switch(not ZTP mode), but script cloud't operated.
Anyway, owe to your explain, i got to know more about ZTP Process using CVP.

Thank you,
Taeil Nam.

Hi Taeil, The bootstrap_script will not do anything without the template file, the 'bootstrap' file is the one that the switch downloads during ztp mode, which is compiled from bootstrap_conf.yaml and bootstrap_script when an EOS device sends a special request. The script itself does not add the device to CVP, it just configures EOS with a basic configuration (temporary username, eapi, streaming agent, default route, logging,etc). Once the streaming agent is running, CVP receives updates from the device, it sees it is in ztp mode and adds it to the database and to the undefined container in network provisioning. You do not need that bootstrap file for brownfield devices, you already have a running-config which I'm sure you do not want to reset to something basic. You simply need to onboard the devices by adding the IP address of the switches on the UI or use the REST API as mentioned before. You can add multiple IPs on the UI as well, and when you onboard an EOS device using the UI, the streaming agent is automatically configured as well. Might be easier to discuss your requirements and the difference between onboarding greenfield devices in ztp mode vs brownfield devices over a call/zoom Thanks, Tamas
(Tamas Plugor at June 18, 2020 12:52 am)
Hi Tamas, I perfectly understood about ZTP bootstrap script process owe to your explanation. Thank you, Taeil Nam.
(Taeil Nam at June 23, 2020 4:23 am)

Post your Answer

You must be logged in to post an answer.