aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbenchvm
diff options
context:
space:
mode:
authorfmenguy <francoisregis.menguy@orange.com>2021-06-04 14:34:49 +0200
committerfmenguy <francoisregis.menguy@orange.com>2021-06-04 14:37:27 +0200
commitd1f41687819af6a6f1254b8f2d3ecdd428a0c2fd (patch)
tree60ee8adb609d2e37cfdacfaa51a92f2f5b31d770 /nfvbenchvm
parent1ab93ad2bba7ca570d72c4823321169b9f235cf8 (diff)
NFVBENCH-213 Add clouds.yaml management in generator VM
Change-Id: Ia741847f886a291f0b0d7276e36d5c18f7819185 Signed-off-by: fmenguy <francoisregis.menguy@orange.com>
Diffstat (limited to 'nfvbenchvm')
-rw-r--r--nfvbenchvm/README.rst26
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator9
-rw-r--r--nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/configure-nfvbench.sh23
3 files changed, 37 insertions, 21 deletions
diff --git a/nfvbenchvm/README.rst b/nfvbenchvm/README.rst
index 0274c75..dad9f46 100644
--- a/nfvbenchvm/README.rst
+++ b/nfvbenchvm/README.rst
@@ -95,6 +95,29 @@ Hardcoded Username and Password
GENERATOR IMAGE INSTANCE AND CONFIG
===================================
+Pre-requisites
+--------------
+To use openstack APIs, NFVbench generator VM will use `clouds.yaml` file as openstack configuration.
+The OpenStack clouds configuration from clouds.yaml file to use.
+clouds.yaml file must be in one of the following paths:
+- ~/.config/openstack
+- /etc/openstack
+
+Example of `clouds.yaml`:
+
+.. code-block:: yaml
+
+ clouds:
+ devstack:
+ auth:
+ auth_url: http://192.168.122.10:35357/
+ project_name: demo
+ username: demo
+ password: 0penstack
+ region_name: RegionOne
+
+.. note:: Add `CLOUD_DETAIL` property with the accurate value for your openstack configuration (`devstack` in the above example) in ``/etc/nfvbenchvm.conf``
+
Interface Requirements
----------------------
The instance must be launched using OpenStack with 2 network interfaces for dataplane traffic (using SR-IOV function) and 1 management interface to control nfvbench.
@@ -135,6 +158,7 @@ Template of a genarator profile using CPU pinning:
pci: "{{PCI_ADDRESS_2}}"
switch:
intf_speed:
+
.. note:: `CORE_THREADS` value is determined automatically based on the cores available on the VM starting from 2 to last worker core available.
Auto-configuration
@@ -155,6 +179,7 @@ Example of configuration:
LOOPBACK_INTF_MAC2=FA:16:3E:10:DA:10
E2E_INTF_MAC1=FA:16:3E:B0:E2:43
E2E_INTF_MAC2=FA:16:3E:D3:6A:FC
+
.. note:: `ACTION` parameter is not mandatory but will permit to start NFVbench with the accurate ports (loopback or e2e).
.. note:: Set of MAC parameters cannot be used in parallel as only one NFVbench/TRex process is running.
.. note:: Switching from `loopback` to `e2e` action can be done manually using `/nfvbench/start-nfvbench.sh <action>` with the accurate keyword for `action` parameter. This script will restart NFVbench with the good set of MAC.
@@ -185,6 +210,7 @@ Using pre-created direct-physical ports on openstack, mac addresses value are on
INTF_MGMT_CIDR=172.20.56.228/2
INTF_MGMT_IP_GW=172.20.56.225
DNS_SERVERS=8.8.8.8,dns.server.com
+
.. note:: A management interface is required to automatically find the virtual interface to use according to the MAC address provided (see `INTF_MAC_MGMT` parameter).
.. note:: NFVbench VM will call openstack API through the management interface to retrieve mac address for these ports
.. note:: If openstack API required a host name resolution, add the parameter DNS_SERVERS to add IP or DNS server names (multiple servers can be added separated by a `,`)
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator
index 0746fd6..633403c 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/etc/rc.d/rc.local.generator
@@ -4,7 +4,6 @@ touch /var/lock/subsys/local
# Waiting for cloud-init to generate $NFVBENCH_CONF, retry 60 seconds
NFVBENCH_CONF=/etc/nfvbenchvm.conf
-OPENRC=/etc/nfvbench/openrc
retry=30
until [ $retry -eq 0 ]; do
if [ -f $NFVBENCH_CONF ]; then break; fi
@@ -20,10 +19,6 @@ echo "Generating configurations for NFVbench and TRex..."
eval $(cat $NFVBENCH_CONF)
touch /nfvbench_configured.flag
-if [ -f $OPENRC ]; then
- source $OPENRC
-fi
-
# Add DNS entry
if [ $DNS_SERVERS ]; then
IFS="," read -a dns <<< $DNS_SERVERS
@@ -80,8 +75,8 @@ get_eth_port() {
if [ $INTF_MGMT_CIDR ] && [ $INTF_MGMT_IP_GW ]; then
if [ $INTF_MAC_MGMT ]; then
ETH_PORT=$(get_eth_port $INTF_MAC_MGMT)
- elif [ -f $OPENRC ] && [ "$PORT_MGMT_NAME" ]; then
- $INTF_MAC_MGMT=$(openstack port list | grep $PORT_MGMT_NAME | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ elif [ "$CLOUD_DETAIL" ] && [ "$PORT_MGMT_NAME" ]; then
+ $INTF_MAC_MGMT=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $PORT_MGMT_NAME | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
ETH_PORT=$(get_eth_port $INTF_MAC_MGMT)
else
ETH_PORT=""
diff --git a/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/configure-nfvbench.sh b/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/configure-nfvbench.sh
index 5ec584b..3bf1d8d 100644
--- a/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/configure-nfvbench.sh
+++ b/nfvbenchvm/dib/elements/nfvbenchvm/static/nfvbench/configure-nfvbench.sh
@@ -6,15 +6,10 @@ NFVBENCH_CONF=/etc/nfvbenchvm.conf
E2E_CFG=/etc/nfvbench/e2e.cfg
LOOPBACK_CFG=/etc/nfvbench/loopback.cfg
NFVBENCH_CFG=/etc/nfvbench/nfvbench.cfg
-OPENRC=/etc/nfvbench/openrc
# Parse and obtain all configurations
eval $(cat $NFVBENCH_CONF)
-if [ -f $OPENRC ]; then
- source $OPENRC
-fi
-
# WE assume there are at least 2 cores available for the VM
CPU_CORES=$(grep -c ^processor /proc/cpuinfo)
@@ -88,21 +83,21 @@ get_interfaces_mac_values(){
# Set dynamically interfaces mac values, if VM is spawn with SRIOV PF ports
# and openstack API are accessible
if [ -z "$LOOPBACK_INTF_MAC1" ] && [ -z "$LOOPBACK_INTF_MAC2" ]; then
- if [ -f $OPENRC ] && [ "$LOOPBACK_PORT_NAME1" ] && [ "$LOOPBACK_PORT_NAME2" ]; then
- LOOPBACK_INTF_MAC1=$(openstack port list | grep $LOOPBACK_PORT_NAME1 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
- LOOPBACK_INTF_MAC2=$(openstack port list | grep $LOOPBACK_PORT_NAME2 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ if [ "$CLOUD_DETAIL" ] && [ "$LOOPBACK_PORT_NAME1" ] && [ "$LOOPBACK_PORT_NAME2" ]; then
+ LOOPBACK_INTF_MAC1=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $LOOPBACK_PORT_NAME1 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ LOOPBACK_INTF_MAC2=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $LOOPBACK_PORT_NAME2 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
fi
fi
if [ -z "$E2E_INTF_MAC1" ] && [ -z "$E2E_INTF_MAC2" ]; then
- if [ -f $OPENRC ] && [ "$E2E_PORT_NAME1" ] && [ "$E2E_PORT_NAME2" ]; then
- E2E_INTF_MAC1=$(openstack port list | grep $E2E_PORT_NAME1 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
- E2E_INTF_MAC2=$(openstack port list | grep $E2E_PORT_NAME2 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ if [ "$CLOUD_DETAIL" ] && [ "$E2E_PORT_NAME1" ] && [ "$E2E_PORT_NAME2" ]; then
+ E2E_INTF_MAC1=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $E2E_PORT_NAME1 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ E2E_INTF_MAC2=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $E2E_PORT_NAME2 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
fi
fi
if [ -z "$INTF_MAC1" ] && [ -z "$INTF_MAC2" ]; then
- if [ -f $OPENRC ] && [ "$PORT_NAME1" ] && [ "$PORT_NAME2" ]; then
- INTF_MAC1=$(openstack port list | grep $PORT_NAME1 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
- INTF_MAC2=$(openstack port list | grep $PORT_NAME2 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ if [ "$CLOUD_DETAIL" ] && [ "$PORT_NAME1" ] && [ "$PORT_NAME2" ]; then
+ INTF_MAC1=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $PORT_NAME1 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
+ INTF_MAC2=$(openstack --os-cloud $CLOUD_DETAIL port list | grep $PORT_NAME2 | grep -o -Ei '([a-fA-F0-9:]{17}|[a-fA-F0-9]{12}$)' | head -1)
fi
fi
}