diff options
author | 2018-06-15 22:39:28 +0200 | |
---|---|---|
committer | 2018-06-17 12:50:56 +0000 | |
commit | 56d346c9b5faf21654b1a72eca53389c9dbd8add (patch) | |
tree | 3e33cb27be59011dbf8ac480f85c6220e0e475be /VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh | |
parent | ca5ac3a8b9b3c148ce783749c0243da3ecbdfe98 (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-x | VNFs/DPPD-PROX/helper-scripts/openstackrapid/check_prox_system_setup.sh | 51 |
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 |