summaryrefslogtreecommitdiffstats
path: root/tools/ubuntu-server-cloudimg-dpdk-modify.sh
diff options
context:
space:
mode:
authorwu.zhihui <wu.zhihui1@zte.com.cn>2016-08-04 10:11:16 +0800
committerwu.zhihui <wu.zhihui1@zte.com.cn>2016-08-04 15:18:12 +0800
commit199dcdbcaa84a39c60f0f95bbcf687b537e7056a (patch)
tree585f8abdb2303aa1badf5469a49e9118a1e93f8e /tools/ubuntu-server-cloudimg-dpdk-modify.sh
parent248836fe41a16a705752c6f84553d1026a67c806 (diff)
[Yardstick-233]DPDK image for TC042
These file is based on Akos's code. (https://gerrit.opnfv.org/gerrit/#/c/16095/) The different places: 1. create flavor and import yardstick_key.pub with heat template. 2. remove handle code about eth0 in user_data. 3. update heat cli and delete step "nova stop" which is not necessary. 4. clean the stack in final. 5. add eth2 for vm. JIRA: YARDSTICK-233 Change-Id: I04f2051fb4bcfeed2df4868d758fd92011c62233 Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'tools/ubuntu-server-cloudimg-dpdk-modify.sh')
-rwxr-xr-xtools/ubuntu-server-cloudimg-dpdk-modify.sh98
1 files changed, 98 insertions, 0 deletions
diff --git a/tools/ubuntu-server-cloudimg-dpdk-modify.sh b/tools/ubuntu-server-cloudimg-dpdk-modify.sh
new file mode 100755
index 000000000..edcbeb61a
--- /dev/null
+++ b/tools/ubuntu-server-cloudimg-dpdk-modify.sh
@@ -0,0 +1,98 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# installs required packages
+# must be run from inside the image (either chrooted or running)
+
+set -ex
+
+if [ $# -eq 1 ]; then
+ nameserver_ip=$1
+
+ # /etc/resolv.conf is a symbolic link to /run, restore at end
+ rm /etc/resolv.conf
+ echo "nameserver $nameserver_ip" > /etc/resolv.conf
+ echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+ echo "nameserver 8.8.4.4" >> /etc/resolv.conf
+fi
+
+# iperf3 only available for wily in backports
+grep wily /etc/apt/sources.list && \
+ echo "deb http://archive.ubuntu.com/ubuntu/ wily-backports main restricted universe multiverse" >> /etc/apt/sources.list
+
+# Workaround for building on CentOS (apt-get is not working with http sources)
+# sed -i 's/http/ftp/' /etc/apt/sources.list
+
+# Force apt to use ipv4 due to build problems on LF POD.
+echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
+
+echo 'GRUB_CMDLINE_LINUX="resume=/dev/sda1 default_hugepagesz=1G hugepagesz=1G hugepages=1 iommu=on iommu=pt intel_iommu=on"' >> /etc/default/grub
+echo 'vm.nr_hugepages=512' >> /etc/sysctl.conf
+echo 'huge /mnt/huge hugetlbfs defaults 0 0' >> vi /etc/fstab
+
+mkdir /mnt/huge
+chmod 777 /mnt/huge
+
+for i in {1..2}
+do
+ touch /etc/network/interfaces.d/eth$i.cfg
+ chmod 777 /etc/network/interfaces.d/eth$i.cfg
+ echo "auto eth$i" >> /etc/network/interfaces.d/eth$i.cfg
+ echo "iface eth$i inet dhcp" >> /etc/network/interfaces.d/eth$i.cfg
+done
+
+# this needs for checking dpdk status, adding interfaces to dpdk, bind, unbind etc..
+
+# Add hostname to /etc/hosts.
+# Allow console access via pwd
+cat <<EOF >/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg
+manage_etc_hosts: True
+password: RANDOM
+chpasswd: { expire: False }
+ssh_pwauth: True
+EOF
+
+linuxheadersversion=`echo ls boot/vmlinuz* | cut -d- -f2-`
+
+apt-get update
+apt-get install -y \
+ fio \
+ gcc \
+ git \
+ iperf3 \
+ linux-tools-common \
+ linux-tools-generic \
+ lmbench \
+ make \
+ netperf \
+ patch \
+ perl \
+ rt-tests \
+ stress \
+ sysstat \
+ linux-headers-$linuxheadersversion \
+ libpcap-dev \
+ lua5.2
+
+git clone http://dpdk.org/git/dpdk
+git clone http://dpdk.org/git/apps/pktgen-dpdk
+
+git clone https://github.com/kdlucas/byte-unixbench.git /opt/tempT
+make --directory /opt/tempT/UnixBench/
+
+git clone https://github.com/beefyamoeba5/ramspeed.git /opt/tempT/RAMspeed
+cd /opt/tempT/RAMspeed/ramspeed-2.6.0
+mkdir temp
+bash build.sh
+
+git clone https://github.com/beefyamoeba5/cachestat.git /opt/tempT/Cachestat
+
+# restore symlink
+ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf