VPP/Configuration Tool

From fd.io
< VPP
Revision as of 19:34, 1 November 2017 by Jdenisco (Talk | contribs)

Jump to: navigation, search

Summary

The purpose of the VPP configuration utility is to allow the user to configure VPP in a simple and safe manner. The utility takes input from the user and then modifies the key configuration files. The user can then examine these files to be sure they are correct and then actually apply the configuration. The utility also includes an installation utility and some basic tests. This utility is currently released with release 17.10.

Use

The installation and executing of the VPP configuration utility is simple. First install the python pip module. Using pip install, then pip install vpp-config. Then simply type vpp-config and answer the questions. If you are not sure what to answer choose the default. For yes or no questions the capital letter designates the default. For example, for a question that shows [Y/n] Y is the default. For numbers the default is within the brackets for example for a question that shows [1024]. 1024 is the default.

Ubuntu Example:

$ sudo -H bash
# apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version (8.1.1-2ubuntu0.4).
# pip install vpp-config
Collecting vpp-config
  Downloading vpp_config-17.10.5-py2.py3-none-any.whl (52kB)
Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/dist-packages (from vpp-config)
Requirement already satisfied: netaddr in /usr/local/lib/python2.7/dist-packages (from vpp-config)
Installing collected packages: vpp-config
Successfully installed vpp-config-17.10.5
# vpp-config

Welcome to the VPP system configuration utility

These are the files we will modify:
    /etc/vpp/startup.conf
    /etc/sysctl.d/80-vpp.conf
    /etc/default/grub

Before we change them, we'll create working copies in /usr/local/vpp/vpp-config/dryrun
Please inspect them carefully before applying the actual configuration (option 3)!

What would you like to do?

1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
       and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit

Command: 

Caveats

This utility has been verified and supports Ubuntu16.04, centos7, RHEL7.

For Developers

Modifying the code is reasonable simple. The process would be edit and debug the code from the root directory. In order to do this, we need a script that will copy or data files to the proper place. This is where they end up with pip install. For Ubuntu, this is /usr/local/vpp/vpp-config. For Centos /usr/vpp/vpp-config. I have provided a script that will copy the relevant files correctly. I have also provided a script that will clean the environment so you can start from scratch. These are the steps to run the utility in this environment. The scripts are meant to be run from the root directory.

 ./scripts/clean.sh
 ./scripts/cp-data.sh 
 ./vpp_config.py 

When the utility is installed with pip the wrapper scripts/vpp-config is written to /usr/local/bin. However, the starting point when debugging this script locally is ./vpp_config.py. Run the utility by executing ./vpp_config.py from the root directory.

The start point in the code is in vpp_config.py. However, most of the work is done in the files in ./vpplib

Uploading to PyPi

To upload this utility to PpPi simple do the following. Currently, I have my own account when we want everyone to contribute we will need to change that.

 $ sudo -H bash
 # cd vpp_config
 # python setup.py sdist bdist_wheel
 # twine upload dist/*

Examples

Typical use example:

Show System Information Example

When the utility is first started we can show the basic system information.

# vpp-config

Welcome to the VPP system configuration utility

These are the files we will modify:
    /etc/vpp/startup.conf
    /etc/sysctl.d/80-vpp.conf
    /etc/default/grub

Before we change them, we'll create working copies in /usr/local/vpp/vpp-config/dryrun
Please inspect them carefully before applying the actual configuration (option 3)!

What would you like to do?

1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
       and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit

Command: 1

==============================
NODE: DUT1

CPU:
          Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz
              CPU(s):    32
  Thread(s) per core:    2
  Core(s) per socket:    8
           Socket(s):    2
   NUMA node0 CPU(s):    0-7,16-23
   NUMA node1 CPU(s):    8-15,24-31
         CPU max MHz:    3600.0000
         CPU min MHz:    1200.0000
                 SMT:    Enabled

VPP Threads: (Name: Cpu Number)

Grub Command Line:
  Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-97-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro
  Configured: GRUB_CMDLINE_LINUX_DEFAULT=""

Huge Pages:
  Total System Memory           : 65863484 kB
  Total Free Memory             : 56862700 kB
  Actual Huge Page Total        : 1024
  Configured Huge Page Total    : 1024
  Huge Pages Free               : 1024
  Huge Page Size                : 2048 kB

Devices:

Devices with link up (can not be used with VPP):
0000:08:00.0    enp8s0f0                  I350 Gigabit Network Connection                   

Devices bound to kernel drivers:
0000:90:00.0    enp144s0                  VIC Ethernet NIC                                  
0000:8f:00.0    enp143s0                  VIC Ethernet NIC                                  
0000:84:00.0    enp132s0f0,enp132s0f0d1   Ethernet Controller XL710 for 40GbE QSFP+         
0000:84:00.1    enp132s0f1,enp132s0f1d1   Ethernet Controller XL710 for 40GbE QSFP+         
0000:08:00.1    enp8s0f1                  I350 Gigabit Network Connection                   
0000:02:00.0    enp2s0f0                  82599ES 10-Gigabit SFI/SFP+ Network Connection    
0000:02:00.1    enp2s0f1                  82599ES 10-Gigabit SFI/SFP+ Network Connection    

No devices bound to DPDK drivers

VPP Service Status:
  Not Installed

==============================

Install VPP

Notice when the basic system information was shown VPP was not installed.

VPP Service Status:
  Not Installed

==============================

We can now install VPP with option 4

What would you like to do?

1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
       and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit

Command: 4

There are no VPP packages on node localhost.
Do you want to install VPP [Y/n]? y
INFO:root: Local Command: ls /etc/apt/sources.list.d/99fd.io.list.orig
INFO:root:  /etc/apt/sources.list.d/99fd.io.list.orig
INFO:root: Local Command: rm /etc/apt/sources.list.d/99fd.io.list
INFO:root: Local Command: echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io.ubuntu.xenial.main/ ./
" | sudo tee /etc/apt/sources.list.d/99fd.io.list
INFO:root:  deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io.ubuntu.xenial.main/ ./
.......

Dry Run