Header Only - DO NOT REMOVE - Extreme Networks

Automated installation of XOS and modules


Hi,

I wish to perform software upgrades and module installations in an automated to be able to do mass upgrades and individual upgrades of both primary and secondary images while keeping SSH module installed through all reboots.

How would one go about doing this on XOS? It could be CLI scripted with expect but that's error prone and I require reliablity. May XML APIs be relied on for this? Any chance of using Ansible? Anyone got ideas or documentation?

I will need to apply configuration as well, but I couldn't find any information discussion upgrades.

8 replies

Userlevel 6
Hello Jasper

Great question. You should be able to do this with a script where the script goes and downloads each code by executing the commands. You can upload the software in the other image that you are not using and load the main version of code, and the SSH version of code into that image before rebooting so you don't have to do it twice.

As for the configuration that can also be added to the script and the switch can be told to use that image container prior to the reboot.

I don't have a switch to test this on right at the moment but will try and see if I can get one to test and create the script for you to test.

Thanks
P
Hi,

Thanks for the response. I am aware of this, the question is rather if this can be done in a more robust and developer friendly way than scripting the CLI. For example, Junos has great NetConf support which makes this sort of work easy. I assumed Extremes equivalent is an XML API but it's not so simple to find wheter that it the right tool to use. Maybe it is CLI scripting (SSH+expect) after all that should be used with XOS switches? Can I at least get structured XML output from the common CLI commands?
Userlevel 7
Jesper wrote:

Hi,

Thanks for the response. I am aware of this, the question is rather if this can be done in a more robust and developer friendly way than scripting the CLI. For example, Junos has great NetConf support which makes this sort of work easy. I assumed Extremes equivalent is an XML API but it's not so simple to find wheter that it the right tool to use. Maybe it is CLI scripting (SSH+expect) after all that should be used with XOS switches? Can I at least get structured XML output from the common CLI commands?

Will JSON work for you instead? Here's
code:
show switch
, for example.
# run script cli2json.py "show switch"
[{"CLIoutput": "\nSysName: beer_for_breakfast\nSysLocation: RDU Services Lab Row L\nSysContact: Drew C.\nSystem MAC: 00:04:96:8B:C2:C7\nSystem Type: X460-48t\n\nSysHealth check: Enabled (Normal)\nRecovery Mode: All\nSystem Watchdog: Enabled\n\nCurrent Time: Thu Nov 12 10:35:17 2015\nTimezone: [Auto DST Enabled] GMT Offset: -300 minutes, name is EST.\n DST of 60 minutes is currently not in effect, name is not set.\n DST begins every second Sunday March at 2:00\n DST ends every first Sunday November at 2:00\n\nBoot Time: Mon Oct 19 09:58:59 2015\nBoot Count: 15\nNext Reboot: None scheduled\nSystem UpTime: 24 days 1 hour 36 minutes 17 seconds \n\nCurrent State: OPERATIONAL \nImage Selected: primary \nImage Booted: primary \nPrimary ver: 15.7.2.9 \nSecondary ver: 15.4.2.8 \n\nConfig Selected: primary.cfg \nConfig Booted: primary.cfg \n\nprimary.cfg Created by ExtremeXOS version 15.7.2.9\n 424772 bytes saved on Mon Oct 19 14:04:32 2015\n"}, {"message": "\nSysName: beer_for_breakfast\nSysLocation: RDU Services Lab Row L\nSysContact: Drew C.\nSystem MAC: 00:04:96:8B:C2:C7\nSystem Type: X460-48t\n\nSysHealth check: Enabled (Normal)\nRecovery Mode: All\nSystem Watchdog: Enabled\n\nCurrent Time: Thu Nov 12 10:35:17 2015\nTimezone: [Auto DST Enabled] GMT Offset: -300 minutes, name is EST.\n DST of 60 minutes is currently not in effect, name is not set.\n DST begins every second Sunday March at 2:00\n DST ends every first Sunday November at 2:00\n\nBoot Time: Mon Oct 19 09:58:59 2015\nBoot Count: 15\nNext Reboot: None scheduled\nSystem UpTime: 24 days 1 hour 36 minutes 17 seconds \n\nCurrent State: OPERATIONAL \nImage Selected: primary \nImage Booted: primary \nPrimary ver: 15.7.2.9 \nSecondary ver: 15.4.2.8 \n", "status": "SUCCESS"}, {"status": "SUCCESS", "useConfig": {"msmAName": "primary.cfg", "msmBName": null, "name": "primary", "switchPortInitMode": 0}}, {"bootConfig": {"msmAName": "primary.cfg", "msmBName": null}, "status": "SUCCESS"}, {"configFile": {"date": "Mon Oct 19 14:04:32 2015", "name": "primary", "platform": "X460-48t", "size": 424772, "version": "15.7.2.9"}, "status": "SUCCESS"}][/code]This cli2json script is built into EXOS 15.7+. It may be present on 15.6 too.
Jesper wrote:

