catalyst-sdwan-lab


Namecatalyst-sdwan-lab JSON
Version 2.0.14 PyPI version JSON
download
home_pagehttps://github.com/cisco-open/sdwan-lab-deployment-tool
SummaryCatalyst SD-WAN Lab Deployment Tool - Automation Tool for managing Cisco Catalyst SD-WAN labs inside Cisco Modeling Labs
upload_time2024-08-02 14:26:47
maintainerNone
docs_urlNone
authorTomasz Zarski
requires_python<4.0,>=3.9
licenseBSD-3-Clause
keywords cisco catalyst sdwan lab
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Tests](https://github.com/cisco-open/sdwan-lab-deployment-tool/actions/workflows/test.yml/badge.svg)](https://github.com/netascode/iac-validate/actions/workflows/test.yml)
![Python Support](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-informational "Python Support: 3.9, 3.10, 3.11, 3.12")

# Catalyst SD-WAN Lab Deployment Tool for Cisco Modeling Labs

This tool automates [Cisco Catalyst SD-WAN](https://www.cisco.com/site/us/en/solutions/networking/sdwan/index.html) lab deployment inside [Cisco Modeling Labs (CML)](https://www.cisco.com/c/en/us/products/cloud-systems-management/modeling-labs/index.html).

The tool will help you automate your CML lab deployments with SD-WAN Manager, Controllers and Validators and up to 20 SD-WAN edges. You can build as pods as your CML platform can host. Please refer to the [Limitations and scale](#limitations-and-scale) for details.



## Getting Started

### Prerequisites
Catalyst SD-WAN Lab Deployment Tool requires Linux or macOS system. 
To run is on Windows, please use [Linux on Windows with WSL](/README.md#appendix---wsl-installation) or set up Linux VM/container.

Catalyst SD-WAN Lab Deployment Tool requires Python 3.9 or newer. This can be verified by pasting the following to a terminal window:

    % python3 -c "import sys;assert sys.version_info>(3,9)" && echo "ALL GOOD"

If 'ALL GOOD' is printed it means Python requirements are met. If not, download and install the latest 3.x version at Python.org (https://www.python.org/downloads/).

All the Python prerequisites are automaticaly installed when you install the package. Please refer to the [Installing](#installing) section for details.

This tool requires CML 2.6 or higher.

### Installing
The recommended way to install is via pip.

Create a directory to store the virtual environment and runtime files:

      mkdir csdwan
      cd csdwan
    
Create virtual environment:

      python3 -m venv venv
    
Activate virtual environment:

     source venv/bin/activate
    
- Note that the prompt is updated with the virtual environment name (venv), indicating that the virtual environment is active.
    
Upgrade initial virtual environment packages:

    pip install --upgrade pip setuptools

To install SD-WAN Lab Deployment Tool:

    pip install --upgrade catalyst-sdwan-lab
    
Verify that SD-WAN Lab tool can run:

    sdwan-lab --version

You can also use the following shortcut to run any lab task:

    csdwan --version

Notes:
- The virtual environment is deactivated by typing 'deactivate' at the command prompt.
- Before running Catalyst SD-WAN Lab Deployment Tool again, make sure to activate the virtual environment back again (source venv/bin/activate).

## Usage
Simmilar to [Sastre](https://github.com/CiscoDevNet/sastre), the command line is structured as a set of base parameters, the task specification followed by task-specific parameters:

      sdwan-lab <base parameters> <task> <task-specific parameters>

Base parameters define global options such as verbosity level, CML credentials, etc.

Task indicates the operation to be performed. The following tasks are currently available:
* [Setup](#setup-task): Setup CML to support Catalyst SD-WAN use cases, upload new software images, and create node and image definitions that are required to run Catalyst SD-WAN lab in the CML.
* [Deploy](#deploy-task): Deploy CML topology with two underlay networks (INET, MPLS), one Manager/Validator/Controller, and one Gateway router. Once topology boots up, configure the control components and create basic templates / configuration groups.
* [Add](#add-task): Add and automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges) to existing lab.
* [Backup](#backup-task): Backup the Catalyst SD-WAN Lab runnning in CML, including the CML topology and all its nodes, SD-WAN device states and templates / configuration groups.
* [Restore](#restore-task): Restore the Catalyst SD-WAN Lab from backup, onboard and confgure control components and create basic feature templates / configuration groups. If there are any WAN Edges, automatically onboard the WAN Edges back to the SD-WAN Manager using the configuration from the backup.
* [Delete](#delete-task): Delete currently running lab from CML and remove all lab data.
* [Sign](#sign-task): Sign Certificate Signing Request (CSR) using SD-WAN Lab Deployment Tool Root CA

Task-specific parameters are provided after the task argument.

### Base Parameters

      sdwan-lab -h
      usage: sdwan-lab.py [-h] [-c <cml-ip>] [-u <cml-user>] [-p <cml-password>] [-v] [--version] {setup,deploy,add,backup,restore,delete} ...
      
      Catalyst SD-WAN Lab Deployment Tool - Automation Tool for managing Cisco Catalyst SD-WAN labs inside Cisco Modelling Labs
      
      positional arguments:
        {setup,deploy,add,backup,restore,delete}
                              Task to be performed.
          setup               Setup on-prem CML to use Catalyst SD-WAN Lab automation.
          deploy              Deploy a new Catalyst SD-WAN lab pod.
          add                 Add Catalyst SD-WAN device to running lab pod.
          backup              Backup running Catalyst SD-WAN lab pod.
          restore             Restore Catalyst SD-WAN POD from backup.
          delete              Delete the CML lab and all the lab data.
          sign                Sign CSR using the SD-WAN Lab Deployment Tool Root CA.
      
      optional arguments:
        -h, --help            show this help message and exit
        -c <cml-ip>, --cml <cml-ip>
                              CML IP address, can also be defined via CML_IP environment variable. If neither is provided user is prompted for CML IP.
        -u <cml-user>, --user <cml-user>
                              CML username, can also be defined via CML_USER environment variable. If neither is provided user is prompted for CML username.
        -p <cml-password>, --password <cml-password>
                              CML password, can also be defined via CML_PASSWORD environment variable. If neither is provided user is prompted for CML password.
        -v, --verbose         Increase output verbosity.
        --version             show program's version number and exit

Most of the parameters can also be provided via environment variables:
* CML_IP
* CML_USER
* CML_PASSWORD
* MANAGER_IP
* MANAGER_USER
* MANAGER_PASSWORD
* MANAGER_MASK
* MANAGER_GATEWAY
* LAB_NAME

For any of the required arguments, user is prompted for a value if they are not provided via the environment variables or command line arguments.

The easiest way to run the tool is to provide all the lab variables in the rc file and source that file. The example file below contains all the variables required to run all the tasks.

    % cat rc-example.sh
    export CML_IP='10.0.0.1'
    export CML_USER='user1'
    export CML_PASSWORD='password123'
    export MANAGER_IP='10.0.0.10'
    export MANAGER_USER='sdwan'
    export MANAGER_PASSWORD='sdwanlab123'
    export MANAGER_MASK='/24'
    export MANAGER_GATEWAY='10.0.0.254'
    export LAB_NAME='sdwan'
    % source rc-example.sh

Note that if password was not defined, the user will be prompted for a password. Also please note we recommend not to use admin user as MANAGER_USER. Instead, configure a different user name to always have a backup user. By default, the MANAGER_PASSWORD will be set for both admin user and the MANAGER_USER that you specify.

Note that MANAGER_IP can be:
- an IP address: SD-WAN Manager will be reachable over this IP address. By default the IP address should come from the same subnet as CML IP, unless custom bridge is specified during deploy task.
- a PATty port in format "pat:<outside-port>": SD-WAN Manager will be reachable over CML IP port <outside-port>. Before using this option, PATTy needs to be enabled on the CML server as per [CML documentation](https://developer.cisco.com/docs/modeling-labs/patty-tool-overview/).

### Task-specific Parameters
Task-specific parameters and options are defined after the task is provided. Each task has its own set of parameters. Check the task documentation to learn more about task-specific parameters.

### Setup Task
This task makes sure your CML is ready to run Catalyst SD-WAN labs. The task will:
* Create node definitions that are required to run Catalyst SD-WAN lab in the CML: Manager, Validator, Controller and Edge
* Look for new SD-WAN software images in the folder where the script was run. If the image is found, upload the image to CML and create image definition for the right node definition: Manager, Validator, Controller and Edge

On each CML server that you want to use, you should run a setup task at least once to create required node and image definitions. You can rerun the setup task each time you want to add a new Catalyst SD-WAN software image to your CML server.

This task have one task-specific argument that allows you to migrate the node and image definitions to new format if you've used SD-WAN Lab 1.x in the past. 

      sdwan-lab setup -h
      usage: sdwan-lab.py setup [-h] [--migrate]
      
      optional arguments:
        -h, --help  show this help message and exit
        --migrate   Migrate node and image definitions from SD-WAN Lab v1.x to v2.x. This task should be run once if CML server was using SD-WAN LAb Tool v1.x in the past.

### Deploy Task
This task:
1. Defines four/five subnets:
   * VPN0 - 172.16.0.0/24
   * INET - 172.16.1.0/24
   * MPLS - 172.16.2.0/24
   * External Connector - in bridge mode, this subnet is defined by task-specific parameters and is used to provide external reachability to SD-WAN Manager.
   * Internet Connector - in NAT mode, this subnet provides Internet connectivity for Internet transport and is same as CML subnet
2. Deploys basic SD-WAN topology with:
   * two underlay networks (INET, MPLS)
   * one Manager
   * one Validator
   * one Controller
   * one Gateway router that connects VPN0 subnet to INET and MPLS subnets
3. Once topology boots up, the task configures the control plane (control components, certificates, etc.) and create basic feature templates / configuration groups that can be used for WAN Edge onboarding. It also attaches Controller to device template.
4. At this point you can start creating your custom topology using [Add Task](#add-task) to automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges).

You should run this task to deploy a new lab with control plane configured and build any WAN Edge topology you like.

This task has several task-specific parameters, including software version that you want to run on the control components.

      sdwan-lab deploy -h
      usage: sdwan-lab.py deploy [-h] [--manager <manager-ip>] [--mmask <manager-mask>] [--mgateway <manager-gateway>] [--muser <manager-user>] [--mpassword <manager-password>] [--bridge <custom-bridge-name>] [--dns <dns-server-ip>]
                                 <software-version>
      
      positional arguments:
        <software-version>    Software version that will be used on SD-WAN Control Components.
      
      optional arguments:
        -h, --help            show this help message and exit
        --manager <manager-ip>
                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.
        --mmask <manager-mask>
                              Subnet mask for given SD-WAN Manager IP (e.g. /24), can also be defined via MANAGER_MASK environment variable. If neither is provided user is prompted for SD-WAN Manager subnet mask.
        --mgateway <manager-gateway>
                              Gateway IP for given SD-WAN Manager IP, can also be defined via MANAGER_GATEWAY environment variable. If neither is provided user is prompted for Manager gateway IP.
        --muser <manager-user>
                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.
        --mpassword <manager-password>
                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.
        --lab <lab_name>      Set CML Lab name, can also be defined via LAB_NAME environment variable. If not provided, default name "sdwan<number>" will be assigned.
        --bridge <custom-bridge-name>
                              Set custom bridge for SD-WAN Manager external connection. Default is System Bridge
        --dns <dns-server-ip>
                              Set custom DNS server for Internet/VPN0 transport. Default is same as CML DNS
        --retry               If for some reason your script lost connectivity during SD-WAN Manager boot, you can add --retry to continue onboarding the lab that is already in CML.

Time to complete the deployment task depends on:
* SD-WAN software version
* CML resources

### Add Task
This task adds Catalyst SD-WAN nodes (Validators/Controllers/Edges) into existing Catalyst SD-WAN lab. This task will:
1. Add requested number of nodes to the CML topology and boot them with cloud-init configuration
2. Once nodes boot up, automatically onboard them to SD-WAN Manager
3. For Controller/Edge nodes, automatically attach basic device template / configuration group
4. For Validator nodes, automatically update Validator FQDN mapping with new IP addresses

This task has several task-specific parameters.

      sdwan-lab add -h
      usage: sdwan-lab.py add [-h] [--manager <manager-ip>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>] <number-of-devices> <device-type> <software-version>
      
      positional arguments:
        <number-of-devices>   Number of devices to be added.
        <device-type>         Type of device/s to be added (e.g. validator, controller, edge, sdrouting).
        <software-version>    Software version that will be used.
      
      optional arguments:
        -h, --help            show this help message and exit
        --manager <manager-ip>
                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.
        --muser <manager-user>
                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.
        --mpassword <manager-password>
                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.
        --lab <lab_name>      CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.

Below you will find few examples of add task:

    sdwan-lab add 1 validator 20.9.4 --lab sdwan1
    sdwan-lab add 2 controllers 20.12.2 --lab sdwan2
    sdwan-lab add 5 edges 17.09.03a --lab vsdwan1
    sdwan-lab add 2 sdrouting 17.12.2 --lab vsdwan1

### Backup Task
This task creates a backup of the Catalyst SD-WAN lab running in CML. CML doesn't natively support configuration export from Catalyst SD-WAN nodes, but this script can help you to save your Catalyst SD-WAN configuration. This task will:
1. For Manager, Validator, Controller and WAN Edge nodes (SD-WAN and SD-Routing), create configuration backup.
2. For non-SD-WAN nodes, export the configuration if it's supported by CML.
3. Save the CML topology with exported configuration.
4. Create a backup of SD-WAN Manager templates, policies and configuration groups using [Sastre](https://github.com/CiscoDevNet/sastre).

This task has several task-specific parameters, including working directory where backup is saved.

    % sdwan-lab back -h  
      usage: sdwan-lab.py backup [-h] [--manager <manager-ip>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>] [--workdir <directory>]
      
      optional arguments:
        -h, --help            show this help message and exit
        --manager <manager-ip>
                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.
        --muser <manager-user>
                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.
        --mpassword <manager-password>
                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.
        --lab <lab_name>      CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.
        --workdir <directory>
                              Backup destination folder
    
### Restore Task
This task restores Catalyst SD-WAN lab from a backup. This task will:
1. Import the CML topology from the backup and boot the Catalyst SD-WAN control components first.
2. Once control components are up, configure the control plane (control components, certificates, etc.).
3. Restore SD-WAN Manager templates, policies and configuration groups using [Sastre](https://github.com/CiscoDevNet/sastre).
4. Verify if there are any WAN Edges in the topology (SD-WAN and SD-Routing). If yes, then generate the new OTP and automatically reonboard them to SD-WAN Manager.

This task has several task-specific parameters, including working directory from where backup is restored.

    % sdwan-lab restore -h
      usage: sdwan-lab.py restore [-h] [--manager <manager-ip>] [--mmask <manager-mask>] [--mgateway <manager-gateway>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>]
                                  [--workdir <directory>] [--deleteexisting] [--retry]
      
      optional arguments:
        -h, --help            show this help message and exit
        --manager <manager-ip>
                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.
        --mmask <manager-mask>
                              Subnet mask for given SD-WAN Manager IP (e.g. /24), can also be defined via MANAGER_MASK environment variable. If neither is provided user is prompted for SD-WAN Manager subnet mask.
        --mgateway <manager-gateway>
                              Gateway IP for given SD-WAN Manager IP, can also be defined via MANAGER_GATEWAY environment variable. If neither is provided user is prompted for Manager gateway IP.
        --muser <manager-user>
                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.
        --mpassword <manager-password>
                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.
        --lab <lab_name>      CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.
        --workdir <directory>
                              Restore source folder
        --deleteexisting      If there is already lab running with same name and using same SD-WAN Manager IP, delete this lab before restoring. Note the all running lab data will be lost!
        --retry               If for some reason your script lost connectivity during SD-WAN Manager boot, you can add --retry to continue restoring the lab that is already in CML

### Delete Task
This task deletes the CML lab and removes all it's data. Note after this operation, all lab data is lost.

This task has several task-specific parameters.

      sdwan-lab delete -h
      usage: sdwan-lab.py delete [-h] [--lab <lab_name>] [--force]
      
      optional arguments:
        -h, --help        show this help message and exit
        --lab <lab_name>  Lab name
        --force           Delete the lab without asking for confirmation. Note the all lab data will be lost!

### Sign Task
This tasks reads the Certificate Signing Request (CSR) from a file and signs it using SD-WAN Lab Deployment Tool Root CA.
At the end, the task prints the signed certificate in standard output.

This task has several task-specific parameters.

      sdwan-lab delete -h
      usage: sdwan-lab.py sign [-h] <csr_file>
      
      positional arguments:
        <csr_file>  Certificate Signing Request (CSR) File

## Limitations and scale
The tool supports the following scale per CML lab:

- 1 SD-wan Manager instance (Cluster is not yet supported)
- 8 SD-WAN Validators (Documented support from CCO)
- 12 SD-WAN Controllers (Documented support from CCO)
- 20 SD-WAN Edges
- 10 SD-Routing edges



## Appendix - WSL Installation

To install WSL on your Windows VM or Physical machine. Ensure that the HW Virutalization is enabled in the BIOS or VM Defintion.

If its on Windows server you may need to run this command to allow the WSL to function properly

Open PowerShell as Administrator and run:

`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`

Install WSL with default distribution (Ubuntu)
Open PowerShell and run

 `wsl --install`

Once the installation is finished and you have restarted Windows you are able to continue the installation of this tool as described in the [installation section](README.md#installing) of this document.

You can read more about [Linux on Windows with WSL here](https://learn.microsoft.com/en-us/windows/wsl/install).


## Authors
Tomasz Zarski (tzarski@cisco.com)

## License

BSD-3-Clause

## Acknowledgments
- Marcelo Reis and [Sastre](https://github.com/CiscoDevNet/sastre)
- Inigo Alonso


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cisco-open/sdwan-lab-deployment-tool",
    "name": "catalyst-sdwan-lab",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "cisco, catalyst, sdwan, lab",
    "author": "Tomasz Zarski",
    "author_email": "tzarski@cisco.com",
    "download_url": "https://files.pythonhosted.org/packages/17/e9/1a9c64ab6e64e5f955d7457e9bc757eac3793fdf8dbd296e60515c762b5f/catalyst_sdwan_lab-2.0.14.tar.gz",
    "platform": null,
    "description": "[![Tests](https://github.com/cisco-open/sdwan-lab-deployment-tool/actions/workflows/test.yml/badge.svg)](https://github.com/netascode/iac-validate/actions/workflows/test.yml)\n![Python Support](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-informational \"Python Support: 3.9, 3.10, 3.11, 3.12\")\n\n# Catalyst SD-WAN Lab Deployment Tool for Cisco Modeling Labs\n\nThis tool automates [Cisco Catalyst SD-WAN](https://www.cisco.com/site/us/en/solutions/networking/sdwan/index.html) lab deployment inside [Cisco Modeling Labs (CML)](https://www.cisco.com/c/en/us/products/cloud-systems-management/modeling-labs/index.html).\n\nThe tool will help you automate your CML lab deployments with SD-WAN Manager, Controllers and Validators and up to 20 SD-WAN edges. You can build as pods as your CML platform can host. Please refer to the [Limitations and scale](#limitations-and-scale) for details.\n\n\n\n## Getting Started\n\n### Prerequisites\nCatalyst SD-WAN Lab Deployment Tool requires Linux or macOS system. \nTo run is on Windows, please use [Linux on Windows with WSL](/README.md#appendix---wsl-installation) or set up Linux VM/container.\n\nCatalyst SD-WAN Lab Deployment Tool requires Python 3.9 or newer. This can be verified by pasting the following to a terminal window:\n\n    % python3 -c \"import sys;assert sys.version_info>(3,9)\" && echo \"ALL GOOD\"\n\nIf 'ALL GOOD' is printed it means Python requirements are met. If not, download and install the latest 3.x version at Python.org (https://www.python.org/downloads/).\n\nAll the Python prerequisites are automaticaly installed when you install the package. Please refer to the [Installing](#installing) section for details.\n\nThis tool requires CML 2.6 or higher.\n\n### Installing\nThe recommended way to install is via pip.\n\nCreate a directory to store the virtual environment and runtime files:\n\n      mkdir csdwan\n      cd csdwan\n    \nCreate virtual environment:\n\n      python3 -m venv venv\n    \nActivate virtual environment:\n\n     source venv/bin/activate\n    \n- Note that the prompt is updated with the virtual environment name (venv), indicating that the virtual environment is active.\n    \nUpgrade initial virtual environment packages:\n\n    pip install --upgrade pip setuptools\n\nTo install SD-WAN Lab Deployment Tool:\n\n    pip install --upgrade catalyst-sdwan-lab\n    \nVerify that SD-WAN Lab tool can run:\n\n    sdwan-lab --version\n\nYou can also use the following shortcut to run any lab task:\n\n    csdwan --version\n\nNotes:\n- The virtual environment is deactivated by typing 'deactivate' at the command prompt.\n- Before running Catalyst SD-WAN Lab Deployment Tool again, make sure to activate the virtual environment back again (source venv/bin/activate).\n\n## Usage\nSimmilar to [Sastre](https://github.com/CiscoDevNet/sastre), the command line is structured as a set of base parameters, the task specification followed by task-specific parameters:\n\n      sdwan-lab <base parameters> <task> <task-specific parameters>\n\nBase parameters define global options such as verbosity level, CML credentials, etc.\n\nTask indicates the operation to be performed. The following tasks are currently available:\n* [Setup](#setup-task): Setup CML to support Catalyst SD-WAN use cases, upload new software images, and create node and image definitions that are required to run Catalyst SD-WAN lab in the CML.\n* [Deploy](#deploy-task): Deploy CML topology with two underlay networks (INET, MPLS), one Manager/Validator/Controller, and one Gateway router. Once topology boots up, configure the control components and create basic templates / configuration groups.\n* [Add](#add-task): Add and automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges) to existing lab.\n* [Backup](#backup-task): Backup the Catalyst SD-WAN Lab runnning in CML, including the CML topology and all its nodes, SD-WAN device states and templates / configuration groups.\n* [Restore](#restore-task): Restore the Catalyst SD-WAN Lab from backup, onboard and confgure control components and create basic feature templates / configuration groups. If there are any WAN Edges, automatically onboard the WAN Edges back to the SD-WAN Manager using the configuration from the backup.\n* [Delete](#delete-task): Delete currently running lab from CML and remove all lab data.\n* [Sign](#sign-task): Sign Certificate Signing Request (CSR) using SD-WAN Lab Deployment Tool Root CA\n\nTask-specific parameters are provided after the task argument.\n\n### Base Parameters\n\n      sdwan-lab -h\n      usage: sdwan-lab.py [-h] [-c <cml-ip>] [-u <cml-user>] [-p <cml-password>] [-v] [--version] {setup,deploy,add,backup,restore,delete} ...\n      \n      Catalyst SD-WAN Lab Deployment Tool - Automation Tool for managing Cisco Catalyst SD-WAN labs inside Cisco Modelling Labs\n      \n      positional arguments:\n        {setup,deploy,add,backup,restore,delete}\n                              Task to be performed.\n          setup               Setup on-prem CML to use Catalyst SD-WAN Lab automation.\n          deploy              Deploy a new Catalyst SD-WAN lab pod.\n          add                 Add Catalyst SD-WAN device to running lab pod.\n          backup              Backup running Catalyst SD-WAN lab pod.\n          restore             Restore Catalyst SD-WAN POD from backup.\n          delete              Delete the CML lab and all the lab data.\n          sign                Sign CSR using the SD-WAN Lab Deployment Tool Root CA.\n      \n      optional arguments:\n        -h, --help            show this help message and exit\n        -c <cml-ip>, --cml <cml-ip>\n                              CML IP address, can also be defined via CML_IP environment variable. If neither is provided user is prompted for CML IP.\n        -u <cml-user>, --user <cml-user>\n                              CML username, can also be defined via CML_USER environment variable. If neither is provided user is prompted for CML username.\n        -p <cml-password>, --password <cml-password>\n                              CML password, can also be defined via CML_PASSWORD environment variable. If neither is provided user is prompted for CML password.\n        -v, --verbose         Increase output verbosity.\n        --version             show program's version number and exit\n\nMost of the parameters can also be provided via environment variables:\n* CML_IP\n* CML_USER\n* CML_PASSWORD\n* MANAGER_IP\n* MANAGER_USER\n* MANAGER_PASSWORD\n* MANAGER_MASK\n* MANAGER_GATEWAY\n* LAB_NAME\n\nFor any of the required arguments, user is prompted for a value if they are not provided via the environment variables or command line arguments.\n\nThe easiest way to run the tool is to provide all the lab variables in the rc file and source that file. The example file below contains all the variables required to run all the tasks.\n\n    % cat rc-example.sh\n    export CML_IP='10.0.0.1'\n    export CML_USER='user1'\n    export CML_PASSWORD='password123'\n    export MANAGER_IP='10.0.0.10'\n    export MANAGER_USER='sdwan'\n    export MANAGER_PASSWORD='sdwanlab123'\n    export MANAGER_MASK='/24'\n    export MANAGER_GATEWAY='10.0.0.254'\n    export LAB_NAME='sdwan'\n    % source rc-example.sh\n\nNote that if password was not defined, the user will be prompted for a password. Also please note we recommend not to use admin user as MANAGER_USER. Instead, configure a different user name to always have a backup user. By default, the MANAGER_PASSWORD will be set for both admin user and the MANAGER_USER that you specify.\n\nNote that MANAGER_IP can be:\n- an IP address: SD-WAN Manager will be reachable over this IP address. By default the IP address should come from the same subnet as CML IP, unless custom bridge is specified during deploy task.\n- a PATty port in format \"pat:<outside-port>\": SD-WAN Manager will be reachable over CML IP port <outside-port>. Before using this option, PATTy needs to be enabled on the CML server as per [CML documentation](https://developer.cisco.com/docs/modeling-labs/patty-tool-overview/).\n\n### Task-specific Parameters\nTask-specific parameters and options are defined after the task is provided. Each task has its own set of parameters. Check the task documentation to learn more about task-specific parameters.\n\n### Setup Task\nThis task makes sure your CML is ready to run Catalyst SD-WAN labs. The task will:\n* Create node definitions that are required to run Catalyst SD-WAN lab in the CML: Manager, Validator, Controller and Edge\n* Look for new SD-WAN software images in the folder where the script was run. If the image is found, upload the image to CML and create image definition for the right node definition: Manager, Validator, Controller and Edge\n\nOn each CML server that you want to use, you should run a setup task at least once to create required node and image definitions. You can rerun the setup task each time you want to add a new Catalyst SD-WAN software image to your CML server.\n\nThis task have one task-specific argument that allows you to migrate the node and image definitions to new format if you've used SD-WAN Lab 1.x in the past. \n\n      sdwan-lab setup -h\n      usage: sdwan-lab.py setup [-h] [--migrate]\n      \n      optional arguments:\n        -h, --help  show this help message and exit\n        --migrate   Migrate node and image definitions from SD-WAN Lab v1.x to v2.x. This task should be run once if CML server was using SD-WAN LAb Tool v1.x in the past.\n\n### Deploy Task\nThis task:\n1. Defines four/five subnets:\n   * VPN0 - 172.16.0.0/24\n   * INET - 172.16.1.0/24\n   * MPLS - 172.16.2.0/24\n   * External Connector - in bridge mode, this subnet is defined by task-specific parameters and is used to provide external reachability to SD-WAN Manager.\n   * Internet Connector - in NAT mode, this subnet provides Internet connectivity for Internet transport and is same as CML subnet\n2. Deploys basic SD-WAN topology with:\n   * two underlay networks (INET, MPLS)\n   * one Manager\n   * one Validator\n   * one Controller\n   * one Gateway router that connects VPN0 subnet to INET and MPLS subnets\n3. Once topology boots up, the task configures the control plane (control components, certificates, etc.) and create basic feature templates / configuration groups that can be used for WAN Edge onboarding. It also attaches Controller to device template.\n4. At this point you can start creating your custom topology using [Add Task](#add-task) to automatically onboard additional SD-WAN nodes (Validators/Controllers/Edges).\n\nYou should run this task to deploy a new lab with control plane configured and build any WAN Edge topology you like.\n\nThis task has several task-specific parameters, including software version that you want to run on the control components.\n\n      sdwan-lab deploy -h\n      usage: sdwan-lab.py deploy [-h] [--manager <manager-ip>] [--mmask <manager-mask>] [--mgateway <manager-gateway>] [--muser <manager-user>] [--mpassword <manager-password>] [--bridge <custom-bridge-name>] [--dns <dns-server-ip>]\n                                 <software-version>\n      \n      positional arguments:\n        <software-version>    Software version that will be used on SD-WAN Control Components.\n      \n      optional arguments:\n        -h, --help            show this help message and exit\n        --manager <manager-ip>\n                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.\n        --mmask <manager-mask>\n                              Subnet mask for given SD-WAN Manager IP (e.g. /24), can also be defined via MANAGER_MASK environment variable. If neither is provided user is prompted for SD-WAN Manager subnet mask.\n        --mgateway <manager-gateway>\n                              Gateway IP for given SD-WAN Manager IP, can also be defined via MANAGER_GATEWAY environment variable. If neither is provided user is prompted for Manager gateway IP.\n        --muser <manager-user>\n                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.\n        --mpassword <manager-password>\n                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.\n        --lab <lab_name>      Set CML Lab name, can also be defined via LAB_NAME environment variable. If not provided, default name \"sdwan<number>\" will be assigned.\n        --bridge <custom-bridge-name>\n                              Set custom bridge for SD-WAN Manager external connection. Default is System Bridge\n        --dns <dns-server-ip>\n                              Set custom DNS server for Internet/VPN0 transport. Default is same as CML DNS\n        --retry               If for some reason your script lost connectivity during SD-WAN Manager boot, you can add --retry to continue onboarding the lab that is already in CML.\n\nTime to complete the deployment task depends on:\n* SD-WAN software version\n* CML resources\n\n### Add Task\nThis task adds Catalyst SD-WAN nodes (Validators/Controllers/Edges) into existing Catalyst SD-WAN lab. This task will:\n1. Add requested number of nodes to the CML topology and boot them with cloud-init configuration\n2. Once nodes boot up, automatically onboard them to SD-WAN Manager\n3. For Controller/Edge nodes, automatically attach basic device template / configuration group\n4. For Validator nodes, automatically update Validator FQDN mapping with new IP addresses\n\nThis task has several task-specific parameters.\n\n      sdwan-lab add -h\n      usage: sdwan-lab.py add [-h] [--manager <manager-ip>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>] <number-of-devices> <device-type> <software-version>\n      \n      positional arguments:\n        <number-of-devices>   Number of devices to be added.\n        <device-type>         Type of device/s to be added (e.g. validator, controller, edge, sdrouting).\n        <software-version>    Software version that will be used.\n      \n      optional arguments:\n        -h, --help            show this help message and exit\n        --manager <manager-ip>\n                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.\n        --muser <manager-user>\n                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.\n        --mpassword <manager-password>\n                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.\n        --lab <lab_name>      CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.\n\nBelow you will find few examples of add task:\n\n    sdwan-lab add 1 validator 20.9.4 --lab sdwan1\n    sdwan-lab add 2 controllers 20.12.2 --lab sdwan2\n    sdwan-lab add 5 edges 17.09.03a --lab vsdwan1\n    sdwan-lab add 2 sdrouting 17.12.2 --lab vsdwan1\n\n### Backup Task\nThis task creates a backup of the Catalyst SD-WAN lab running in CML. CML doesn't natively support configuration export from Catalyst SD-WAN nodes, but this script can help you to save your Catalyst SD-WAN configuration. This task will:\n1. For Manager, Validator, Controller and WAN Edge nodes (SD-WAN and SD-Routing), create configuration backup.\n2. For non-SD-WAN nodes, export the configuration if it's supported by CML.\n3. Save the CML topology with exported configuration.\n4. Create a backup of SD-WAN Manager templates, policies and configuration groups using [Sastre](https://github.com/CiscoDevNet/sastre).\n\nThis task has several task-specific parameters, including working directory where backup is saved.\n\n    % sdwan-lab back -h  \n      usage: sdwan-lab.py backup [-h] [--manager <manager-ip>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>] [--workdir <directory>]\n      \n      optional arguments:\n        -h, --help            show this help message and exit\n        --manager <manager-ip>\n                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.\n        --muser <manager-user>\n                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.\n        --mpassword <manager-password>\n                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.\n        --lab <lab_name>      CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.\n        --workdir <directory>\n                              Backup destination folder\n    \n### Restore Task\nThis task restores Catalyst SD-WAN lab from a backup. This task will:\n1. Import the CML topology from the backup and boot the Catalyst SD-WAN control components first.\n2. Once control components are up, configure the control plane (control components, certificates, etc.).\n3. Restore SD-WAN Manager templates, policies and configuration groups using [Sastre](https://github.com/CiscoDevNet/sastre).\n4. Verify if there are any WAN Edges in the topology (SD-WAN and SD-Routing). If yes, then generate the new OTP and automatically reonboard them to SD-WAN Manager.\n\nThis task has several task-specific parameters, including working directory from where backup is restored.\n\n    % sdwan-lab restore -h\n      usage: sdwan-lab.py restore [-h] [--manager <manager-ip>] [--mmask <manager-mask>] [--mgateway <manager-gateway>] [--muser <manager-user>] [--mpassword <manager-password>] [--lab <lab_name>]\n                                  [--workdir <directory>] [--deleteexisting] [--retry]\n      \n      optional arguments:\n        -h, --help            show this help message and exit\n        --manager <manager-ip>\n                              SD-WAN Manager IP address, can also be defined via MANAGER_IP environment variable. If neither is provided user is prompted for SD-WAN Manager IP.\n        --mmask <manager-mask>\n                              Subnet mask for given SD-WAN Manager IP (e.g. /24), can also be defined via MANAGER_MASK environment variable. If neither is provided user is prompted for SD-WAN Manager subnet mask.\n        --mgateway <manager-gateway>\n                              Gateway IP for given SD-WAN Manager IP, can also be defined via MANAGER_GATEWAY environment variable. If neither is provided user is prompted for Manager gateway IP.\n        --muser <manager-user>\n                              SD-WAN Manager username, can also be defined via MANAGER_USER environment variable. If neither is provided user is prompted for SD-WAN Manager username.\n        --mpassword <manager-password>\n                              SD-WAN Manager password, can also be defined via MANAGER_PASSWORD environment variable. If neither is provided user is prompted for SD-WAN Manager password.\n        --lab <lab_name>      CML Lab name, can also be defined via LAB_NAME environment variable. If neither is provided user is prompted for lab name.\n        --workdir <directory>\n                              Restore source folder\n        --deleteexisting      If there is already lab running with same name and using same SD-WAN Manager IP, delete this lab before restoring. Note the all running lab data will be lost!\n        --retry               If for some reason your script lost connectivity during SD-WAN Manager boot, you can add --retry to continue restoring the lab that is already in CML\n\n### Delete Task\nThis task deletes the CML lab and removes all it's data. Note after this operation, all lab data is lost.\n\nThis task has several task-specific parameters.\n\n      sdwan-lab delete -h\n      usage: sdwan-lab.py delete [-h] [--lab <lab_name>] [--force]\n      \n      optional arguments:\n        -h, --help        show this help message and exit\n        --lab <lab_name>  Lab name\n        --force           Delete the lab without asking for confirmation. Note the all lab data will be lost!\n\n### Sign Task\nThis tasks reads the Certificate Signing Request (CSR) from a file and signs it using SD-WAN Lab Deployment Tool Root CA.\nAt the end, the task prints the signed certificate in standard output.\n\nThis task has several task-specific parameters.\n\n      sdwan-lab delete -h\n      usage: sdwan-lab.py sign [-h] <csr_file>\n      \n      positional arguments:\n        <csr_file>  Certificate Signing Request (CSR) File\n\n## Limitations and scale\nThe tool supports the following scale per CML lab:\n\n- 1 SD-wan Manager instance (Cluster is not yet supported)\n- 8 SD-WAN Validators (Documented support from CCO)\n- 12 SD-WAN Controllers (Documented support from CCO)\n- 20 SD-WAN Edges\n- 10 SD-Routing edges\n\n\n\n## Appendix - WSL Installation\n\nTo install WSL on your Windows VM or Physical machine. Ensure that the HW Virutalization is enabled in the BIOS or VM Defintion.\n\nIf its on Windows server you may need to run this command to allow the WSL to function properly\n\nOpen PowerShell as Administrator and run:\n\n`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`\n\nInstall WSL with default distribution (Ubuntu)\nOpen PowerShell and run\n\n `wsl --install`\n\nOnce the installation is finished and you have restarted Windows you are able to continue the installation of this tool as described in the [installation section](README.md#installing) of this document.\n\nYou can read more about [Linux on Windows with WSL here](https://learn.microsoft.com/en-us/windows/wsl/install).\n\n\n## Authors\nTomasz Zarski (tzarski@cisco.com)\n\n## License\n\nBSD-3-Clause\n\n## Acknowledgments\n- Marcelo Reis and [Sastre](https://github.com/CiscoDevNet/sastre)\n- Inigo Alonso\n\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Catalyst SD-WAN Lab Deployment Tool - Automation Tool for managing Cisco Catalyst SD-WAN labs inside Cisco Modeling Labs",
    "version": "2.0.14",
    "project_urls": {
        "Homepage": "https://github.com/cisco-open/sdwan-lab-deployment-tool",
        "Repository": "https://github.com/cisco-open/sdwan-lab-deployment-tool"
    },
    "split_keywords": [
        "cisco",
        " catalyst",
        " sdwan",
        " lab"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12eb833c21ad532262c8f5f710ecc9013550bac07b7d4be631ddaa3d252e4d2c",
                "md5": "fad67de5fcc16e106baec1ef8a8ca680",
                "sha256": "24bfe17e95a6e81bfda039dac2dce0908663276b4d776582863266588dfc2ccc"
            },
            "downloads": -1,
            "filename": "catalyst_sdwan_lab-2.0.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fad67de5fcc16e106baec1ef8a8ca680",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 657249,
            "upload_time": "2024-08-02T14:26:45",
            "upload_time_iso_8601": "2024-08-02T14:26:45.432667Z",
            "url": "https://files.pythonhosted.org/packages/12/eb/833c21ad532262c8f5f710ecc9013550bac07b7d4be631ddaa3d252e4d2c/catalyst_sdwan_lab-2.0.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "17e91a9c64ab6e64e5f955d7457e9bc757eac3793fdf8dbd296e60515c762b5f",
                "md5": "dee0d6a8ed41b5e20237934965575c85",
                "sha256": "64a17982b9368577012090dba94fb81c40f198d6d571833e9dc21a4213779af6"
            },
            "downloads": -1,
            "filename": "catalyst_sdwan_lab-2.0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "dee0d6a8ed41b5e20237934965575c85",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 307276,
            "upload_time": "2024-08-02T14:26:47",
            "upload_time_iso_8601": "2024-08-02T14:26:47.605433Z",
            "url": "https://files.pythonhosted.org/packages/17/e9/1a9c64ab6e64e5f955d7457e9bc757eac3793fdf8dbd296e60515c762b5f/catalyst_sdwan_lab-2.0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-02 14:26:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cisco-open",
    "github_project": "sdwan-lab-deployment-tool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "catalyst-sdwan-lab"
}
        
Elapsed time: 1.93076s