Converting standalone x670-G2-48x-4q to a stack. Best way to edit port number configuration?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
We have 2 stand-alone, MLAG'ed x670-G2-48x-4q switches. I have purchased 2 more of the same model. We want to convert the stand alone switches to stacks, add a switch to each one, and mlag these stacks.

I realize that when we convert the stand-alone switch to a stack, the switch configuration needs to be manually edited to change the port numbering scheme from Port to Slot:Port.

The configuration file is 1800 lines long, with references to ports and port ranges throughout, so a simple search and replace won't work. Is there any tool, or automated way this can be done? Does anyone have any tips on how we can best accomplish this, and avoid missing port renames in the config?

Thanks,
Ken
Photo of Ken Applebaum

Ken Applebaum

  • 224 Points 100 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of OscarK

OscarK, ESE

  • 7,792 Points 5k badge 2x thumb
Photo of Drew C.

Drew C., Community Manager

  • 38,546 Points 20k badge 2x thumb
Hi Ken,
Take a look at this Python script on The Hub.  You can even run it on the switch if you're running 16.1.
https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/non_stacking_config_conv...

-Drew
Photo of Ken Applebaum

Ken Applebaum

  • 224 Points 100 badge 2x thumb
Thank you both. I will check it out!
Photo of Ken Applebaum

Ken Applebaum

  • 224 Points 100 badge 2x thumb
Hi Stephen,
I installed Python 2.7 on my workstation, then ran the script against a .cfg file I uploaded from the switch. Some ports were renamed, and others were not. Below are some examples where the ports did not rename, or there is a space between the colon and port number:

Original line isconfigure stpd s0 add vlan v11-FLL ports 57 dot1d
After running script: configure stpd s0 add vlan v11-FLL ports 57 1:dot1d

Original line is: configure vlan v53-OC3 add ports 3, 5-6, 49, 57 tagged
After running scriptconfigure vlan v53-OC3 add ports 1:3,1: 5-6, 49, 57 tagged 

Other lines renamed the ports OK:
configure vlan default delete ports all
configure vr VR-Default delete ports 1:1-64
configure vr VR-Default add ports 1:1-64
configure vlan default delete ports 1:1-64
configure ports 1:6 auto off speed 10000 duplex full
disable port 1:7

configure ports 1:7 auto off speed 10000 duplex full
disable port 1:8

I am not sure if I did something wrong or not. Any advice would be greatly appreciated.
Photo of Ken Applebaum

Ken Applebaum

  • 224 Points 100 badge 2x thumb
Stephen,
I realized that I ran the script on the primary.cfg that was in use before I upgraded to firmware version 16.1.3.6. So I booted the switch to the upgraded image, and then copied the primary.cfg to my PC, and ran the script again. Much better results.

However, any line starting with configure stpd s0 add vlan did not label the ports correctly, as in the example below:
configure stpd s0 add vlan v111-PH-1 ports 57 1:dot1d
configure stpd s0 add vlan v112-PH-2 ports 57 1:dot1d

configure stpd s0 add vlan v113-PH-3 ports 57 1:dot1d
configure stpd s0 add vlan v120-CASA ports 57 1:dot1d

Much less to manually change, but still over 300 lines in this section of the config.
Photo of Stephen Williams

Stephen Williams, Employee

  • 8,950 Points 5k badge 2x thumb
Ken,  There are so many commands it's hard to catch them all.  Thanks for letting me know!   I just updated the script to account for this configuration.

Thanks again,

Stephen
Photo of Ken Applebaum

Ken Applebaum

  • 224 Points 100 badge 2x thumb
WOW! Thanks Stephen. I will download the script, and give it another shot. 
Photo of Stephen Williams

Stephen Williams, Employee

  • 8,950 Points 5k badge 2x thumb
Great.  Let me know how it works.  Making these config changes can be very time consuming, so we need this script to work.
Photo of Erik Auerswald

Erik Auerswald, Embassador

  • 12,886 Points 10k badge 2x thumb
(Edited)