Hi,

Thanks for the response. I am aware of this, the question is rather if this can be done in a more robust and developer friendly way than scripting the CLI. For example, Junos has great NetConf support which makes this sort of work easy. I assumed Extremes equivalent is an XML API but it's not so simple to find wheter that it the right tool to use. Maybe it is CLI scripting (SSH+expect) after all that should be used with XOS switches? Can I at least get structured XML output from the common CLI commands?

As the CLI output is still unstructured its not a giant leap in terms of usefulness to me, but that could be useful at some point, especially the "status" field if reliable.

Could the "enable xml-mode" command help here? I'm not finding any documentation for it, but my hope is that could be used to issue CLI commands and get structured output back, maybe even handle the Y/N prompts for me.
Userlevel 7
Jesper wrote:

Hi,

Thanks for the response. I am aware of this, the question is rather if this can be done in a more robust and developer friendly way than scripting the CLI. For example, Junos has great NetConf support which makes this sort of work easy. I assumed Extremes equivalent is an XML API but it's not so simple to find wheter that it the right tool to use. Maybe it is CLI scripting (SSH+expect) after all that should be used with XOS switches? Can I at least get structured XML output from the common CLI commands?

I'm not familiar with the "xml-mode" command, but I can say there are some really great improvements coming to the EXOS API in the near future. I can't elaborate much on them right now though.
Jesper wrote:

Hi,

Thanks for the response. I am aware of this, the question is rather if this can be done in a more robust and developer friendly way than scripting the CLI. For example, Junos has great NetConf support which makes this sort of work easy. I assumed Extremes equivalent is an XML API but it's not so simple to find wheter that it the right tool to use. Maybe it is CLI scripting (SSH+expect) after all that should be used with XOS switches? Can I at least get structured XML output from the common CLI commands?

Glad to hear it, I'm looking forward to hearing more about it.
Jesper wrote:

Hi,

Thanks for the response. I am aware of this, the question is rather if this can be done in a more robust and developer friendly way than scripting the CLI. For example, Junos has great NetConf support which makes this sort of work easy. I assumed Extremes equivalent is an XML API but it's not so simple to find wheter that it the right tool to use. Maybe it is CLI scripting (SSH+expect) after all that should be used with XOS switches? Can I at least get structured XML output from the common CLI commands?

Jesper:
I had to upgrade more than 3,000 switches, including adding the SSH xmod module. I did it with Tcl/Expect. Not fun. EXOS CLI is not the best for this kind of thing. Various issues. Lack of SCP or FTP transport for images, inability to bundle main image and modules into one file for a single file transfer, general temperamental behavior of CLI, stack inconsistencies, the fact that it takes 10 minutes to generate the SSH key.

Plenty of room for improvement. The Netsight platform does not offer a solution either.

Best of luck.
Ed McGuigan.
Userlevel 7
Take a look at the "Download URL" and its list feature added to 16.1? The list option makes it a lot easier to download the xos and ssh xmod together, and install them both at the same time.
The documentation has info and examples: http://documentation.extremenetworks.com/exos/EXOS_All/Software_Upgrade_and_Boot_Options/c_download-...

Regarding SCP, here's How to upgrade EXOS using SCP.

Reply