Every product has its liftime – means official vendor support. Usually, from the begining to the complete end is about 10 years.
Wireless is a little more sepecific in terms of products lifetime. Infrastructure which is constantly growing, form example retail stores, will face issue when curruent/old access points cannot operate at once on the same wireless controller with new access points. That’s why I had to migrate supported access point from WLC 7500 to new WLC Cisco baby Catalyst 9800.
There is no straightforward process to migrate from old WLC to Catalyst 9800, there are two possible options:
– using Primie Infrastracture – just point AP to new controller
– reconfigure manually AP to connect to 9800
Prime wasn’t used by Customer, so ofcourse option no. 2 was chosen. I had to migrate about 5000 access point, so doing it manually – no way!
Some scripting work sometimes need to be done to make your life easier. I thought it will be just simple script, but like always at my job, it didn’t.
I had to migrate AP 1702i and 1832i, unfortunately both series has different naming convention on controllers, how I designed my migration script:
- During testing I found out taht 1702 has to be resseted to factory default to connect to 9800. I decided to split AP 1702i and 1832i into two seperate file, below only for 1702i, for 1832i exactly same thing, only different string to search:
def search_string_in_file1(file_name, string_to_search1):
"""Search for the given string in file and return lines containing that string,
along with line numbers"""
line_number = 0
list_of_results = []
# Open the file in read only mode
with open(file_name, 'r') as read_obj:
# Read all lines in the file one by one
for line in read_obj:
# For each line, check if line contains the string
line_number += 1
if string_to_search1 in line:
# If yes, then add the line number & line as a tuple in the list
list_of_results.append((line.rstrip()))
# Return list of tuples containing line numbers and lines where string is found
return list_of_results
matched_lines1 = search_string_in_file1(file_name, string_to_search1)
print('Total Matched AP 1700 : ', len(matched_lines1))
for elem in matched_lines1:
print(elem[:8], file=open("/home/pzwierzynski/Documents/WLC/ap_name_1700.txt", "a"))
2. After above I got 1702 and 1832 lists in separate file, I could migrate AP’s
with open('/home/pzwierzynski/Documents/WLC/ap_name_1700.txt') as a:
ap_list_1700 = a.read().splitlines()
for ap in ap_list_1700:
# Send command to reboot access point
#net_connect.send_command_timing('show ap summary %s ' % ap)
commands = ['clear ap config %s ' % ap, 'y' ] # commands to run
#config ap reset
for cmd in commands:
logger.info("Sending cmd: %s", cmd)
this_cmd = net_connect.send_command_timing(cmd)
config_filename_f = open(config_filename, 'a')
config_filename_f.write(this_cmd)
config_filename_f.write('\n')
config_filename_f.close()
with open('/home/pzwierzynski/Documents/WLC/ap_name_1830.txt') as a:
ap_list_1830 = a.read().splitlines()
for ap in ap_list_1830:
# Send command to reboot access point
#net_connect.send_command_timing('show ap summary %s ' % ap)
commands = ['config ap primary-base PEP-WLC %s ' % ap + wlc9800, 'config ap reset %s ' % ap, 'y'] # commands to run
#config ap reset
for cmd in commands:
logger.info("Sending cmd: %s", cmd)
this_cmd = net_connect.send_command_timing(cmd)
config_filename_f = open(config_filename, 'a')
config_filename_f.write(this_cmd)
config_filename_f.write('\n')
config_filename_f.close()
print("Finished:")
for fname in files:
print(" %s " % fname)
After migrated about 3000 AP’s disaster happened, I found out bug on Cat 9800 – no support for devices with static IP, and… Customer decided to rollback. I had to create a little bit different scripts. First to rollback to 7500 and to configure AP’s on 7500 – problem was that configuration is based on AP eth interace mac address, not AP name, so recuired different scripts to extract lists of MACs.
I’m not a scripting guy, I just know something how to automate my tasks and make life a little bit easier. Above wasn’t pretty, but it worked and I achieved my goal.