blob: cbf0d4d456025794a516cea8994a171ca1543cc8 [file] [log] [blame]
Jerry Floodc8bd4272017-10-19 13:43:43 -04001##########################################################################
2#
Jerry Floodc8bd4272017-10-19 13:43:43 -04003##########################################################################
4
DR695Hccff30b2017-02-17 18:44:24 -05005heat_template_version: 2013-05-23
6
Jerry Floodc8bd4272017-10-19 13:43:43 -04007description: Heat template to deploy vLoadBalancer/vDNS demo app for ONAP
8
9##############
10# #
11# PARAMETERS #
12# #
13##############
DR695Hccff30b2017-02-17 18:44:24 -050014
15parameters:
16 vlb_image_name:
17 type: string
18 label: Image name or ID
19 description: Image to be used for compute instance
20 vlb_flavor_name:
21 type: string
22 label: Flavor
23 description: Type of instance (flavor) to be used
24 public_net_id:
25 type: string
26 label: Public network name or ID
27 description: Public network that enables remote connection to VNF
28 vlb_private_net_id:
29 type: string
30 label: vLoadBalancer private network name or ID
31 description: Private network that connects vLoadBalancer with vDNSs
Jerry Floodc8bd4272017-10-19 13:43:43 -040032 pktgen_private_net_id:
33 type: string
34 label: vPacketGen private network name or ID
35 description: Private network that connects vLoadBalancer with vPacketGen
36 onap_private_net_id:
DR695Hccff30b2017-02-17 18:44:24 -050037 type: string
38 label: ECOMP management network name or ID
Jerry Floodc8bd4272017-10-19 13:43:43 -040039 description: Private network that connects ONAP component and the VNF
40 onap_private_subnet_id:
DR695Hccff30b2017-02-17 18:44:24 -050041 type: string
42 label: ECOMP management sub-network name or ID
Jerry Floodc8bd4272017-10-19 13:43:43 -040043 description: Private sub-network that connects ONAP component and the VNF
DR695Hccff30b2017-02-17 18:44:24 -050044 vlb_private_net_cidr:
45 type: string
46 label: vLoadBalancer private network CIDR
47 description: The CIDR of the vLoadBalancer private network
Jerry Floodc8bd4272017-10-19 13:43:43 -040048 pktgen_private_net_cidr:
DR695Hccff30b2017-02-17 18:44:24 -050049 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040050 label: vPacketGen private network CIDR
51 description: The CIDR of the vPacketGen private network
52 onap_private_net_cidr:
53 type: string
54 label: ONAP private network CIDR
DR695Hccff30b2017-02-17 18:44:24 -050055 description: The CIDR of the protected private network
56 vlb_private_ip_0:
57 type: string
58 label: vLoadBalancer private IP address towards the private network
59 description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs
60 vlb_private_ip_1:
61 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040062 label: vLoadBalancer private IP address towards the ONAP management network
63 description: Private IP address that is assigned to the vLoadBalancer to communicate with ONAP components
64 vlb_private_ip_2:
65 type: string
66 label: vLoadBalancer private IP address towards the vPacketGen network
67 description: Private IP address that is assigned to the vLoadBalancer to communicate with vPacketGen
DR695Hccff30b2017-02-17 18:44:24 -050068 vdns_private_ip_0:
69 type: string
70 label: vDNS private IP address towards the private network
71 description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer
72 vdns_private_ip_1:
73 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040074 label: vDNS private IP address towards the ONAP management network
75 description: Private IP address that is assigned to the vDNS to communicate with ONAP components
76 vpg_private_ip_0:
77 type: string
78 label: vPacketGen private IP address towards the vPacketGen private network
79 description: Private IP address that is assigned to the vPacketGen to communicate with the vLoadBalancer
80 vpg_private_ip_1:
81 type: string
82 label: vPacketGen private IP address towards the ONAP management network
83 description: Private IP address that is assigned to the vPacketGen to communicate with ONAP components
84 vip:
85 type: string
86 label: Virtual Private IP of the vLoadBalancer
87 description: Virtual Private IP that is assigned to the vLoadBalancer's VPP layer
88 gre_ipaddr:
89 type: string
90 label: IP Address of the GRE tunnel
91 description: IP address assigned to the GRE tunnel on the vLoadBalancer
92 pg_int:
93 type: string
94 label: IP Address of the output vPacketGen interface
95 description: IP address assigned to the output interface of the vPacketGen's VPP layer
DR695Hccff30b2017-02-17 18:44:24 -050096 vlb_name_0:
97 type: string
98 label: vLoadBalancer name
99 description: Name of the vLoadBalancer
100 vdns_name_0:
101 type: string
102 label: vDNS name
103 description: Name of the vDNS
Jerry Floodc8bd4272017-10-19 13:43:43 -0400104 vpg_name_0:
105 type: string
106 label: vPKTGEN name
107 description: Name of the vPKTGEN
DR695Hccff30b2017-02-17 18:44:24 -0500108 vnf_id:
109 type: string
110 label: VNF ID
Jerry Floodc8bd4272017-10-19 13:43:43 -0400111 description: The VNF ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -0500112 vf_module_id:
113 type: string
114 label: vFirewall module ID
Jerry Floodc8bd4272017-10-19 13:43:43 -0400115 description: The vLoadBalancer Module ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -0500116 dcae_collector_ip:
117 type: string
118 label: DCAE collector IP address
119 description: IP address of the DCAE collector
120 dcae_collector_port:
121 type: string
122 label: DCAE collector port
123 description: Port of the DCAE collector
124 key_name:
125 type: string
126 label: Key pair name
127 description: Public/Private key pair name
128 pub_key:
129 type: string
130 label: Public key
131 description: Public key to be installed on the compute instance
jf98609ab26342017-02-28 15:07:36 -0500132 repo_url_blob:
DR695Hccff30b2017-02-17 18:44:24 -0500133 type: string
134 label: Repository URL
135 description: URL of the repository that hosts the demo packages
jf98609ab26342017-02-28 15:07:36 -0500136 repo_url_artifacts:
137 type: string
138 label: Repository URL
139 description: URL of the repository that hosts the demo packages
140 demo_artifacts_version:
141 type: string
142 label: Artifacts version used in demo vnfs
143 description: Artifacts (jar, tar.gz) version used in demo vnfs
Jerry Floodc8bd4272017-10-19 13:43:43 -0400144 install_script_version:
145 type: string
146 label: Installation script version number
147 description: Version number of the scripts that install the vFW demo app
148 cloud_env:
149 type: string
150 label: Cloud environment
151 description: Cloud environment (e.g., openstack, rackspace)
152
153#############
154# #
155# RESOURCES #
156# #
157#############
DR695Hccff30b2017-02-17 18:44:24 -0500158
159resources:
jf98609ab26342017-02-28 15:07:36 -0500160
161 random-str:
162 type: OS::Heat::RandomString
163 properties:
164 length: 4
Jerry Floodc8bd4272017-10-19 13:43:43 -0400165
DR695Hccff30b2017-02-17 18:44:24 -0500166 my_keypair:
167 type: OS::Nova::KeyPair
168 properties:
Jerry Flood1973e2c2017-10-19 18:26:24 -0400169 name:
jf98609ab26342017-02-28 15:07:36 -0500170 str_replace:
171 template: base_rand
172 params:
173 base: { get_param: key_name }
Jerry Flood1973e2c2017-10-19 18:26:24 -0400174 rand: { get_resource: random-str }
DR695Hccff30b2017-02-17 18:44:24 -0500175 public_key: { get_param: pub_key }
176 save_private_key: false
177
178 vlb_private_network:
179 type: OS::Neutron::Net
180 properties:
181 name: { get_param: vlb_private_net_id }
182
183 vlb_private_subnet:
184 type: OS::Neutron::Subnet
185 properties:
186 name: { get_param: vlb_private_net_id }
187 network_id: { get_resource: vlb_private_network }
188 cidr: { get_param: vlb_private_net_cidr }
189
Jerry Floodc8bd4272017-10-19 13:43:43 -0400190 pktgen_private_network:
191 type: OS::Neutron::Net
192 properties:
193 name: { get_param: pktgen_private_net_id }
194
195 pktgen_private_subnet:
196 type: OS::Neutron::Subnet
197 properties:
198 name: { get_param: pktgen_private_net_id }
199 network_id: { get_resource: pktgen_private_network }
200 cidr: { get_param: pktgen_private_net_cidr }
201
202 vlb_private_0_port:
203 type: OS::Neutron::Port
204 properties:
205 network: { get_resource: vlb_private_network }
206 fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vlb_private_ip_0 }}]
207
208 vlb_private_1_port:
209 type: OS::Neutron::Port
210 properties:
211 network: { get_param: onap_private_net_id }
212 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vlb_private_ip_1 }}]
213
214 vlb_private_2_port:
215 type: OS::Neutron::Port
216 properties:
217 network: { get_resource: pktgen_private_network }
218 fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vlb_private_ip_2 }}]
219
DR695Hccff30b2017-02-17 18:44:24 -0500220 vlb_0:
221 type: OS::Nova::Server
222 properties:
223 image: { get_param: vlb_image_name }
224 flavor: { get_param: vlb_flavor_name }
225 name: { get_param: vlb_name_0 }
226 key_name: { get_resource: my_keypair }
227 networks:
228 - network: { get_param: public_net_id }
229 - port: { get_resource: vlb_private_0_port }
230 - port: { get_resource: vlb_private_1_port }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400231 - port: { get_resource: vlb_private_2_port }
DR695Hccff30b2017-02-17 18:44:24 -0500232 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
233 user_data_format: RAW
234 user_data:
235 str_replace:
236 params:
DR695Hccff30b2017-02-17 18:44:24 -0500237 __dcae_collector_ip__: { get_param: dcae_collector_ip }
238 __dcae_collector_port__: { get_param: dcae_collector_port }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400239 __ip_to_dns_net__: { get_param: vlb_private_ip_0 }
240 __ip_to_pktgen_net__: { get_param: vlb_private_ip_2 }
241 __vip__: { get_param: vip }
242 __gre_ipaddr__: { get_param: gre_ipaddr }
243 __pktgen_ipaddr__: { get_param: vpg_private_ip_0 }
244 __oam_private_ipaddr__: { get_param: vlb_private_ip_1 }
245 __repo_url_blob__: { get_param: repo_url_blob }
246 __repo_url_artifacts__: { get_param: repo_url_artifacts }
247 __demo_artifacts_version__: { get_param: demo_artifacts_version }
248 __install_script_version__: { get_param: install_script_version }
249 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
250 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
251 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
252 __pktgen_mac__: { get_attr: [vpg_private_0_port, mac_address] }
253 __cloud_env__: { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500254 template: |
255 #!/bin/bash
256
Jerry Floodc8bd4272017-10-19 13:43:43 -0400257 # Create configuration files
DR695Hccff30b2017-02-17 18:44:24 -0500258 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400259 echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
260 echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
261 echo "__ip_to_dns_net__" > /opt/config/ip_to_dns_net.txt
262 echo "__ip_to_pktgen_net__" > /opt/config/ip_to_pktgen_net.txt
263 echo "__vip__" > /opt/config/vip.txt
264 echo "__gre_ipaddr__" > /opt/config/gre_ipaddr.txt
265 echo "__pktgen_ipaddr__" > /opt/config/pktgen_ipaddr.txt
266 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
267 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
268 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
269 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
270 echo "__install_script_version__" > /opt/config/install_script_version.txt
271 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
272 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
273 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
274 echo "__pktgen_mac__" > /opt/config/pktgen_mac.txt
275 echo "__cloud_env__" > /opt/config/cloud_env.txt
276
277 # Download and run install script
278 curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_lb_install.sh -o /opt/v_lb_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500279 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400280 chmod +x v_lb_install.sh
281 ./v_lb_install.sh
jf98609ab26342017-02-28 15:07:36 -0500282
jf98609ab26342017-02-28 15:07:36 -0500283
Jerry Floodc8bd4272017-10-19 13:43:43 -0400284 vdns_private_0_port:
DR695Hccff30b2017-02-17 18:44:24 -0500285 type: OS::Neutron::Port
286 properties:
287 network: { get_resource: vlb_private_network }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400288 fixed_ips: [{"subnet": { get_resource: vlb_private_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500289
Jerry Floodc8bd4272017-10-19 13:43:43 -0400290 vdns_private_1_port:
DR695Hccff30b2017-02-17 18:44:24 -0500291 type: OS::Neutron::Port
292 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400293 network: { get_param: onap_private_net_id }
294 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500295
296 vdns_0:
297 type: OS::Nova::Server
298 properties:
299 image: { get_param: vlb_image_name }
300 flavor: { get_param: vlb_flavor_name }
301 name: { get_param: vdns_name_0 }
302 key_name: { get_resource: my_keypair }
303 networks:
304 - network: { get_param: public_net_id }
305 - port: { get_resource: vdns_private_0_port }
306 - port: { get_resource: vdns_private_1_port }
307 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
308 user_data_format: RAW
309 user_data:
310 str_replace:
311 params:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400312 __lb_oam_int__: { get_param: vlb_private_ip_1 }
DR695Hccff30b2017-02-17 18:44:24 -0500313 __lb_private_ipaddr__: { get_param: vlb_private_ip_0 }
314 __local_private_ipaddr__: { get_param: vdns_private_ip_0 }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400315 __oam_private_ipaddr__: { get_param: vdns_private_ip_1 }
316 __repo_url_blob__: { get_param: repo_url_blob }
317 __repo_url_artifacts__: { get_param: repo_url_artifacts }
318 __demo_artifacts_version__: { get_param: demo_artifacts_version }
319 __install_script_version__: { get_param: install_script_version }
320 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
321 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
322 __cloud_env__: { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500323 template: |
324 #!/bin/bash
325
Jerry Floodc8bd4272017-10-19 13:43:43 -0400326 # Create configuration files
DR695Hccff30b2017-02-17 18:44:24 -0500327 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400328 echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt
329 echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
330 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
331 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
332 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
333 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
334 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
335 echo "__install_script_version__" > /opt/config/install_script_version.txt
336 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
337 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
338 echo "__cloud_env__" > /opt/config/cloud_env.txt
339
340 # Download and run install script
341 curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_dns_install.sh -o /opt/v_dns_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500342 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400343 chmod +x v_dns_install.sh
344 ./v_dns_install.sh
jf98609ab26342017-02-28 15:07:36 -0500345
jf98609ab26342017-02-28 15:07:36 -0500346
Jerry Floodc8bd4272017-10-19 13:43:43 -0400347 vpg_private_0_port:
DR695Hccff30b2017-02-17 18:44:24 -0500348 type: OS::Neutron::Port
349 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400350 network: { get_resource: pktgen_private_network }
351 fixed_ips: [{"subnet": { get_resource: pktgen_private_subnet }, "ip_address": { get_param: vpg_private_ip_0 }}]
DR695Hccff30b2017-02-17 18:44:24 -0500352
Jerry Floodc8bd4272017-10-19 13:43:43 -0400353 vpg_private_1_port:
DR695Hccff30b2017-02-17 18:44:24 -0500354 type: OS::Neutron::Port
355 properties:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400356 network: { get_param: onap_private_net_id }
357 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vpg_private_ip_1 }}]
358
359 vpg_0:
360 type: OS::Nova::Server
361 properties:
362 image: { get_param: vlb_image_name }
363 flavor: { get_param: vlb_flavor_name }
364 name: { get_param: vpg_name_0 }
365 key_name: { get_resource: my_keypair }
366 networks:
367 - network: { get_param: public_net_id }
368 - port: { get_resource: vpg_private_0_port }
369 - port: { get_resource: vpg_private_1_port }
370 user_data_format: RAW
371 user_data:
372 str_replace:
373 params:
374 __repo_url_blob__: { get_param: repo_url_blob }
375 __repo_url_artifacts__: { get_param: repo_url_artifacts }
376 __local_private_ipaddr__: { get_param: vpg_private_ip_0 }
377 __oam_private_ipaddr__: { get_param: vpg_private_ip_1 }
378 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
379 __pktgen_private_net_cidr__: { get_param: pktgen_private_net_cidr }
380 __vlb_ipaddr__: { get_param: vlb_private_ip_2 }
381 __demo_artifacts_version__: { get_param: demo_artifacts_version }
382 __install_script_version__: { get_param: install_script_version }
383 __pg_int__: { get_param: pg_int }
384 __vlb_mac__: { get_attr: [vlb_private_2_port, mac_address] }
385 __cloud_env__: { get_param: cloud_env }
386 template: |
387 #!/bin/bash
388
389 # Create configuration files
390 mkdir /opt/config
391 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
392 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
393 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
394 echo "__pktgen_private_net_cidr__" > /opt/config/pktgen_private_net_cidr.txt
395 echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
396 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
397 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
398 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
399 echo "__install_script_version__" > /opt/config/install_script_version.txt
400 echo "__pg_int__" > /opt/config/pg_int.txt
401 echo "__vlb_mac__" > /opt/config/vlb_mac.txt
402 echo "__cloud_env__" > /opt/config/cloud_env.txt
403
404 # Download and run install script
405 curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_packetgen_install.sh -o /opt/v_packetgen_install.sh
406 cd /opt
407 chmod +x v_packetgen_install.sh
408 ./v_packetgen_install.sh