Posted on November 26, 2014 1:35 pm
 |  Asked by Anand Balakrishnan
 |  4995 views
RESOLVED
0
0
Print Friendly, PDF & Email

Hi Everyone..,

 

Through eAPI is it possible to save the switch configuration in Arista Switches when it is working in ZTP mode? Once it is saved i dont have any problem if ZTP is desabled. But i shouldn’t loose the configuration which did when it is in ZTP mode.

 

Thanks in Advance.

Anand

Marked as spam
0
Posted by Andrei Dvornic
Answered on November 26, 2014 1:39 pm

Hi Anand,

Sure, you can do that by running ”copy running-config startup-config” or ”write memory” via eAPI. You can do this regardless of whether the switch is running in ZTP mode or not.

Note that the switch will not come up with eAPI enabled by default, hence your ZTP process will have to enable that first (and you might have to wait for a few seconds for eAPI to start).

And by the way, did you see this yet: https://eos.arista.com/intelligent-bootstrap-with-arista-eos-and-ztpserver/ ?

Let me know if you have any further questions or need any more help with your ZTP solution.

Thanks,
Andrei

0
Posted by unknown
Answered on November 27, 2014 5:51 am

Hi Andrei,

 

Thanks for sharing that link :)

I already tried both the commands which you provided but i am getting the error message ”Cannot copy to startup-config when ZeroTouch is enabled”. I have attached the screen shot as well. Please see that and let me know your answer.

In my lab environment, i am using vEOS machines, and by removing the startup-config in the flash, i enabled zero touch in the switch. Then with the help of DHCP and bootscript i got an IP and got eAPI enabled on the device. And through that eAPI i did some configuration through the web browser, and finally when i try to save i am getting this error.

 

Thanks and Regards,

Anand

0
Posted by Anand Balakrishnan
Answered on November 27, 2014 5:55 am

Hi Andrei,

Thanks for sharing that link :)

I already tried both the commands which you provided but i am getting the error message ”Cannot copy to startup-config when ZeroTouch is enabled”. I have attached the screen shot as well. Please see that and let me know your answer.

In my lab environment, i am using vEOS machines, and by removing the startup-config from the flash memory, i enabled zero touch in the switch. Then with the help of DHCP and bootscript i got an IP and got eAPI enabled on the device. And through that eAPI i did some configuration through the web browser, and finally when i try to save i am getting this error.

Thanks and Regards,

Anand

0
Posted by Andrei Dvornic
Answered on November 27, 2014 11:37 am

Hi Anand,

 

Unfortunately, looks like you are hitting BUG52032, which was fixed in 4.11.5 and 4.12.3+. Can you please confirm which EOS version are you running? I would recommend you upgrade to a more recent release.

 

Thanks,
Andrei

0
Posted by unknown
Answered on November 27, 2014 1:10 pm

Hi Andrei,

 

I think i am using 4.12.3+ version. Please find the show version output below.

localhost#sh ver
Arista vEOS
Hardware version:
Serial number:
System MAC address:  000c.2978.8321

Software image version: 4.13.7M
Architecture:           i386
Internal build version: 4.13.7M-1877079.4137M.1
Internal build ID:      54a9c4ce-bbb0-4f6b-9448-9507de824905

Uptime:                 1 day, 0 hours and 11 minutes
Total memory:           1001196 kB
Free memory:            60584 kB

 

Thanks and Regards,

Sangeeth BS

0
Posted by Anand Balakrishnan
Answered on November 28, 2014 5:38 am

Hi Andrei,

 

My vEOS version is a higher version.

Software image version: 4.13.7M (from show version command)

Can you trace out the issue ? Due to this am stuck with my work.

 

Thanks and Regards,

Anand

0
Posted by Andrei Dvornic
Answered on November 28, 2014 12:08 pm

Hi Anand,

I am looking into this, but if you need a quick(er) response I suggest you contact Arista support team at support@arista.com. Otherwise, I will update this thread as soon as I figure it out.

Thanks,
Andrei

0
Posted by Andrei Dvornic
Answered on December 2, 2014 1:48 am

Hi Anand,

 

”write memory” is not allowed during ZTP mode because in this mode the switch is running a special config, which is not what you would probably expect from a factory switch in bridging mode (for example, every port is configured as a routed port and there is a special login message). Hence, you most probably do not to save that configuration to startup-config.

You have a couple of options to work around this:
  • you can write your desired configuration straight to /mnt/flash/startup-config by simply writing to that file from your bootstrap script
  • if you already have the config saved in a file, you can use the copy command: copy URL startup-config in order to copy it to the startup-config (the BUG I references earlier was actually about enabling this behaviour from the bootstrap script)
If you want to configure the switch manually instead, you should get out of ZTP mode first by using zero-touch cancel command (this will lead to a reboot).
I hope this helps – let me know if you have any further questions.
Thanks,
Andrei
0
Posted by Anand Balakrishnan
Answered on December 2, 2014 9:06 am

Hi Andrei,

 

Thanks a lot for giving your valuable time to look into this case. I understood the behavior of ZTP, and i think the answer for my actual question is ”No”. Am i correct?

Let me elaborate a bit the question.

I am booting up my virtual switch in ZTP mode. And with the help of boot script i enabled a user account in it. Through that user account and DHCP IP of the device i am taking the switch remotely. Then i customized the switch configuration as per my need through eAPI. Now all the changes which i done is staying in switch’s running-config. In case the device got rebooted, all the custom changes which i have done will be wiped off. How i can avoid this? So is it possible to trigger a write memory command which will save the running-config into flash, and then the switch will reboot with ZTP disabled state? Can you confirm your answer once again if you are clear on my question?

In Parallel  i am trying to find out the alternate option on this and will be update here if i got any.

 

Thanks and Regards,

Anand

1
Posted by Andrei Dvornic
Answered on December 2, 2014 11:26 am

A few questions: how does your remote server know when it the switch becomes accessible (e.g. the username name has been created and IP connectivity established)? Do you simply retry until it succeeds?

In order to add a bit of config to the switch via ZTP, you have several options:

  • use the ZTPServer (http://ztpserver.readthedocs.org/en/master/)
  • make the boot script a config script (containing all the config you want to add to the switch) -> in that case, that configuration will be saved to startup-config, followed by a reboot
  • make the boot script a config script, but only add the IP configuration to access the remote server, the username and eAPI config. Then the switch would reboot and come up with a config which will enable the remote server to connect to it an update its config. Because this time round you are not in ZTP mode anymore, you will be able to use ”wr mem”
  • make the boot script an executable and from inside it, write the config you care about to /mnt/flash/startup-config. If you want to get that config from somewhere remotely (based on some system information for example) then you can connect to a remote server from the script itself  (the connectivity would be established from the switch side though, not from the remote side vie eAPI). As protocol, you could use HTTP – this is what the ZTPServer is doing for example.
  • etc.

You do have quite a bit of flexibility in what you can do here. I would also encourage you to take a look at: https://eos.arista.com/introducing-arista-eos-roles-for-ansible/, which I suspect you will find useful.

I hope that helps.

 

Thanks,
Andrei

0
Posted by Anand Balakrishnan
Answered on December 3, 2014 11:43 am

Hi Andrei,

 

Thanks for sharing the knowledge. That helps actually. Let me work on this.

My remote server will know about the switch once the bootscript is executed.

 

Thanks and Regards,

Anand

Post your Answer

You must be logged in to post an answer.