aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/vTC/apexlake/tests/data/generated_templates/experiment_1.yaml
blob: 5788980b0ebce2ba9532bd091f8710714f289abe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
heat_template_version: 2014-10-16
description: HOT template to create a DPI

parameters:
   default_net:
      type: string
   default_subnet:
      type: string
   source_net:
      type: string
   source_subnet:
      type: string
   destination_net:
      type: string
   destination_subnet:
      type: string
   internal_net:
      type: string
   internal_subnet:
      type: string
   node:
      type: string
      default: compB
   name:
      type: string
      default: vtc
   ip_family:
      type: string
   timeout:
      type: number
      description: Timeout for WaitCondition, depends on your image and environment
      default: 1000

resources:
   wait_condition:
      type: OS::Heat::WaitCondition
      properties:
         handle: {get_resource: wait_handle}
         count: 1
         timeout: {get_param: timeout}

   wait_handle:
      type: OS::Heat::WaitConditionHandle


   ### DEFAULT NETWORK FOR MERLIN DATA
   port_1:
      type: OS::Neutron::Port
      properties:
         network: { get_param: default_net }
         binding:vnic_type: normal
         fixed_ips:
            - subnet: { get_param: default_subnet }

   ### NETWORK FOR RECEIVING TRAFFIC
   port_2:
      type: OS::Neutron::Port
      properties:
         network: { get_param: source_net }
         binding:vnic_type: normal
         fixed_ips:
            - subnet: { get_param: source_subnet }

   ### NETWORK FOR SENDING TRAFFIC
   port_3:
      type: OS::Neutron::Port
      properties:
         network: { get_param: destination_net }
         binding:vnic_type: normal
         fixed_ips:
            - subnet: { get_param: destination_subnet }

   flavor:
      type: OS::Nova::Flavor
      properties:
         disk: 20
         ram: 1024
         vcpus: 2
         #extra_specs: { node: { get_param: node }, "hw:cpu_policy": "#core_pinning_enabled", "hw:cpu_threads_policy": "#core_pinning_mode", "hw:mem_page_size": "#hugepages" }
         extra_specs: { node: { get_param: node } }

   server:
      type: OS::Nova::Server
      properties:
         name: vTC
         key_name: test
         image: ubuntu1404
         user_data:
                str_replace:
                    template: |
                        #!/bin/sh

                        # Creation of a user
                        NAME=$name
                        echo "Creating custom user..."
                        useradd clouduser -g admin -s /bin/bash -m
                        echo clouduser:secrete | chpasswd
                        echo "Enabling ssh password login..."
                        sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
                        service ssh restart
                        sleep 1

                        # wake up interfaces
                        ifconfig eth1 up
                        ifconfig eth2 up
                        dhclient eth1
                        dhclient eth2

                        sed -i 's/localhost/localhost vtc/g' /etc/hosts
                        ip route del 0/0
                        route add default gw 192.168.200.1

                        AA=$(netstat -ie | grep -B1 $IP_FAMILY | awk '{ print $1 }')
                        BB=$(echo $AA | awk '{ print $1 }')

                        # Setup Instrumentation Agent
                        rm -rf cimmaron
                        mkdir cimmaron
                        cd cimmaron
                        apt-get install -y zip
                        wget http://10.2.1.65/~iolie/merlin/MerlinAgent-12-06-2015-TNovaVM-001.zip
                        unzip MerlinAgent-12-06-2015-TNovaVM-001.zip
                        ./updateConfiguration.py ./instrumentation.cfg tags source=tnova_vm
                        ./updateConfiguration.py ./instrumentation.cfg tags role="$NAME"
                        nohup ./Agent.py ./instrumentation.cfg >log.out 2>&1 &
                        cd ..

                        # Setup for PF_RING and bridge between interfaces
                        apt-get update
                        apt-get install -y git build-essential gcc libnuma-dev flex byacc libjson0-dev dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config

                        # Setup multicast
                        echo smcroute -d mgroup from $BB group 224.192.16.1 > /etc/smcroute.conf
                        cd /home/clouduser/
                        git clone https://github.com/troglobit/smcroute.git
                        cd smcroute
                        sed -i 's/aclocal-1.11/aclocal/g' ./autogen.sh
                        sed -i 's/automake-1.11/automake/g' ./autogen.sh
                        ./autogen.sh
                        ./configure
                        make
                        make install
                        cd ..
                        touch multicast.sh
                        echo "#!/bin/bash" > multicast.sh
                        echo "while [ true ]" >> multicast.sh
                        echo "do" >> multicast.sh
                        echo "  smcroute -k" >> multicast.sh
                        echo "  smcroute -d" >> multicast.sh
                        echo "  sleep 50" >> multicast.sh
                        echo "done" >> multicast.sh
                        chmod +x multicast.sh
                        ./multicast.sh &

                        # Setup for PF_RING and bridge between interfaces
                        # Akis Repository
                        #git clone https://akiskourtis:ptindpi@bitbucket.org/akiskourtis/vtc.git
                        #cd vtc
                        #git checkout stable

                        # Intel Repository
                        git clone http://vincenzox.m.riccobene%40intel.com:vincenzo@134.191.243.6:8081/t-nova/vtc_master.git
                        cd vtc_master

                        cd nDPI
                        NDPI_DIR=$(pwd)
                        echo $NDPI_DIR
                        NDPI_INCLUDE=$(pwd)/src/include
                        echo $NDPI_INCLUDE
                        ./autogen.sh
                        ./configure
                        make
                        make install
                        cd ..
                        cd PF_RING
                        make
                        cd userland/examples/
                        sed -i 's/EXTRA_LIBS =/EXTRA_LIBS = '"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c/g' ./Makefile
                        sed -i 's/ -Ithird-party/ -Ithird-party -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'/g' ./Makefile
                        make
                        cd ../..
                        cd ..
                        cd ..
                        #insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0
                        #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
                        insmod ./vtc_master/PF_RING/kernel/pf_ring.ko min_num_slots=8192 enable_debug=1 quick_mode=1 enable_tx_capture=0
                        ./vtc_master/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
                        wc_notify --data-binary '{"status": "SUCCESS"}'
                    params:
                        wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
                        $name: { get_param: name }
                        $IP_FAMILY: { get_param: ip_family }

         flavor: { get_resource: flavor }
         networks:
            - port: { get_resource: port_1 }
            - port: { get_resource: port_2 }
            - port: { get_resource: port_3 }
outputs: