Appendix B: Sastre Tool¶
Sastre is a command-line tool that provides a set of functions to assist with managing configuration elements and visualize information from Cisco SD-WAN deployments. With reference to its integration with SD-WAN Conversion Tool, Sastre tool is useful for the following two use cases:
- Export templates to a vManage that is not publicly accessible
For a target vManage that is not publicly accessible by the SD-WAN Conversion Tool, the templates created at the end of a conversion process can be exported as a Sastre archive. The templates within the Sastre archive can then be uploaded to the target vManage using Sastre tool.
- Import templates from a vManage that is not publicly accessible
For a source vManage that is not publicly accessible by the SD-WAN Conversion Tool, a backup of the templates and policies present in the vManage can be taken using Sastre tool to create a Sastre archive. The Sastre archive can then be uploaded in the SD-WAN Conversion Tool to export templates and policies to a vManage.
Setting Up Sastre Tool¶
Sastre requires Python 3. In order to install Sastre tool, follow the steps mentioned below:
- Create a directory to store the virtual environment and runtime files.
mkdir sastre
cd sastre
- Create Python virtual environment.
python3 -m venv venv
- Activate virtual environment.
source venv/bin/activate
An indication of successful activation of the virtual environment is that the command line prompt is updated with the virtual environment name (venv).
- Within the virtual environment, upgrade the initial virtual environment packages.
pip3 install --upgrade pip setuptools
- Install Sastre package.
pip3 install --upgrade cisco-sdwan
Note
Before using Sastre tool, it is important to activate the virtual environment as mentioned in step 3 of Setting Up Sastre Tool.
Helpful Sastre commands¶
Listed below are a few Sastre commands used in conjunction with the SD-WAN Conversion tool. The IP and credentials of the vManage are prompted after the Sastre command has been executed from the terminal.
Upload Content of Sastre Archive to vManage
sdwan --verbose --port <port_number> restore all --workdir <path_to_sastre_backup>
- where
- port_number: Port used to access vManage UI
- path_to_sastre_backup: Path to the folder of vManage backup created by Sastre tool
Example:
sdwan --verbose --port 7777 restore all --workdir sastre-archive_268
Create Backup of vManage
sdwan --verbose --port <port_number> backup all
- where
- port_number: Port used to access vManage UI
Example:
sdwan --verbose --port 7777 backup all
Running the backup command will create a Sastre backup folder of the specified vManage in a directory named data within the directory from which the command was executed.
See also
For more information around the parameters and functions provided by Sastre tool, check out the official documentation of the tool.