This example script has been designed for a client who wants to upgrade from their current Catalyst 3k series switches to the new Catalyst 9k series switches. It works by utilizing the configurations from the existing 3k series switches.
The script performs value extraction on the existing configuration and populates a configuration template accordingly. It also transfers the existing interface configuration and makes any necessary adjustments to adapt to the upgraded Catalyst 9k series switches.
Create an onboarding template for the switches to be deployed, ensure Jinja is being used. Please see "template_example" within the repository files, also this (resource) may help.
Add onboarding template to a network profile (Instructions)
Add the template to the associated onboarding project, the default should be named "onboarding project", do this via UI (Instructions)
Populate the provided mapping file with the target switches
Make sure Python 3 and Git is installed in your environment, and if not, you may download Python here and Git here.
(Optional) Create and activate a virtual environment - once Python 3 is installed in your environment, you can activate the virtual environment with the instructions found here.
#MacOS and Linux:
python3 -m venv [add name of virtual environment here]
source [add name of virtual environment here]/bin/activate
#Windows:
python -m venv [add name of virtual environment here]
[add name of virtual environment here]/Scripts/activate
cd [add name of virtual environment here]
git clone [add github link here]
Access the downloaded folder:
cd gve_devnet_catalyst_upgrade_config
Install all dependencies:
pip install -r requirements.txt
Open the .env
file and fill out the following environment variables:
DNAC_HOST= <ENTER YOUR DNAC HOST IP>
USERNAME= <ENTER DNAC USERNAME>
PASSWORD= <ENTER DNAC PASSWORD>
DNAC_PROJECT_NAME= <ENTER NAME OF PROJECT>
DAY0_TEMPLATE= <ENTER NAME OF TARGET ONBOARDING TEMPLATE>
python3 dnac_app.py
Limitations of this script:
Provided under Cisco Sample Code License, for details see LICENSE
Our code of conduct is available here
See our contributing guidelines here
Please note: This script is meant for demo purposes only. All tools/ scripts in this repo are released for use "AS IS" without any warranties of any kind, including, but not limited to their installation, use, or performance. Any use of these scripts and tools is at your own risk. There is no guarantee that they have been through thorough testing in a comparable environment and we are not responsible for any damage or data loss incurred with their use.
You are responsible for reviewing and testing any scripts you run thoroughly before use in any non-testing environment.
Owner
Contributors
Categories
NetworkingProducts
Catalyst CenterCatalyst SwitchesProgramming Languages
PythonLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community