Giter Site home page Giter Site logo

nso-vagrant's Introduction

Vagrant NSO on Ubuntu 18 for Getting Started

published

link to download NSO

https://developer.cisco.com/docs/nso/#!getting-nso/downloads

Prereqs:

  • Install Vagrant, Install Ansible / Python locally on your laptop (outside the scope of this tutorial, just google it)

Tested on:

  • OS X 10.15.2
  • Ansible version 2.7.6 (to install NSO on VM)
  • Vagrant version 2.2.6
  • Virtualbox Guest Additions 5.2.26 - guest version is 5.2.22 Though it should work on other systems...pretty standard stuff.

Steps:

  1. Clone this repo: git clone https://github.com/jabelk/nso-getting-started.git
  2. Download the Cisco NSO application installer file (nso-VERSION-NUMBER.linux.x86_64.signed.bin)
  3. Download the Cisco NSO Cisco IOS (XE) NED, Cisco IOS XR NED, Cisco NXOS NED (ncs-NSOVERSION-cisco-PLATFORM-NEDVERSION.signed.bin)
  4. Move the installer file and the three NED files from your Downloads to where you cloned this repo, in its files directory. (for example) nso-vagrant/files/nso-VERSION-NUMBER.linux.x86_64.signed.bin
  5. vagrant up (in the repo working directory where the VagrantFile is)
  6. vagrant ssh and then ncs_cli -C -u admin to login to NSO. OR http://localhost:8009 for the NSO GUI

note, if you restart the VM after installing (rather than just suspending), you will need to turn on the NSO application source $HOME/nso-install/ncsrc; cd $HOME/nso-run/; ncs;, if you get the following error Cannot bind to internal socket 127.0.0.1:4569 : address already in use Daemon died status=20, then NSO is already running.

also note: the installation process assumes the files are in the signed.bin, not installer.bin or .tar.gz for NED. You can update the ansible tasks if this is not the case for you.

Getting Started

A couple of things. NSO when it is installed comes with a ton of documentation in the nso-install/doc directory. Check it out.

NSO comes with a bunch of examples in the nso-install/examples.ncs directory. Note that if you follow them, you will want to stop the NSO running in nso-run (using ncs --stop in the nso-run directory) since you can only have one instance of NSO running at a time and most of the examples assume you will use ncs-setup to set up a new instance of NSO to run the particular example.

Please go through the five day training I put together (with the help of my friends at the time):

FYI Bash Aliases

I added a few bash aliases for commonly used tasks in NSO:

alias kickoffnso='ncs_cli -u admin -C'
alias reloadbash='source ~/.bashrc'
alias servicepackage='ncs-make-package --service-skeleton python-and-template --augment /ncs:services '

Vagrant Specific Stuff

You should be able to access the NSO GUI over the ports exposed from the VM on your laptop. You can always verify what the port mapping is to your laptop by going vagrant port. NSO GUI is by default port 8080 locally within the VM, see what it is mapped to based on your available ports.

Shared Folder and NEDs

As part of the Vagrant set up, I added a shared folder, in my case it is called vagrant-data, but you can call it whatever you want.

If you want to use other NEDs, I suggest using that shared folder to transfer them in, or update the playbook to copy them over at provision time from the files directory. Make sure to put them in the packages directory and run make clean all in the package/src folder if it was compiled for a different release of NSO than what you have installed.

The shared folder is also good for exporting or pulling in service packages for testing, make sure to change owners though...otherwise you might get permission issues.

How Can I Edit Text Files on the Local VM?

I have had good luck with using a remote ssh edit package on either Sublime or VS Code, pointed to your localhost VM ssh ports.

Here are two examples.

Sublime

https://wbond.net/sublime_packages/sftp

VS Code

https://code.visualstudio.com/docs/remote/remote-overview

Shared Folder and NEDs

As part of the Vagrant set up, I add a shared folder, in my case it is called vagrant-data, but you can call it whatever you want. If you want to use updated neds, I suggest using that shared folder to transfer them in, or update the playbook to copy them over at provision time from the files directory. Make sure to put them in the packages directory and run make clean all in the package/src folder if it was compiled for a different release of NSO than what you have installed.

The shared folder is also good for exporting or pulling in service packages for testing, make sure to change owners though...otherwise you might get permission issues.

NSO Versions

If you are trying to install a different version of NSO than the one this repo is designed for, double check the build-vm.yml file and update the nso_version variable:

---
- hosts: all
  connection: paramiko
  become: yes

  vars:
    nso_install_location: "/home/{{ ansible_ssh_user }}/nso-install"
    nso_version: "UPDATE-ME-IF-NEEDED"
    # for example for nso-5.2.1.linux.x86_64.installer.bin nso_version is "5.2.1"
    user: vagrant

  tasks:
    - import_tasks: tasks/linux_packs.yml
    - import_tasks: tasks/install_nso.yml

nso-vagrant's People

Contributors

jabelk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.