summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2019-06-27 12:52:11 +0200
committerLuc Provoost <luc.provoost@intel.com>2019-06-28 16:50:11 +0200
commit080733bfa5facd0eb457fc3db1c3ee7885f2a438 (patch)
tree61a65d0526103bf2428656562a3e295d8a5abeb3 /VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh
parentc8e9e6bb696363a397b2e718eb4d3e5f38a8ef22 (diff)
Change of openstackrapid directory name
The scripts are orrignally written to support an OpenStack deployment. We are now making changes to support container environments, hence renaming the directory to rapid. Change-Id: Icaa2fad83c6da451eee733934151e98e9cd07de4 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh')
-rwxr-xr-xVNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh b/VNFs/DPPD-PROX/helper-scripts/rapid/check_prox_system_setup.sh
new file mode 100755
index 00000000..48999510
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/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