OpenClos is a Python script library that helps you automate the design, deployment, and maintenance of a Layer 3 IP fabric built on Border Gateway Protocol (BGP).
To create an IP fabric that uses a spine and leaf architecture, the script generates configuration files for the devices in the fabric and uses zero-touch provisioning (ZTP) to push the configuration files to the devices. You can tailor the IP fabric to your network environment by adjusting values in the template files that are associated with the script.
Note: Fabric devices must be placed in a factory-default or zeroized state to participate in an OpenClos-generated IP fabric.
When you execute the script, it automatically generates values for the following device configuration settings within the IP fabric:
Interface Assignments
Control Plane
High Availability
curl -L -u '<username>:<password>' -o OpenClos.zip https://github.com/Juniper/OpenClos/archive/<branch or tag>.zip
sudo pip install --egg OpenClos.zip
Install in development mode
curl -L -u '<username>:<password>' -o OpenClos.zip https://github.com/Juniper/OpenClos/archive/<branch or tag>.zip
unzip OpenClos.zip
cd OpenClos-<version>
sudo pip install --egg -e .
CentOS Installation Issues
For all the above errors, install the following packages and reinstall OpenClos.
sudo yum install -y python-devel libxml2-devel libxslt-devel gcc openssl
In CentOS 5.7, if the installation of lxml 3.4 causes a problem, manually install lxml 3.3.6 and then install OpenClos sudo pip install lxml==3.3.6 --egg
Ubuntu Installation Issues
For all the above errors, install the following packages and reinstall OpenClos
sudo apt-get install -y python-dev libxml2-dev libxslt-dev
Windows Installation Issues
One of the OpenClos dependent modules uses PyCrypto. If the installation generates an error message, use the platform-specific prebuilt PyCrypto software from http://www.voidspace.org.uk/python/modules.shtml#pycrypto, and then reinstall OpenClos.
Database
Junos OS image
Copy the Junos OS image file to OpenClos-
Example - OpenClos-R1.0.dev1/jnpr/openclos/conf/ztp/jinstall-qfx-5-13.2X51-D20.2-domestic-signed.tgz
Global configuration for the openclos.yaml file To configure ZTP, update the REST API IP address with the server's external IP address.
Example - ipAddr : 192.168.48.201
POD specific configuration for the closTemplate.yaml file
Please update the following settings per your own specific deployment environment:
Example - based on a 10-member IP Fabric:
For more examples, see
The script is available at
Runtime issues
OpenClos and its dependent module junos-eznc both use the same 'jnpr' namespace. If junos-eznc was already installed with pip, uninstall this module by issuing the "pip uninstall junos-eznc" command and then install OpenClos by issuing the "pip install OpenClos.zip --egg" command. Be sure to use '--egg' flag to avoid a 'flat' installation, which causes an import error.
cd <path-to-OpenClos>/jnpr/openclos/tests
nosetests --exe --with-coverage --cover-package=jnpr.openclos --cover-erase
The script generates the device configuration files and uses ZTP to send them to the devices.
It also generates a cabling plan in two formats:
All generated configurations (device and ZTP configurations) are stored in the /jnpr/openclos/out/PODID-PODNAME directory
Apache 2.0
If you find an issue with the software, please open a bug report on the OpenClos repository.
The Juniper Networks Technical Assistance Center (JTAC) does not provide support for OpenClos software. You can obtain support for OpenClos by visiting the OpenClos Google Group