1 # Copyright (c) 2016-2017 Intel Corporation
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 heat_template_version: 2014-10-16
15 description: HOT template to create a DPI
44 description: Timeout for WaitCondition, depends on your image and environment
49 type: OS::Heat::WaitCondition
51 handle: {get_resource: wait_handle}
53 timeout: {get_param: timeout}
56 type: OS::Heat::WaitConditionHandle
59 ### DEFAULT NETWORK FOR MERLIN DATA
61 type: OS::Neutron::Port
63 network: { get_param: default_net }
64 binding:vnic_type: normal
66 - subnet: { get_param: default_subnet }
68 ### NETWORK FOR RECEIVING TRAFFIC
70 type: OS::Neutron::Port
72 network: { get_param: source_net }
73 binding:vnic_type: direct
75 - subnet: { get_param: source_subnet }
77 ### NETWORK FOR SENDING TRAFFIC
79 type: OS::Neutron::Port
81 network: { get_param: destination_net }
82 binding:vnic_type: direct
84 - subnet: { get_param: destination_subnet }
87 type: OS::Nova::Flavor
92 #extra_specs: { node: { get_param: node }, "hw:cpu_policy": "#core_pinning_enabled", "hw:cpu_threads_policy": "#core_pinning_mode", "hw:mem_page_size": "#hugepages" }
93 extra_specs: { node: { get_param: node } }
96 type: OS::Nova::Server
108 echo "Creating custom user..."
109 useradd clouduser -g admin -s /bin/bash -m
110 echo clouduser:secrete | chpasswd
111 echo "Enabling ssh password login..."
112 sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
122 sed -i 's/localhost/localhost vtc/g' /etc/hosts
124 route add default gw 192.168.200.1
126 AA=$(netstat -ie | grep -B1 $IP_FAMILY | awk '{ print $1 }')
127 BB=$(echo $AA | awk '{ print $1 }')
129 # Setup Instrumentation Agent
133 apt-get install -y zip
134 wget http://10.2.1.65/~iolie/merlin/MerlinAgent-12-06-2015-TNovaVM-001.zip
135 unzip MerlinAgent-12-06-2015-TNovaVM-001.zip
136 ./updateConfiguration.py ./instrumentation.cfg tags source=tnova_vm
137 ./updateConfiguration.py ./instrumentation.cfg tags role="$NAME"
138 nohup ./Agent.py ./instrumentation.cfg >log.out 2>&1 &
141 # Setup for PF_RING and bridge between interfaces
143 apt-get install -y git build-essential gcc libnuma-dev flex byacc libjson0-dev dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config
146 echo smcroute -d mgroup from $BB group 224.192.16.1 > /etc/smcroute.conf
148 git clone https://github.com/troglobit/smcroute.git
150 sed -i 's/aclocal-1.11/aclocal/g' ./autogen.sh
151 sed -i 's/automake-1.11/automake/g' ./autogen.sh
158 echo "#!/bin/bash" > multicast.sh
159 echo "while [ true ]" >> multicast.sh
160 echo "do" >> multicast.sh
161 echo " smcroute -k" >> multicast.sh
162 echo " smcroute -d" >> multicast.sh
163 echo " sleep 50" >> multicast.sh
164 echo "done" >> multicast.sh
165 chmod +x multicast.sh
168 # Setup for PF_RING and bridge between interfaces
170 #git clone https://akiskourtis:ptindpi@bitbucket.org/akiskourtis/vtc.git
175 git clone http://vincenzox.m.riccobene%40intel.com:vincenzo@134.191.243.6:8081/t-nova/vtc_master.git
181 NDPI_INCLUDE=$(pwd)/src/include
190 cd userland/examples/
191 sed -i 's/EXTRA_LIBS =/EXTRA_LIBS = '"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c/g' ./Makefile
192 sed -i 's/ -Ithird-party/ -Ithird-party -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'/g' ./Makefile
197 #insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0
198 #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
199 insmod ./vtc_master/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0
200 ./vtc_master/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
201 wc_notify --data-binary '{"status": "SUCCESS"}'
203 wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
204 $name: { get_param: name }
205 $IP_FAMILY: { get_param: ip_family }
207 flavor: { get_resource: flavor }
209 - port: { get_resource: port_1 }
210 - port: { get_resource: port_2 }
211 - port: { get_resource: port_3 }