Giter Club home page Giter Club logo

tenor's Introduction

TeNOR is the NFV Orchestrator platform developed by the T-NOVA project, responsible for managing the entire NFV lifecycle service.

GitHub release Build Status License

Prerequisites

  • Ruby >= 2.2.5 (Recommended 2.3.1) (installation provided in dependencies/install_dependencies.sh)
  • Bundler (installation provided in dependencies/install_dependencies.sh)
  • MongoDB (installation provided in dependencies/install_dependencies.sh)
  • Openstack Juno version or higher
  • Enable Keystone and Nova_Flavors in Openstack Heat resources (How to do it)

Optional Requirements

#Getting started

Steps

  1. Install the prerequisites (Ruby and MongoDB). You can install it using the script located inside the dependencies folder. Use the install_dependencies.sh script for automatic installation.
  2. Install TeNOR (internal dependencies and configurations). Installation script provided in the root folder tenor_install.sh.
  3. Start TeNOR.
  4. Register external modules if installed (Mapping, mAPI, WICM, VIMMonitoring, Netfloc...).
  5. Register a Network Function Virtualisation Infrastructure Point of Presence (NFVI-PoP) inserting the Openstack credentials into the authentication module.
  6. Test deploying a sample NSD/VNFD to the inserted NFVI-PoP.

Installation

We provide an installation script for Ubuntu 14.04 that helps with the installation of Ruby, MongoDB and RabbitMq.

In order to install Ruby and MongoDB execute the following script:

./dependencies/install_dependencies.sh

For each requirement, the script will ask if you want to install it or not. Write y or n and press the Enter Key.

Once Ruby is installed (you can be sure of that using ruby -v command in the terminal), you can proceed with the TeNOR installation. In the root folder run the following script:

./tenor_install.sh

A menu will appear and you can choose a number in the menu [1-7].

For TeNOR installation, insert the number 1 and press the Enter Key. The installation will start automatically installing the Ruby Gem dependencies. After few minutes, the script will ask you a set of questions regarding the location of the MongoDB and Cassandra (if installed). In the case of insert an emty values, the script will use the default values (localhost).

Make sure that you have installed a Ruby version >= 2.2.5 and the bundle command is installed.

Once the installation finishes, TeNOR needs to be started

Vagrant (alternative installation)

A Vagrantfile is provided with TeNOR and Mongodb installed.

Docker (alternative installation)

A Dockerfile is provided that generates a container with TeNOR and Mongodb installed. Once is running, all the components are installed and running.

  1. Build it with:

    docker build -t tnova/tenor .
    
  2. Run the container with:

    docker run -itd -p 4000:4000 -p 9000:9000 -v /opt/mongo:/var/lib/mongodb tnova/tenor bash
    
  3. Then, you can test TeNOR (Test if TeNOR is installed and running), and you can access to the command line with:

    docker exec -i -t $DOCKER_ID /bin/bash
    

Execution

