Here you will find Sample Code, Scripts and Information for use in the DevNet Open NX-OS Sandbox.
DevNet Sandboxes are all about providing an environment where developers can explore and test out whatever they are learning or working on. But sometimes having a starting point, or inspiration can be helpful, and that's what this repository is all about.
And should you develop some interesting code targeting the Sandbox and want to share with the community, we'd love to include it here!!! Just fork the repo and review our Pull Request instructions.
This DevNet Sandbox leverages VIRL for building and managing the environment, however there is no need for you as the user to be familiar with VIRL to leverage the Sandbox resources.
Should you run into issues with one or more of the nodes in the sandbox, or simply wish to restart the full environment you can leverage virlutils to manage the simulation.
Here is a simple walkthrough of managing the network.
-
In the
sbx_nxos
directory you'll see a filetopology.virl
. This file is the network definition for the simulation. -
If you are working from your own local workstation, and not the provided DevBox in the reservation, you'll need to setup
virlutils
before continuing.-
Install
virlutils
withpip install virlutils
-
Find the name of the simulation environment with
virl ls --all
Running Simulations ╒═════════════════════════╤══════════╤════════════════════════════╤═══════════╕ │ Simulation │ Status │ Launched │ Expires │ ╞═════════════════════════╪══════════╪════════════════════════════╪═══════════╡ │ sbx_nxos_default_0EAiXi │ ACTIVE │ 2018-08-06T19:27:41.297570 │ │ ╘═════════════════════════╧══════════╧════════════════════════════╧═══════════╛
-
Activate this simluation for
virlutils
withvirl use SIMULATION_NAME
. For example:$virl use sbx_nxos_default_0EAiXi Now using VIRL simulation sbx_nxos_default_0EAiXi
-
-
View the nodes that are running.
$ virl nodes ╒══════════════╤═════════════╤═════════╤═════════════╤════════════╤══════════════════════╤════════════════════╕ │ Node │ Type │ State │ Reachable │ Protocol │ Management Address │ External Address │ ╞══════════════╪═════════════╪═════════╪═════════════╪════════════╪══════════════════════╪════════════════════╡ │ nx-osv9000-1 │ NX-OSv 9000 │ ACTIVE │ REACHABLE │ telnet │ 172.16.30.101 │ N/A │ ├──────────────┼─────────────┼─────────┼─────────────┼────────────┼──────────────────────┼────────────────────┤ │ nx-osv9000-2 │ NX-OSv 9000 │ ACTIVE │ REACHABLE │ telnet │ 172.16.30.102 │ N/A │ ├──────────────┼─────────────┼─────────┼─────────────┼────────────┼──────────────────────┼────────────────────┤ │ nx-osv9000-3 │ NX-OSv 9000 │ ACTIVE │ REACHABLE │ telnet │ 172.16.30.103 │ N/A │ ├──────────────┼─────────────┼─────────┼─────────────┼────────────┼──────────────────────┼────────────────────┤ │ nx-osv9000-4 │ NX-OSv 9000 │ ACTIVE │ REACHABLE │ telnet │ 172.16.30.104 │ N/A │ ╘══════════════╧═════════════╧═════════╧═════════════╧════════════╧══════════════════════╧════════════════════╛
-
You can connect to individual nodes Console or VTY Lines with
virl console NODE
orvirl ssh NODE
orvirl telnet NODE
.$virl ssh nx-osv9000-1 Attemping ssh connectionto nx-osv9000-1 at 172.16.30.101 Warning: Permanently added '172.16.30.101' (RSA) to the list of known hosts. User Access Verification Password:
-
If you look at
virl --help
, you'll see you can alsovirl start
andvirl stop
individual nodes should there be a problem. -
Finally, you can completely restart the simulation by first
virl down
followed byvirl up
. This will destroy and restart the simulation.
For more information on how to use virlutils
to manage this and other VIRL/CML simulations, see the documentation on GitHub.
This sandbox is leveraged in different NX-OS Learning Labs. Within the learning_labs directory are different code samples used in these learning labs. Feel free to explore these samples on their own, or use the sandbox along with the Learning Labs.
Ansible is a great technology for Configuration Management of the network, and we've provided some sample playbooks to take a look at. Take a look at what's available here: ansible-playbooks/README.md.
Interested in using NX-API? Checkout samples here: nx-api/README.md
Coming Soon!!!
Looking for details on YANG Data Models and using NETCONF, RESTCONF, or gRPC with NX-OS? Checkout samples here: yang/README.md
Coming Soon!!!
Want to run Linux utilities and apps on your Nexus devices? Checkout samples here: guestshell/README.md
Coming Soon!!!
Interested in what else is possible? Checkout ideas here: other/README.md
Coming Soon!!!