Skip to content

Getting started

Gerardo García edited this page Nov 28, 2016 · 72 revisions

This page is obsolete.

The project OpenMANO has been contributed to the open source community project Open Source MANO (OSM), hosted by ETSI.

Go to the URL osm.etsi.org to know more about OSM.


#Table of Contents#

#Introduction#

Next figure shows the architecture of openMANO. It consists of three main modules (openvimd, openmanod and openmano-gui) and two command line clients (openvim and openmano).

openmano architecture
External components are managed by openvimd. Compute nodes and image storage are directly managed by openvimd, while switches are indirectly managed by openvimd: the Openflow Controller (OFC) controls the switches, and openvimd interacts with the OFC.

#Requirements#

For a simple setup to test openmano, two physical servers, both in the same LAN, are required to create a minimal setup for NFV:

  • One server would be the controller node, where the openmano components will run. In this node, an Openflow controller will run. No special requirements are needed to run it. It can run in a VM, even though inside the compute node.
  • The other server would be a compute node where the VMs will be deployed. This server must be a Linux system (e.g. RedHat 7.0, CentOS 7.0, Ubuntu Server 14.04), 64bits OS with KVM, qemu and libvirt. In order to get the maximum performance, compute nodes must be configured following these guidelines. Openmano, and particularly openvimd module, has been tested with servers based on Xeon E5-based Intel processors with Ivy Bridge architecture. Although it might work with Intel Core i3, i5 and i7 families, no tests have been carried out with servers based on those processors.

Note: You can test the entire API and CLI without a compute node nor an Openflow controller, running openvim in 'mode: test'. But take into account that in this mode, no VMs will be actually deployed. Also if you use openstack as a VIM a single VM for openmano is enough.

For a full NFV setup, ready for data plane VNFs, extra requirements are needed:

  • Compute nodes must have 10GE interfaces with SR-IOV capabilities. Suitable NICs are, for instance, Intel X520 NICs.
  • An Openflow switch with 10GE interfaces is required to interconnect the compute nodes, allowing VM interconnection at switch level while using passthrough or SR-IOV.

A complete guide for setting an NFV Infrastructure can be found here.

#Installation#

For simplicity, both openmano and openvim will be installed in the same server, although they could be installed in different ones. Both programs require an RDBMS such as MySQL or MariaDB. We assume that the database will be hosted also on the same host. Besides, openvim relies on an Openflow controller.

##Automatic installation##

You can download and run an Ubuntu Server LAMP and run the installation script providing the database user and password. For example:

  • Download a Ubuntu Server 14.04 LTS (ubuntu/reverse). Run the VM and from inside execute the command:

      wget https://github.com/nfvlabs/openmano/raw/master/scripts/install-openmano.sh
      chmod +x install-openmano.sh 
      sudo ./install-openmano.sh [<database-root-user> [<database-password>]]
      #NOTE: you can provide optionally the root user and password of the database.
      #In case the image does not have a mysql/mariadb, it will be installed.
    
  • Other tested distributions are Ubuntu Desktop 64bits 14.04.2 LTS (osboxes/osboxes.org), CentOS 7 (osboxes/osboxes.org)