TeNOR can be executed in two ways:

  1. Using Invoker (http://invoker.codemancers.com) (Help here)

    invoker start invoker.ini
    
  2. Using Byobu (modern Tmux). (sudo apt-get install byobu) Useful for development purposes. (Help here)

    ./tenor_development.sh
    

How to test if TeNOR is installed Test if TeNOR is installed and running

Using Invoker

Invoker is an utility to manage all the processes in the environment. The basic commands are the following:

  • invoker start invoker.ini -> Start TeNOR.
  • invoker reload ns-manager -> Restart the NS Manager service.
  • invoker list -> Show the list of running microservices and the status.

Using Byobu

Byobu is a modern Tmux that allows to execute multiple shells in one terminal. Typing the command byobu you will see a list of windows created using the provided script. More information of Byobu in (https://help.ubuntu.com/community/Byobu).

Basic keys for using Byobu:

  • F3 and F4 for navigate through the windows
  • F6 exit from Byobu

Registering modules in TeNOR

TeNOR has a microservice architecture and requires a registration of each microservices to the system. The NS Manager (API gateway) is the responsible to manage this registration. The internal TeNOR modules are managed automatically, but external modules like mAPI, WICM, Infrastructure repository and Netfloc needs to be registered.

The registration of modules can be done with in three ways:

  • Using TeNOR User Interface Configuration -> Modules
  • Using the TeNOR script: ./tenor_install.sh
  • Using the following script: ./loadModules.sh

The content of the loadModules.sh is a set of CuRL request to the NS Manager inserting the IP and PORT of each microservice. When the NS Manager recevies the requests, automatically register each module in order to generate a microservice-token.

Loading NFVI-PoP information in TeNOR

The NFVI-PoP information is saved in the Authentication module. First of all, TeNOR recevies the registration requests and validates the authentication. If it works, TeNOR saves the NFVI-PoP. The NFVI-PoP can be inserted in two manners:

  • Using the TeNOR User Interface: Configuration -> PoPs
  • Using the TeNOR script: Execute the tenor_install.sh script and choose the option 4. Add new PoP

User Interface

TeNOR has a User Interface that provides a global view of the all the orchestration functionalities. Allows to read the descriptors, instantiate services, see the monitoring data and configure TeNOR.

This user interface is located in the ui folder and contains their own README file with the installation guide. You need to start the UI and then visit the page http://127.0.0.1:9000 in your browser.

The UI has a default user for authentication, the credentials are (can be changed in the UI):

  • Username: admin
  • Password: adminpass

#Initial steps

Test if TeNOR is installed and running

Make a request to the following address (NS Manager):

curl -XGET http://127.0.0.1:4000/

If nothing is received, make sure that the NS Manager is running. If you receive a response, means that the NS Manager is ready for recevie requests.

In order to see the available APIs for the NS Manager, visit the API Documentation (http://t-nova.github.io/TeNOR/)

Define a VNFD and a NSD

Once TeNOR is ready to use, you should define a VNF Descriptor and a NS Descriptor. This task has some complexity and this repository contains a dummy descriptors that can be deployed without modification. You can find it in the NSD and VNFD validator modules.

The dummy NSD is located in: nsd-validator/assets/samples/nsd_example.json

The dummy VNFD is located in: vnfd-validator/assets/samples/vnfd_example.json

The next step is add the dummy descriptors to TeNOR system using the API. This step is explained in the following subsection.

Upload a VNFD and NSD and instantiate it

In order to test TeNOR functionality, you can deploy a dummy NSD/VNFD located in the Validator folders. Follow the next steps in order to test TeNOR (you can copy and paste in the command prompt):

  1. Add the VNFD in the VNF catalogue

    curl -XPOST 127.0.0.1:4000/vnfs -H "Content-Type: application/json" --data-binary @vnfd-validator/assets/samples/vnfd_example.json
    
  2. Add the NSD in the NS catalogue

    ns_id=$(curl -XPOST 127.0.0.1:4000/network-services -H "Content-Type: application/json" --data-binary @nsd-validator/assets/samples/nsd_example.json | ruby -r rubygems -r json -e "puts JSON[STDIN.read]['nsd']['id'];")
    
  3. Instantiate the NSD using the NSD ID extracted from the catalogue

    curl -XPOST 127.0.0.1:4000/ns-instances -H "Content-Type: application/json" --data '{"ns_id": "'$ns_id'", "callbackUrl": "https://httpbin.org/post", "flavour": "basic"}'
    

Other examples

We provide several examples with different functionalities. The VNFD_validator contains the VNFD examples and the NSD_validator folders the associtated NSDs.

The provided examples are:

  • vnfd-validator/assets/samples/2910_vnfd_example.json -> Basic VNFD using a clean Ubuntu Cloud Image.
  • vnfd-validator/assets/samples/2911_vnfd_existing_image_id.json -> You can reuse an image already loaded in Openstack. Modify the IMAGE_ID field.
  • vnfd-validator/assets/samples/2912_vnfd_existing_network_id.json -> You can reuse a network already created in Openstack. Modify the NETWORK_ID field.
  • vnfd-validator/assets/samples/2913_vnfd_scaling.json -> You can see how scale out/in works with this example.
  • vnfd-validator/assets/samples/2914_vnfd_two_vdus.json -> This VDU contains two VDUs (instances).

You can test it using the same commands shown before but chaning the file.

Tests

Each module has their own unit tests. Inside each folder execute the following command in order to run the tests: rspec

Furhtermore, an integration tests is provided in the root folder that executes and end-to-end tests testing all the functionalities of TeNOR. In the root folder configure the file .env with a valid Openstack credentials and then execute rspec.

A sample NSDs will be created and instantiated into the Openstack PoP defined in the .env file. After the execution, the test will remove the created components automatically.

Logs

TeNOR uses Fluentd in order to store the logs in a MongoDB. The UI inlcudes a view that allows to browser through the logs based on the date, severity and module.

Write a Lifecycle events

In each VNFD can have 5 types of lifecycle event: start, stop, restart, scaling_out and scaling_in. For each type, some data can be requested, but basically, the different template is in the scaling actions.

  • Get PublicIp of port in a VDU: get_attr[vdu0,CP5v7d,PublicIp]
  • Get PrivateIp of port in a VDU: get_attr[CPr3k7,fixed_ips,0,ip_address]
  • Get the last VDU for scaling-out: get_attr[vdu1,vdus]
  • Get the last PrivateIps for scaling-out: get_attr[CPsx4l,fixed_ips,0,ip_address]
  • Get the last PublicIps for scaling-out: get_attr[vdu0,CPudhr,PublicIp]
  • Timeout before remove instance due scale-in event:

Enable heat resources

TeNOR uses Openstack heat templates in order to deploy the VNFs. Make sure that Openstack used has the basic resource types. In general, Nova Flavors and Keystone types are disabled by default. Please, enable these resources.

You can see the available list of resources in: /usr/lib/python2.7/dist-packages/heat/contrib/

Then, modify the heat.conf (/etc/heat/heat.conf) and add the line: plugin_dirs=/usr/lib/python2.7/dist-packages/heat/contrib/nova_flavor/nova_flavor plugin_dirs=/usr/lib/python2.7/dist-packages/heat/contrib/heat_keystone/heat_keystone

Development

Microservice ports

Each microservice is listening in different port. This port is configured in the config.yml file of each module (folder).

Microservice Port
NS Manager 4000
NS Catalogue 4011
NS Provisioner 4012
NS Monitoring 4013
NSD Validator 4015
VNF Manager 4567
VNF Catalogue 4568
VNFD Validator 4570
HOT Generator 4571
VNF Catalogue 4572
VNF Monitoring 4573
UI 9000

Bug reports and Feature requests

Please use Github Issue Tracker for feature requests or bug reports.

License

Each module is published under different licenses, please take a look on each License file.

tenor's People

Contributors

adrian-rosello avatar italtel-unimi avatar jbatalle avatar jbonnet avatar miguelcastilho avatar wnke avatar xilouris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tenor's Issues

UI menu selected session issue

When selecting Instantiation Performance, Service Mapping gets selected too. Furthermore, when clicking Service Mapping the view doesn't change.

screenshot from 2016-10-13 10-34-39

Lifecycle - Remove of VNF instances

When a VNF instance is removed, sometimes the Stack is removed from Openstack, but Openstack returns an error message. Then, the VNF Manager is not able to remove the Stack because no exists inside Openstack. The VNF instance should be removed after polling the Stack status.

Problem deploying in Docker

Hi!

When I try to deploy TeNOR using the Dockerfile, everything works fine except when the mongodb database is filled with the admin user. That's the error I get:

Moped::Errors::ConnectionFailure: Could not connect to a primary node for replica set #<Moped::Cluster:47236887580100 @seeds=[<Moped::Node resolved_address="127.0.0.1:27017">]>
/usr/local/bundle/gems/moped-2.0.7/lib/moped/cluster.rb:254:in `with_primary'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/read_preference/primary.rb:55:in `block in with_node'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/retryable.rb:30:in `call'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/retryable.rb:30:in `with_retry'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/retryable.rb:39:in `rescue in with_retry'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/retryable.rb:29:in `with_retry'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/read_preference/primary.rb:54:in `with_node'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/query.rb:128:in `first'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/query_cache.rb:191:in `block in first_with_cache'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/query_cache.rb:135:in `with_cache'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/query_cache.rb:190:in `first_with_cache'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/contextual/mongo.rb:212:in `find_first'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/contextual.rb:20:in `find_first'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/findable.rb:110:in `find_by'
/root/TeNOR/ns-manager/Rakefile:23:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Moped::Errors::ConnectionFailure: Could not connect to a primary node for replica set #<Moped::Cluster:47236887580100 @seeds=[<Moped::Node resolved_address="127.0.0.1:27017">]>
/usr/local/bundle/gems/moped-2.0.7/lib/moped/cluster.rb:254:in `with_primary'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/read_preference/primary.rb:55:in `block in with_node'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/retryable.rb:30:in `call'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/retryable.rb:30:in `with_retry'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/read_preference/primary.rb:54:in `with_node'
/usr/local/bundle/gems/moped-2.0.7/lib/moped/query.rb:128:in `first'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/query_cache.rb:191:in `block in first_with_cache'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/query_cache.rb:135:in `with_cache'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/query_cache.rb:190:in `first_with_cache'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/contextual/mongo.rb:212:in `find_first'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/contextual.rb:20:in `find_first'
/usr/local/bundle/gems/mongoid-4.0.2/lib/mongoid/findable.rb:110:in `find_by'
/root/TeNOR/ns-manager/Rakefile:23:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)

When a NS instance is removed, remove the associated monitoring

When a instance is removed, the associated monitoring is not removed.

The NS and VNF monitoring should be removed at the same time the delete subcription is sent.

When an external entity requests for a monitoring data that no exists, should response an error.

MongoDB in ubuntu 16.04

At this moment, the dependencies script is used only for Ubuntu 14.04. This script can be migrated to Ubuntu 16.06, but there are some problems with the installation.

We should create a generic installation script for both versions.

Use a non Openstack admin user

Should be possible to use a non admin user when a PoP is registered.

The NS provisioning should be able to create the stack for that tenant/user without creating a new tenant/user.

When a PoP is added and the credentials are bad, the backend return a 401.

When a PoP is added throguh the UI, the NS manager checks the credentials before insert the PoP in Gatekeeper. In the case that the credentials are bad, returns a 401 (unauhtorized). The UI forwards the 401 to Angular and angular close the session.

In that case, the UI should remain in the PoP pages and show the error message.

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.