Cisco PowerOn Auto Provisioning¶
In order to automate your Cisco Nexus switches deployment, you can use POAP (PowerOn Auto Provisioning).
Initial configuration¶
The following steps need to be done only once.
The script poap.py
is included in the bmgr package. On admin1 (or any server where bmgr is installed), copy it to the right location, and generate poap.py.md5
:
$ mkdir /volspoms1/pub/poap/
$ cp /usr/share/bmgr/poap.py /volspoms1/pub/poap/
$ cd /volspoms1/pub/poap/
$ f=poap.py ; cat $f | sed '/^#md5sum/d' > $f.md5 ; sed -i "s/^#md5sum=.*/#md5sum=\"$(md5sum $f.md5 | sed 's/ .*//')\"/" $f
Check the content of the template /etc/bmgr/templates/poap_config.jinja
:
{"username": "root", "password": "password", "hostname": "{{ config_server }}", "transfer_protocol": "http", "mode": "{{ poap_mode }}","target_system_image": "{{ os_name }}.{{ os_version }}.bin", "config_path": "{{poap_config_path}}", "target_image_path": "{{poap_config_path}}", "update_image": {{update_image}}}
Copy the nxos file (downloadable on Cisco website) into the poap directory, and create its md5 file:
$ cp nxos.9.2.4.bin /volspoms1/pub/poap/
$ md5sum /volspoms1/pub/poap/nxos.9.2.4.bin > /volspoms1/pub/poap/nxos.9.2.4.bin.md5
Configure bmgr:
$ bmgr resource add poap_config file://poap_config.jinja
$ bmgr profile add ocean_switch_esw --attr os_name nxos --attr poap_config_path /pub/poap/ --attr config_server 10.0.1.250 --attr os_version 9.2.4 --attr update_image true --attr poap_mode hostname
Configuration of new switches¶
The following steps need to be done for every switch you add (the current example is for esw1).
Configure bmgr:
$ bmgr host add --profiles ocean_switch,ocean_switch_esw esw[1-2]
Generate switches configuration:
$ confiture switches
Copy the switch configuration generated by confiture and create its md5 file:
$ cp confiture/output/esw1_confg /volspoms2/tftp_data/switch_conf/
$ cp confiture/output/esw1_confg /volspoms1/pub/poap/conf_esw1.cfg
$ md5sum /volspoms1/pub/poap/conf_esw1.cfg > /volspoms1/pub/poap/conf_esw1.cfg.md5
Now you can reset the configuration of your switch, and reboot it, in order to reconfigure it automatically with POAP:
esw1# write erase
esw1# reload