##Manual installation##

  • Install the following packages in the controller node: mysql, python-yaml, python-libvirt, python-bottle, python-mysqldb, python-jsonchema, python-paramiko, python-bs4, python-argcomplete, git. Another useful package is screen. And for using openstack as a VIM: python-novaclient python-keystoneclient python-glanceclient python-neutronclient

    • In RedHat/Fedora/CentOS:

        #perhaps epel repository need to be installed: 'yum install epel-release; yum repolist'
        sudo yum install git screen wget PyYAML libvirt-python MySQL-python \
        python-jsonschema python-paramiko python-argcomplete python-requests python-devel
        sudo easy_install bottle
        sudo easy_install python-novaclient python-keystoneclient python-glanceclient python-neutronclient
      
    • In Ubuntu/Debian:

        sudo apt-get install git screen wget python-yaml python-libvirt python-bottle \
        python-mysqldb python-jsonschema python-paramiko python-argcomplete python-requests
        sudo apt-get install python-novaclient python-keystoneclient python-glanceclient python-neutronclient
      
  • Clone the git repository:

      git clone https://github.com/nfvlabs/openmano.git openmano
    
  • Database creation and initialization

    • Create the two databases

        mysqladmin -u root -p create vim_db
        mysqladmin -u root -p create mano_db
      
    • Grant access privileges from localhost. Go to mysql console and use the following commands to create user vim and nfvo, and grant privileges to the databases:

        mysql> CREATE USER 'vim'@'localhost' identified by 'vimpw';
        mysql> GRANT ALL PRIVILEGES ON vim_db.* TO 'vim'@'localhost';
        mysql> CREATE USER 'mano'@'localhost' identified by 'manopw';
        mysql> GRANT ALL PRIVILEGES ON mano_db.* TO 'mano'@'localhost';       
      
    • Edit SQL database VIM files host_ranking.sql and of_ports_correspondence.sql

    • Initialize both databases

        openvim/database_utils/init_vim_db.sh   -uvim -pvimpw
        openmano/database_utils/init_mano_db.sh -umano -pmanopw
      
  • Download floodlight-0.90 Openflow controller and install it following these instructions. Note: not needed in 'test' or 'host only' mode. Take into account that an Openflow switch is also needed to run the 'normal' mode.

  • openmano-gui web instalation at URL (http://localhost/**openmano**)

      #allow apache user 'www-data'(Ubuntu)/'apache'(RedHat,CentOS) grant access to the files, changing user owner
      sudo chown -R www-data ./openmano-gui       #or 'apache' for other distributions
      #create a link 
      sudo ln -s /<path...>/openmano-gui /var/www/html/openmano
      #if web can not be loaded check:
      #   Web service is running: 'sudo service apache2(or httpd) start'
      #   Access permissions, e.g. parent directories have 'x' flag for others:
      #       'sudo chmod o+x parent_folders'
      #   check SElinux access for Redhat, Centos distributions:
      #       sudo  chcon -R --reference=/var/www ./openmano-gui 
      #   run 'sudo tail /var/log/apache2/error.log' (or 'sudo tail /var/log/httpd/error_log') to get clues on the problem
      #   in case web server fails sending commands to openmano revise iptables (or firewalld) on running port (e.g. 9090)
    
  • It is useful to configure arg-complete and put in the path the openvim and openmano clients

      #creates a bin folder and links to openmano and openvim files inside /home/user/bin folder
      mkdir -p ~/bin           #this folder is in the PATH for most Linux distributions
      ln -s ${PWD}/openmano/openvim/openvim   ~/bin/openvim
      ln -s ${PWD}/openmano/openmano/openmano ~/bin/openmano
      #configure argautocomplete for this user
      mkdir -p ~/.bash_completion.d
      activate-global-python-argcomplete --dest=/home/${USER}/.bash_completion.d
      #execute . .bash_completion.d/python-argcomplete.sh at login. Add to .bashrc
      echo ". /home/${USER}/bash_completion.d/python-argcomplete.sh" >> ~/.bashrc
    

#Configuration and Running#

In case you want to use openstack as a VIM, follow this link

##Floodlight OpenFlow controller configuration##

  • Go to scripts folder and edit the file ./scripts/flow.properties setting the appropriate port values

  • Start FloodLight

      service-openmano floodlight start
      #it creates a screen with name "flow" and start on it the openflow controller
      screen -x flow                             # goes into floodlight screen
      [Ctrl+a , d]                               # goes out of the screen (detaches the screen)
      less openmano/logs/openflow.0
    

##openvim configuration##

  • Go to openvim folder and edit openvimd.cfg. Note: by default it runs in 'mode: test' where no real hosts neither openflow controller are needed. You can change to 'mode: normal', or 'mode: host only' (no openflow controller is needed)

  • Start openvim server

      service-openmano openvim start
      #it creates a screen with name "vim" and starts inside the "./openvim/openvimd.py" program
      screen -x vim                              # goes into openvim screen
      [Ctrl+a , d]                               # goes out of the screen (detaches the screen)
      less openmano/logs/openvim.0
    

##openmano configuration##

  • Go to openmano folder and edit [openmanod.cfg] (https://github.com/nfvlabs/openmano/raw/master/openmano/openmanod.cfg).

  • Start openmano server

      service-openmano openmano start
      #it creates a screen with name "mano" and starts inside the "./openmano/openmanod.py" program
      screen -x mano                             # goes into openmano screen
      [Ctrl+a , d]                               # goes out of the screen (detaches the screen)
      less openmano/logs/openmano.0
    

#How to use it# You can test your instalation with "source ./scripts/initopenmano.sh"

##openvim## Actions related to the infrastructure must be conveyed through the openvim client.

  • Let's configure the openvim CLI client. Needed if you have changed the openvimd.cfg file

      ./openvim config                           # show openvim related variables
      
      #To change variables run
      export OPENVIM_HOST=<http_host of openvimd.cfg>
      export OPENVIM_PORT=<http_port of openvimd.cfg>
      export OPENVIM_ADMIN_PORT=<http_admin_port of openvimd.cfg>
      
      #You can insert at .bashrc for authomatic loading at login:
      echo "export OPENVIM_HOST=<...>" >> /home/${USER}/.bashrc
      ...
    
  • Let's attach compute nodes

    In 'test' mode we need to provide fake compute nodes with all the necessary information:

      ./openvim host-add test/hosts/host-example0.json 
      ./openvim host-add test/hosts/host-example1.json 
      ./openvim host-add test/hosts/host-example2.json 
      ./openvim host-add test/hosts/host-example3.json 
      ./openvim host-list                        #-v,-vv,-vvv for verbosity levels
    

    In 'normal' or 'host only' mode, the process is a bit more complex. First, you need to configure appropriately the host following these guidelines. Then:

       ./openvim host-add                      #answer the questions
       #difficult to work the first time, be patient :-)
    

    If fails, you can try this other method:

       #copy ./scripts/host-add.sh and run at compute host for gather all the information
       ./host_add.sh <user> <ip_name> >> host.yaml
    
       #NOTE: If the host contains ethernet ports connected to the openflow switch for dataplane,
       # the switch port where are connected information must be provided manually, 
       # otherwise these interfaces cannot be used. Follow one of two methods:
       #   1) Fill ./openvim/database_utils/of_ports_pci_correspondence.sql ...
       #   ... and load with mysql -uvim -p vim_db < ./openvim/database_utils/of_ports_pci_correspondence.sql
       #   2) or add manually this information at generated host.yaml with a 'switch_port: <whatever>' 
       #   ... entry at 'host-data':'numas': 'interfaces' 
    
       #copy this generated file host.yaml to the openmano server, and add this compute
       ./openvim host-add host.yaml
    

    Note: it must be noted that Openmano, and particularly openvimd module, has been tested with servers based on Xeon E5 Intel processors with Ivy Bridge architecture. No tests have been carried out with Intel Core i3, i5 and i7 families, so there are no guarantees that the integration will be seamless.

  • Let's list the external networks:

       ./openvim net-list
    
  • Let's create some external networks in openvim. These networks are public and can be used by any VNF. It must be noticed that these networks must be pre-provisioned in the compute nodes in order to be effectively used by the VNFs. The pre-provision will be skipped since we are in test mode. Four networks will be created:

    • default -> default NAT network provided by libvirt. By creating this network, VMs will be able to connect to default network in the same host where they are deployed.
    • macvtap:em1 -> macvtap network associated to interface "em1". By creating this network, we allow VMs to connect to a macvtap interface of physical interface "em1" in the same host where they are deployed. If the interface naming scheme is different, use the appropriate name instead of "em1".
    • bridge_net -> bridged network intended for VM-to-VM communication. The pre-provision of a Linux bridge in all compute nodes is described in Compute node configuration#pre-provision-of-linux-bridges. By creating this network, VMs will be able to connect to the Linux bridge "virbrMan1" in the same host where they are deployed. In that way, two VMs connected to "virbrMan1", no matter the host, will be able to talk each other.
    • data_net -> external data network intended for VM-to-VM communication. The pre-provision of this network in the external switch is described in NFV datacenter. By creating this network, VMs will be able to connect to a network element connected behind a physical port in the external switch.

    In order to create external networks, use 'openvim net-create', specifying a file with the network information. Now we will create the 4 networks:

       ./openvim net-create test/networks/net-example0.yaml
       ./openvim net-create test/networks/net-example1.yaml
       ./openvim net-create test/networks/net-example2.yaml
       ./openvim net-create test/networks/net-example3.yaml
    
  • Let's list the external networks:

       ./openvim net-list
       2c386a58-e2b5-11e4-a3c9-52540032c4fa   data_net
       35671f9e-e2b4-11e4-a3c9-52540032c4fa   default
       79769aa2-e2b4-11e4-a3c9-52540032c4fa   macvtap:em1
       8f597eb6-e2b4-11e4-a3c9-52540032c4fa   bridge_net
    

    You can build your own networks using the template 'templates/network.yaml'. Alternatively, you can use 'openvim net-create' without a file and answer the questions:

    ./openvim net-create
    

    You can delete a network, e.g. "macvtap:em1", using the command:

    ./openvim net-delete macvtap:em1
    
  • Now let's create a new tenant "admin":

      $ openvim tenant-create
      tenant name? admin
      tenant description (admin)?
      <uuid>   admin   Created
    
  • Take the uuid of the tenant and update the environment variables associated to the openvim tenant:

      export OPENVIM_TENANT=<obtained uuid>
      #echo "export OPENVIM_TENANT=<obtained uuid>" >> /home/${USER}/.bashrc
      openvim config                             #show openvim env variables
    

##openmano##

  • Let's configure the openmano CLI client. This is only necessary if you have changed the file 'openmanod.cfg'

    • List the environment variables

        ./openmano config                      #show openmano env variables
      
    • Update the environment variables accordingly:

        export OPENMANO_HOST=<http_host of openmanod.cfg>
        export OPENMANO_PORT=<http_port of openmanod.cfg>
        ./openmano config                      #show openmano env variables
      
  • Let's create a new tenant:

      ./openmano tenant-create mytenant --description=tenant-description
      ./openmano tenant-list                           #show list of tenants uuid and name
    
  • Take the uuid and update the environment variable associated to the openmano tenant:

      export OPENMANO_TENANT=<obtained uuid> 
      ./openmano config                                #show openmano env variables
    
  • Let's create a new datacenter 'mydc' in openmano, attach the datacenter 'mydc' and VIM tenant "admin" (identified by its uuid provided by openvim), and update the external nets automatically from the ones in openvim.

      ./openmano datacenter-create mydc http://localhost:9080/openvim
      ./openmano datacenter-list --all                           #show all datacenters
      ./openmano datacenter-attach mydc --vim-tenant-id <uuid>   #attach the datacenter mydc and openvim tenant id to the openmano tenant 'mytenant'
      ./openmano datacenter-list                                 #show datacenters associated to our tenant
      ./openmano datacenter-net-update mydc
       Edit datacenter mydc (y/N)? y
      2c386a58-e2b5-11e4-a3c9-52540032c4fa   data_net
      35671f9e-e2b4-11e4-a3c9-52540032c4fa   default
      8f597eb6-e2b4-11e4-a3c9-52540032c4fa   bridge_net
    
      ./openmano datacenter-net-list mydc
      2c386a58-e2b5-11e4-a3c9-52540032c4fa   data_net             2015-04-14T17:36:32
      35671f9e-e2b4-11e4-a3c9-52540032c4fa   default              2015-04-14T17:36:32
      8f597eb6-e2b4-11e4-a3c9-52540032c4fa   bridge_net           2015-04-14T17:36:32
    
  • Let's create some VNFs using the examples of VNF descriptors provided with the code:

      ./openmano vnf-create vnfs/examples/linux.yaml
      ./openmano vnf-create vnfs/examples/dataplaneVNF1.yaml
      ./openmano vnf-create vnfs/examples/dataplaneVNF2.yaml
      ./openmano vnf-list                        #-v,-vv,-vvv for verbosity levels
    

    You can see the internal structure of the previous VNFs in the following figures:

  • Let's create some scenarios using the examples provided with the code

      ./openmano scenario-create ./scenarios/examples/simple.yaml
      ./openmano scenario-create ./scenarios/examples/complex.yaml
      ./openmano scenario-list                   #-v,-vv,-vvv for verbosity levels
    

    You can see the internal structure of the previous Network Scenarios in the following figures:

  • Let's deploy the scenarios. Scenario instances will be created.

      ./openmano scenario-deploy simple simple-instance
      ./openmano scenario-deploy complex complex-instance
      ./openmano instance-scenario-list          #-v,-vv,-vvv for verbosity levels
    

You can create your own VNFs and Network Scenarios using these templates (VNFD templates, NSD templates), and following these guidelines.

##openmano-gui##

First, edit and configure the ./openmano-gui/config.php file. It is needed to get the tenant added at openmano in the previous step and set the $mano_tenant variable properly. In case of using a different configuration than the explained above, it is needed to modify other variables.

openmano-gui is accesible with url http://server/openmano. It contain three main modules:

  • Scenarios. Left side: scenario and instance scenario list. Right side: scenario/instance details of the left side selected element. The upper button allows:
    • New: To create a new scenario dragging and drop the left VNF/nets catalogue. You can connect the VNF interfaces among them with the mouse. Do not forget to save.
    • Action over the left side selected scenario, as Save its topology changes, Deploy it, Clone in order to create a new one using the current scenario as starting point, Delete, ...
    • Action over left side selected instance-scenario, as Update to see the current status of running VNFs, Delete to undeploy the instance, Start, Shutdown, Force off, Reboot, Rebuild over selected VNFs or/and VMs of the instance, ...
  • VNFs. Left side: list of VNF and external nets. Right side: under construction
  • Physical. Left side: list of openvim compute nodes and deployed virtual machines. Right side: under construction

#Additional documentation