summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2018-06-15 22:39:28 +0200
committerDeepak S <deepak.s@linux.intel.com>2018-06-29 17:48:09 +0530
commit260bc7b07eb34db5d46abaa4e84ab26c82a0b665 (patch)
treedb3edb6f69c9c87a8c4b1bc31f33bde5372299fc /VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh
parentbc032eefb98358a4741caf732c475258ebbd5850 (diff)
Adding centos.json to be used with packer to generate a VM with PROX
Based on a CentOS cloud image downloadable from the web, you can now use packer to create an image that has DPDK and PROX installed in the proper directories. The VM is also tuned for guest VNFs. A service is also created to deal with the proper isolated_cpu settings for tuned. The service will also make sure uio and igb_uio are loaded. The prox_user_data.sh is not needed any more and hence deleted. ctrl-c of runrapid.py will now also stop prox in all the VMs so a new test can be started. Change-Id: I16cc59878e2d4912757f42e05f98d51dff5feb89 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh')
-rwxr-xr-xVNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh
new file mode 100755
index 00000000..48999510
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+##
+## Copyright (c) 2010-2018 Intel Corporation
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+NCPUS="$(lscpu | egrep '^CPU\(s\):' | awk '{ print $2 }')"
+MAXCOREID="$((NCPUS-1))"
+
+filename="/etc/tuned/realtime-virtual-guest-variables.conf"
+logfile="/home/centos/prox_system_setup.log"
+if [ -f "$filename" ]
+then
+ while read -r line
+ do
+ case $line in
+ isolated_cores=1-$MAXCOREID*)
+ echo "Isolated CPU(s) OK, no reboot: $line">>$logfile
+ modprobe uio
+ insmod /root/dpdk/build/kmod/igb_uio.ko
+ exit 0
+ ;;
+ isolated_cores=*)
+ echo "Isolated CPU(s) NOK, change the config and reboot: $line">>$logfile
+ sed -i "/^isolated_cores=.*/c\isolated_cores=1-$MAXCOREID" $filename
+ tuned-adm profile realtime-virtual-guest
+ reboot
+ exit 0
+ ;;
+ *)
+ echo "$line"
+ ;;
+ esac
+ done < "$filename"
+ echo "isolated_cores=1-$MAXCOREID" >> $filename
+ echo "No Isolated CPU(s) defined in config, line added: $line">>$logfile
+ tuned-adm profile realtime-virtual-guest
+ reboot
+else
+ echo "$filename not found.">>$logfile
+fi