Update INFO.yaml with new PTL
[demo.git] / heat / vCPE / infra / base_vcpe_infra_rackspace.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4
5 #
6 # Copyright 2017 AT&T Intellectual Property. All rights reserved.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2013-05-23
26
27 description: Heat template to deploy vCPE Infrastructue emlements (vAAA, vDHCP, vDNS_DHCP, webServer_sink) for ONAP
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36   vcpe_image_name:
37     type: string
38     label: Image name or ID
39     description: Image to be used for compute instance
40   vcpe_flavor_name:
41     type: string
42     label: Flavor
43     description: Type of instance (flavor) to be used
44   public_net_id:
45     type: string
46     label: Public network name or ID
47     description: Public network that enables remote connection to VNF
48   onap_private_net_id:
49     type: string
50     label: ONAP management network name or ID
51     description: Private network that connects ONAP components and the VNF
52   onap_private_subnet_id:
53     type: string
54     label: ONAP management sub-network name or ID
55     description: Private sub-network that connects ONAP components and the VNF
56   onap_private_net_cidr:
57     type: string
58     label: ONAP private network CIDR
59     description: The CIDR of the protected private network
60   cpe_signal_net_id:
61     type: string
62     label: vAAA private network name or ID
63     description: Private network that connects vAAA with vDNSs
64   cpe_signal_net_cidr:
65     type: string
66     label: vAAA private network CIDR
67     description: The CIDR of the vAAA private network
68   cpe_public_net_id:
69     type: string
70     label: vCPE Public network (emulates internet) name or ID
71     description: Private network that connects vGW to emulated internet
72   cpe_public_net_cidr:
73     type: string
74     label: vCPE public network CIDR
75     description: The CIDR of the vCPE public
76   vaaa_private_ip_0:
77     type: string
78     label: vAAA private IP address towards the CPE_SIGNAL private network
79     description: Private IP address that is assigned to the vAAA to communicate with the vCPE components
80   vaaa_private_ip_1:
81     type: string
82     label: vAAA private IP address towards the ONAP management network
83     description: Private IP address that is assigned to the vAAA to communicate with ONAP components
84   vdns_private_ip_0:
85     type: string
86     label: vDNS private IP address towards the CPE_PUBLIC private network
87     description: Private IP address that is assigned to the vDNS to communicate with the vCPE components
88   vdns_private_ip_1:
89     type: string
90     label: vDNS private IP address towards the ONAP management network
91     description: Private IP address that is assigned to the vDNS to communicate with ONAP components
92   vdhcp_private_ip_0:
93     type: string
94     label: vDHCP  private IP address towards the CPE_SIGNAL private network
95     description: Private IP address that is assigned to the vDHCP to communicate with the vCPE components
96   vdhcp_private_ip_1:
97     type: string
98     label: vDNS private IP address towards the ONAP management network
99     description: Private IP address that is assigned to the vDHCP to communicate with ONAP components
100   vweb_private_ip_0:
101     type: string
102     label: vWEB private IP address towards the CPE_PUBLIC private network
103     description: Private IP address that is assigned to the vWEB to communicate with the vGWs 
104   vweb_private_ip_1:
105     type: string
106     label: vWEB private IP address towards the ONAP management network
107     description: Private IP address that is assigned to the vWEB to communicate with ONAP components
108   vaaa_name_0:
109     type: string
110     label: vAAA name
111     description: Name of the vAAA
112   vdns_name_0:
113     type: string
114     label: vDNS name
115     description: Name of the vDNS
116   vdhcp_name_0:
117     type: string
118     label: vDHCP name
119     description: Name of the vDHCP
120   vweb_name_0:
121     type: string
122     label: vWEB name
123     description: Name of the vWEB 
124   vnf_id:
125     type: string
126     label: VNF ID
127     description: The VNF ID is provided by ONAP
128   vf_module_id:
129     type: string
130     label: vFirewall module ID
131     description: The vAAA Module ID is provided by ONAP
132   dcae_collector_ip:
133     type: string
134     label: DCAE collector IP address
135     description: IP address of the DCAE collector
136   dcae_collector_port:
137     type: string
138     label: DCAE collector port
139     description: Port of the DCAE collector
140   mr_ip_addr:
141     type: string
142     label: Message Router IP address
143     description: IP address of the Message Router that for vDHCP configuration 
144   key_name:
145     type: string
146     label: Key pair name
147     description: Public/Private key pair name
148   pub_key:
149     type: string
150     label: Public key
151     description: Public key to be installed on the compute instance
152   repo_url_blob:
153     type: string
154     label: Repository URL
155     description: URL of the repository that hosts the demo packages
156   repo_url_artifacts:
157     type: string
158     label: Repository URL
159     description: URL of the repository that hosts the demo packages
160   install_script_version:
161     type: string
162     label: Installation script version number
163     description: Version number of the scripts that install the vFW demo app
164   demo_artifacts_version:
165     type: string
166     label: Artifacts version used in demo vnfs
167     description: Artifacts (jar, tar.gz) version used in demo vnfs
168   cloud_env:
169     type: string
170     label: Cloud environment
171     description: Cloud environment (e.g., openstack, rackspace)
172
173 #############
174 #           #
175 # RESOURCES #
176 #           #
177 #############
178
179 resources:
180
181   random-str:
182     type: OS::Heat::RandomString
183     properties:
184       length: 4
185
186   my_keypair:
187     type: OS::Nova::KeyPair
188     properties:
189       name:
190         str_replace:
191           template: base_rand
192           params:
193             base: { get_param: key_name }
194             rand: { get_resource: random-str }
195       public_key: { get_param: pub_key }
196       save_private_key: false
197
198   cpe_signal_network:
199     type: OS::Neutron::Net
200     properties:
201       name: { get_param: cpe_signal_net_id }
202
203   cpe_signal_subnet:
204     type: OS::Neutron::Subnet
205     properties:
206       name: { get_param: cpe_signal_net_id }
207       network_id: { get_resource: cpe_signal_network }
208       cidr: { get_param: cpe_signal_net_cidr }
209
210   cpe_public_network:
211     type: OS::Neutron::Net
212     properties:
213       name: { get_param: cpe_public_net_id }
214
215   cpe_public_subnet:
216     type: OS::Neutron::Subnet
217     properties:
218       name: { get_param: cpe_public_net_id }
219       network_id: { get_resource: cpe_public_network }
220       cidr: { get_param: cpe_public_net_cidr }
221
222
223   # Virtual AAA server Instantiation
224   vaaa_private_0_port:
225     type: OS::Neutron::Port
226     properties:
227       network: { get_resource: cpe_signal_network }
228       fixed_ips: [{"subnet": { get_resource: cpe_signal_subnet }, "ip_address": { get_param: vaaa_private_ip_0 }}]
229
230   vaaa_private_1_port:
231     type: OS::Neutron::Port
232     properties:
233       network: { get_param: onap_private_net_id }
234       fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vaaa_private_ip_1 }}]
235
236   vaaa_0:
237     type: OS::Nova::Server
238     properties:
239       image: { get_param: vcpe_image_name }
240       flavor: { get_param: vcpe_flavor_name }
241       name: { get_param: vaaa_name_0 }
242       key_name: { get_resource: my_keypair }
243       networks:
244         - network: { get_param: public_net_id }
245         - port: { get_resource: vaaa_private_0_port }
246         - port: { get_resource: vaaa_private_1_port }
247       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
248       user_data_format: RAW
249       user_data:
250         str_replace:
251           params:
252             __dcae_collector_ip__: { get_param: dcae_collector_ip }
253             __dcae_collector_port__: { get_param: dcae_collector_port }
254             __cpe_signal_net_ipaddr__: { get_param: vaaa_private_ip_0 }
255             __oam_ipaddr__: { get_param: vaaa_private_ip_1 }
256             __oam_cidr__: { get_param: onap_private_net_cidr }
257             __cpe_signal_net_cidr__: { get_param: cpe_signal_net_cidr }
258             __repo_url_blob__ : { get_param: repo_url_blob }
259             __repo_url_artifacts__ : { get_param: repo_url_artifacts }
260             __demo_artifacts_version__ : { get_param: demo_artifacts_version }
261             __install_script_version__ : { get_param: install_script_version }
262             __cloud_env__ : { get_param: cloud_env }
263           template: |
264             #!/bin/bash
265
266             # Create configuration files
267             mkdir /opt/config
268             echo "__dcae_collector_ip__" > /opt/config/dcae_collector_ip.txt
269             echo "__dcae_collector_port__" > /opt/config/dcae_collector_port.txt
270             echo "__cpe_signal_net_ipaddr__" > /opt/config/cpe_signal_net_ipaddr.txt
271             echo "__oam_ipaddr__" > /opt/config/oam_ipaddr.txt
272             echo "__oam_cidr__" > /opt/config/oam_cidr.txt
273             echo "__cpe_signal_net_cidr__" > /opt/config/cpe_signal_net_cidr.txt
274             echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
275             echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
276             echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
277             echo "__install_script_version__" > /opt/config/install_script_version.txt
278             echo "__cloud_env__" > /opt/config/cloud_env.txt
279
280             # Download and run install script
281             curl -k __repo_url_blob__/org.onap.demo/vnfs/vcpe/__install_script_version__/v_aaa_install.sh -o /opt/v_aaa_install.sh
282             cd /opt
283             chmod +x v_aaa_install.sh
284             ./v_aaa_install.sh
285
286
287   # Virtual DNS Instantiation
288   vdns_private_0_port:
289     type: OS::Neutron::Port
290     properties:
291       network: { get_resource: cpe_public_network }
292       fixed_ips: [{"subnet": { get_resource: cpe_public_subnet }, "ip_address": { get_param: vdns_private_ip_0 }}]
293
294   vdns_private_1_port:
295     type: OS::Neutron::Port
296     properties:
297       network: { get_param: onap_private_net_id }
298       fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}]
299
300   vdns_0:
301     type: OS::Nova::Server
302     properties:
303       image: { get_param: vcpe_image_name }
304       flavor: { get_param: vcpe_flavor_name }
305       name: { get_param: vdns_name_0 }
306       key_name: { get_resource: my_keypair }
307       networks:
308         - network: { get_param: public_net_id }
309         - port: { get_resource: vdns_private_0_port }
310         - port: { get_resource: vdns_private_1_port }
311       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
312       user_data_format: RAW
313       user_data:
314         str_replace:
315           params:
316             __oam_ipaddr__ : { get_param: vdns_private_ip_1 }
317             __cpe_public_net_ipaddr__: { get_param: vdns_private_ip_0 }
318             __oam_cidr__: { get_param: onap_private_net_cidr }
319             __cpe_public_net_cidr__: { get_param: cpe_public_net_cidr }
320             __repo_url_blob__ : { get_param: repo_url_blob }
321             __repo_url_artifacts__ : { get_param: repo_url_artifacts }
322             __demo_artifacts_version__ : { get_param: demo_artifacts_version }
323             __install_script_version__ : { get_param: install_script_version }
324             __cloud_env__ : { get_param: cloud_env }
325           template: |
326             #!/bin/bash
327
328             # Create configuration files
329             mkdir /opt/config
330             echo "__oam_ipaddr__" > /opt/config/oam_ipaddr.txt
331             echo "__cpe_public_net_ipaddr__" > /opt/config/cpe_public_net_ipaddr.txt
332             echo "__oam_cidr__" > /opt/config/oam_cidr.txt
333             echo "__cpe_public_net_cidr__" > /opt/config/cpe_public_net_cidr.txt
334             echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
335             echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
336             echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
337             echo "__install_script_version__" > /opt/config/install_script_version.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/vcpe/__install_script_version__/v_dns_install.sh -o /opt/v_dns_install.sh
342             cd /opt
343             chmod +x v_dns_install.sh
344             ./v_dns_install.sh
345
346
347   # Virtual DHCP Instantiation
348   vdhcp_private_0_port:
349     type: OS::Neutron::Port
350     properties:
351       network: { get_resource: cpe_signal_network }
352       fixed_ips: [{"subnet": { get_resource: cpe_signal_subnet }, "ip_address": { get_param: vdhcp_private_ip_0 }}]
353
354   vdhcp_private_1_port:
355     type: OS::Neutron::Port
356     properties:
357       network: { get_param: onap_private_net_id }
358       fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdhcp_private_ip_1 }}]
359
360   vdhcp_0:
361     type: OS::Nova::Server
362     properties:
363       image: { get_param: vcpe_image_name }
364       flavor: { get_param: vcpe_flavor_name }
365       name: { get_param: vdhcp_name_0 }
366       key_name: { get_resource: my_keypair }
367       networks:
368         - network: { get_param: public_net_id }
369         - port: { get_resource: vdhcp_private_0_port }
370         - port: { get_resource: vdhcp_private_1_port }
371       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
372       user_data_format: RAW
373       user_data:
374         str_replace:
375           params:
376             __oam_ipaddr__ : { get_param: vdhcp_private_ip_1 }
377             __cpe_signal_ipaddr__ : { get_param: vdhcp_private_ip_0 }
378             __oam_cidr__ : { get_param: onap_private_net_cidr }
379             __cpe_signal_net_cidr__ : { get_param: cpe_signal_net_cidr }
380             __mr_ip_addr__ : { get_param: mr_ip_addr }
381             __repo_url_blob__ : { get_param: repo_url_blob }
382             __repo_url_artifacts__ : { get_param: repo_url_artifacts }
383             __demo_artifacts_version__ : { get_param: demo_artifacts_version }
384             __install_script_version__ : { get_param: install_script_version }
385             __cloud_env__ : { get_param: cloud_env }
386           template: |
387             #!/bin/bash
388
389             # Create configuration files
390             mkdir /opt/config
391             echo "__oam_ipaddr__" > /opt/config/oam_ipaddr.txt
392             echo "__cpe_signal_ipaddr__" > /opt/config/cpe_signal_ipaddr.txt
393             echo "__oam_cidr__" > /opt/config/oam_cidr.txt
394             echo "__cpe_signal_net_cidr__" > /opt/config/cpe_signal_net_cidr.txt
395             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.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 "__cloud_env__" > /opt/config/cloud_env.txt
401
402             # Download and run install script
403             curl -k __repo_url_blob__/org.onap.demo/vnfs/vcpe/__install_script_version__/v_dhcp_install.sh -o /opt/v_dhcp_install.sh
404             cd /opt
405             chmod +x v_dhcp_install.sh
406             ./v_dhcp_install.sh
407
408   # vWEB instantiaion
409   vweb_private_0_port:
410     type: OS::Neutron::Port
411     properties:
412       network: { get_resource: cpe_public_network }
413       fixed_ips: [{"subnet": { get_resource: cpe_public_subnet }, "ip_address": { get_param: vweb_private_ip_0 }}]
414
415   vweb_private_1_port:
416     type: OS::Neutron::Port
417     properties:
418       network: { get_param: onap_private_net_id }
419       fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vweb_private_ip_1 }}]
420
421
422   vweb_0:
423     type: OS::Nova::Server
424     properties:
425       image: { get_param: vcpe_image_name }
426       flavor: { get_param: vcpe_flavor_name }
427       name: { get_param: vweb_name_0 }
428       key_name: { get_resource: my_keypair }
429       networks:
430         - network: { get_param: public_net_id }
431         - port: { get_resource: vweb_private_0_port }
432         - port: { get_resource: vweb_private_1_port }
433       metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
434       user_data_format: RAW
435       user_data:
436         str_replace:
437           params:
438             __oam_ipaddr__ : { get_param: vweb_private_ip_1 }
439             __cpe_public_ipaddr__: { get_param: vweb_private_ip_0 }
440             __oam_cidr__: { get_param: onap_private_net_cidr }
441             __cpe_public_net_cidr__: { get_param: cpe_public_net_cidr }
442             __repo_url_blob__ : { get_param: repo_url_blob }
443             __repo_url_artifacts__ : { get_param: repo_url_artifacts }
444             __demo_artifacts_version__ : { get_param: demo_artifacts_version }
445             __install_script_version__ : { get_param: install_script_version }
446             __cloud_env__ : { get_param: cloud_env }
447           template: |
448             #!/bin/bash
449
450             # Create configuration files
451             mkdir /opt/config
452             echo "__oam_ipaddr__" > /opt/config/oam_ipaddr.txt
453             echo "__cpe_public_ipaddr__" > /opt/config/cpe_public_ipaddr.txt
454             echo "__oam_cidr__" > /opt/config/oam_cidr.txt
455             echo "__cpe_public_net_cidr__" > /opt/config/cpe_public_net_cidr.txt
456             echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
457             echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
458             echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
459             echo "__install_script_version__" > /opt/config/install_script_version.txt
460             echo "__cloud_env__" > /opt/config/cloud_env.txt
461
462             # Download and run install script
463             curl -k __repo_url_blob__/org.onap.demo/vnfs/vcpe/__install_script_version__/v_web_install.sh -o /opt/v_web_install.sh
464             cd /opt
465             chmod +x v_web_install.sh
466             ./v_web_install.sh