How it works...

If the computer that you run this recipe does not have enough memory, it will produce these following logs during the last few steps:

+ sudo virsh start host4
error: Failed to start domain host4
error: internal error: early end of file from monitor, 
possible problem: 2017-07-18T16:29:50.376832Z
qemu-system-x86_64: cannot set up guest memory
'pc.ram': Cannot allocate memory

This can be confirmed by examining compass4nfv/work/deploy/vm/hostN/libvirt.xml, where N = [1, 6]. You will find the following lines in these files:

<memory unit='MiB'>16384</memory>
<currentMemory unit='MiB'>16384</currentMemory>
  

These lines indicate that 16 GB of memory is required for these virtual machines.

Make sure that both your python and pip commands point to a Python 2 installation. If both Python 2 and Python 3 are installed, it is likely to have pip referring to Python 3 while python referring to Python 2. For example, see the following scenario:

$ pip --version
pip 9.0.1 from /home/pradeeban/.local/lib/python3.5/site-packages (python 3.5)
$ python --version
Python 2.7.12
$ python3 --version
Python 3.5.2
$ pip2 --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

Here it is obvious that the pip and python commands are pointing to two different versions—Python 3 and Python 2. To fix this:

$ sudo python3 -m pip install -U --force-reinstall pip
$ sudo python -m pip install -U --force-reinstall pip
  

The preceding commands will ensure that pip points to pip2, the Python 2 version. You may confirm this by running the command again:

$ pip2 --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$ pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$ pip3 --version
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
  

If you encounter errors such as the following during the installation:

OSError: [Errno 13] Permission denied: '/home/pradeeban/.ansible/tmp/ansible-local-24931HCfLEe'
+ log_error 'launch_compass failed'
+ echo -e 'launch_compass failed'
launch_compass failed
  

check the permissions to confirm that the root folder .ansible can be updated by the current user. If not, change the permissions or delete the folder.

The installation of Python that bundles through pip may fail if the locales are not configured properly. You may confirm this through the following command:

$ pip2 show virtualenv
Traceback (most recent call last):
  File "/usr/bin/pip2", line 9, in <module>
  load_entry_point('pip==8.1.1', 'console_scripts', 'pip2')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", 
line 215, in main
locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python2.7/locale.py", line 581, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

If the output is an error as shown, set the locale through the following commands:

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales

You may of course replace the locale of en_US.UTF-8 with the language and locale of your preference.

If you run out of space during the final stages of configuration by OPNFV Compass, it will fail with a message similar to the following:

changed: [localhost] => (item=compass4nfv/compass-deck) 
failed: [localhost] (item=compass4nfv/compass-tasks-osa) => {"changed": true, "cmd": "docker load -i "/dev/opnfv/compass4nfv/work/deploy/installer/compass_dists/compass-tasks-osa.tar"", "delta": "0:00:14.055573", "end": "2017-07-19 17:19:13.758734", "failed": true, "item": "compass4nfv/compass-tasks-osa", "rc": 1, "start": "2017-07-19 17:18:59.703161", "stderr": "Error processing tar file(exit status 1): write /df21d65fec8fc853792311af3739a78e018b098a5aa3b1f6ff67f44b330423b8/layer.tar: no space left on device", "stderr_lines": ["Error processing tar file(exit status 1): write /df21d65fec8fc853792311af3739a78e018b098a5aa3b1f6ff67f44b330423b8/layer.tar: no space left on device"], "stdout": "", "stdout_lines": []} 

If your computer does not have the memory or disk space to run this recipe, you may run this in an optimized spot instance such as r4.8xlarge in Amazon Elastic Compute Cloud (EC2). Before launching the instance, increase the storage of the default EBS volume from 8 GB to 1000 GB, so that you won't run out of disk space during the installation of OPNFV.

Many Python extensions have been built around OPNFV. One example is the SDNVPN (https://wiki.opnfv.org/display/sdnvpn/SDNVPN+project+main+page) project that seeks to integrate the virtual networking components to provide layer 2/3 virtual private network (VPN) functionalities in OPNFV. You may clone the source code of SDNVPN from the source code repository to build it with Python:

$ git clone https://github.com/opnfv/sdnvpn.git
$ cd sdnvpn/
$ python setup.py build
$ sudo python setup.py install
  

While OPNFV is a complex networking project with clusters of computers involved, we can configure useful and interesting scenarios efficiently using Python on OPNFV.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.36.231