1 heat_template_version: 2014-10-16
2 description: HOT template to create a DPI
31 description: Timeout for WaitCondition, depends on your image and environment
36 type: OS::Heat::WaitCondition
38 handle: {get_resource: wait_handle}
40 timeout: {get_param: timeout}
43 type: OS::Heat::WaitConditionHandle
46 ### DEFAULT NETWORK FOR MERLIN DATA
48 type: OS::Neutron::Port
50 network: { get_param: default_net }
51 binding:vnic_type: normal
53 - subnet: { get_param: default_subnet }
55 ### NETWORK FOR RECEIVING TRAFFIC
57 type: OS::Neutron::Port
59 network: { get_param: source_net }
60 binding:vnic_type: #vnic_type
62 - subnet: { get_param: source_subnet }
64 ### NETWORK FOR SENDING TRAFFIC
66 type: OS::Neutron::Port
68 network: { get_param: destination_net }
69 binding:vnic_type: #vnic_type
71 - subnet: { get_param: destination_subnet }
74 type: OS::Nova::Flavor
79 #extra_specs: { node: { get_param: node }, "hw:cpu_policy": "#core_pinning_enabled", "hw:cpu_threads_policy": "#core_pinning_mode", "hw:mem_page_size": "#hugepages" }
80 extra_specs: { node: { get_param: node } }
83 type: OS::Nova::Server
95 echo "Creating custom user..."
96 useradd clouduser -g admin -s /bin/bash -m
97 echo clouduser:secrete | chpasswd
98 echo "Enabling ssh password login..."
99 sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
109 sed -i 's/localhost/localhost vtc/g' /etc/hosts
111 route add default gw 192.168.200.1
113 AA=$(netstat -ie | grep -B1 $IP_FAMILY | awk '{ print $1 }')
114 BB=$(echo $AA | awk '{ print $1 }')
116 # Setup Instrumentation Agent
120 apt-get install -y zip
121 wget http://10.2.1.65/~iolie/merlin/MerlinAgent-12-06-2015-TNovaVM-001.zip
122 unzip MerlinAgent-12-06-2015-TNovaVM-001.zip
123 ./updateConfiguration.py ./instrumentation.cfg tags source=tnova_vm
124 ./updateConfiguration.py ./instrumentation.cfg tags role="$NAME"
125 nohup ./Agent.py ./instrumentation.cfg >log.out 2>&1 &
128 # Setup for PF_RING and bridge between interfaces
130 apt-get install -y git build-essential gcc libnuma-dev flex byacc libjson0-dev dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config
133 echo smcroute -d mgroup from $BB group 224.192.16.1 > /etc/smcroute.conf
135 git clone https://github.com/troglobit/smcroute.git
137 sed -i 's/aclocal-1.11/aclocal/g' ./autogen.sh
138 sed -i 's/automake-1.11/automake/g' ./autogen.sh
145 echo "#!/bin/bash" > multicast.sh
146 echo "while [ true ]" >> multicast.sh
147 echo "do" >> multicast.sh
148 echo " smcroute -k" >> multicast.sh
149 echo " smcroute -d" >> multicast.sh
150 echo " sleep 50" >> multicast.sh
151 echo "done" >> multicast.sh
152 chmod +x multicast.sh
155 # Setup for PF_RING and bridge between interfaces
157 #git clone https://akiskourtis:ptindpi@bitbucket.org/akiskourtis/vtc.git
162 git clone http://vincenzox.m.riccobene%40intel.com:vincenzo@134.191.243.6:8081/t-nova/vtc_master.git
168 NDPI_INCLUDE=$(pwd)/src/include
177 cd userland/examples/
178 sed -i 's/EXTRA_LIBS =/EXTRA_LIBS = '"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c/g' ./Makefile
179 sed -i 's/ -Ithird-party/ -Ithird-party -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'/g' ./Makefile
184 #insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0
185 #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
186 insmod ./vtc_master/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0
187 ./vtc_master/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
188 wc_notify --data-binary '{"status": "SUCCESS"}'
190 wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
191 $name: { get_param: name }
192 $IP_FAMILY: { get_param: ip_family }
194 flavor: { get_resource: flavor }
196 - port: { get_resource: port_1 }
197 - port: { get_resource: port_2 }
198 - port: { get_resource: port_3 }