Assign public interface to vFW in OpenStack
[demo.git] / heat / OpenECOMP / onap_openstack.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: 2015-10-15
26
27 description: Heat template to install ONAP components
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36
37   ##############################################
38   #                                            #
39   # Parameters used across all ONAP components #
40   #                                            #
41   ##############################################
42   
43   public_net_id:
44     type: string
45     description: Public network for floating IP address allocation
46
47   ubuntu_1404_image:
48     type: string
49     description: Name of the Ubuntu 14.04 image
50
51   ubuntu_1604_image:
52     type: string
53     description: Name of the Ubuntu 16.04 image
54
55   flavor_small:
56     type: string
57     description: Name of the Small Flavor supported by the cloud provider
58
59   flavor_medium:
60     type: string
61     description: Name of the Medium Flavor supported by the cloud provider
62
63   flavor_large:
64     type: string
65     description: Name of the Large Flavor supported by the cloud provider
66
67   flavor_xlarge:
68     type: string
69     description: Name of the Extra Large Flavor supported by the cloud provider
70
71   vm_base_name:
72     type: string
73     description: Base name of ONAP VMs
74
75   key_name:
76     type: string
77     description: Public/Private key pair name
78
79   pub_key:
80     type: string
81     description: Public key to be installed on the compute instance
82
83   nexus_repo:
84     type: string
85     description: Complete URL for the Nexus repository.
86
87   nexus_docker_repo:
88     type: string
89     description: Complete URL for the Nexus repository for docker images.
90
91   nexus_username:
92     type: string
93     description: Nexus Repository username
94
95   nexus_password:
96     type: string
97     description: Nexus Repository Password
98
99   artifacts_version:
100     type: string
101     description: Artifacts version of ONAP components
102
103   docker_version:
104     type: string
105     label: Version number of ONAP docker images
106
107   gerrit_branch:
108     type: string
109     label: Gerrit code branch
110     description: Gerrit branch where to download the code from
111
112   dmaap_topic:
113     type: string
114     description: DMaaP Topic name
115
116   openstack_tenant_id:
117     type: string
118     description: Openstack tenant ID
119
120   openstack_username:
121     type: string
122     description: Openstack username
123
124   openstack_auth_method:
125     type: string
126     description: Openstack authentication method (password VS. api-key)
127
128   openstack_api_key:
129     type: string
130     description: Openstack API Key
131
132   horizon_url:
133     type: string
134     description: URL of Openstack Horizon
135
136   keystone_url:
137     type: string
138     description: URL of Openstack Keystone
139
140   cloud_env:
141     type: string
142     description: Cloud Provider Name
143
144   ######################
145   #                    #
146   # Network parameters #
147   #                    #
148   ######################
149
150   dns_list:
151     type: comma_delimited_list
152     description: List of External DNS for OAM ONAP network
153
154   external_dns:
155     type: string
156     description: First element of the dns_list for ONAP network
157
158   ### Private IP addresses ###
159   oam_network_cidr:
160     type: string
161     description: CIDR of the OAM ONAP network
162
163   aai_ip_addr:
164     type: string
165     description: AAI IP Address
166
167   appc_ip_addr:
168     type: string
169     description: APP-C IP Address
170
171   dcae_ip_addr:
172     type: string
173     description: DCAE IP Address
174  
175   dcae_coll_ip_addr:
176     type: string
177     description: DCAE Collector IP Address
178
179   dcae_db_ip_addr:
180     type: string
181     description: DCAE Database IP Address
182
183   dcae_hdp1_ip_addr:
184     type: string
185     description: Hadoop VM1 IP Address
186
187   dcae_hdp2_ip_addr:
188     type: string
189     description: Hadoop VM2 IP Address
190
191   dcae_hdp3_ip_addr:
192     type: string
193     description: Hadoop VM3 IP Address
194
195   dns_ip_addr:
196     type: string
197     description: DNS IP Address
198
199   mso_ip_addr:
200     type: string
201     description: MSO IP Address
202
203   mr_ip_addr:
204     type: string
205     description: Message Router IP Address
206
207   policy_ip_addr:
208     type: string
209     description: Policy Engine IP Address
210
211   portal_ip_addr:
212     type: string
213     description: Portal IP Address
214
215   robot_ip_addr:
216     type: string
217     description: Robot Framework IP Address
218
219   sdc_ip_addr:
220     type: string
221     description: SDC IP Address
222
223   sdnc_ip_addr:
224     type: string
225     description: SDN-C IP Address
226
227   vid_ip_addr:
228     type: string
229     description: VID IP Address
230
231
232   ###########################
233   #                         #
234   # Parameters used by DCAE #
235   #                         #
236   ###########################
237
238   dcae_base_environment:
239     type: string
240     description: DCAE Base Environment configuration (RACKSPACE/2-NIC/1-NIC-FLOATING-IPS)
241
242   dcae_zone:
243     type: string
244     description: DCAE Zone to use in VM names created by DCAE controller
245
246   dcae_state:
247     type: string
248     description: DCAE State to use in VM names created by DCAE controller
249
250   nexus_repo_root:
251     type: string
252     description: Root URL of Nexus repository
253
254   nexus_url_snapshot:
255     type: string
256     description: Snapshot of Maven repository for DCAE deployment
257
258   openstack_region:
259     type: string
260     description: Region where the DCAE controller will spin the VMs
261
262   gitlab_branch:
263     type: string
264     description: Branch of the Gitlab repository
265     
266   dcae_code_version:
267     type: string
268     description: DCAE Code Version Number
269
270
271 #############
272 #           #
273 # RESOURCES #
274 #           #
275 #############
276
277 resources:
278   random-str:
279     type: OS::Heat::RandomString
280     properties:
281       length: 4
282
283
284   # Public key used to access ONAP components
285   vm_key:
286     type: OS::Nova::KeyPair
287     properties:
288       name:
289         str_replace:
290           template: base_rand
291           params:
292             base: { get_param: key_name }
293             rand: { get_resource: random-str }
294       public_key: { get_param: pub_key }
295       save_private_key: false
296
297
298   # ONAP management private network
299   oam_ecomp:
300     type: OS::Neutron::Net
301     properties:
302       name:
303         str_replace:
304           template: oam_ecomp_rand
305           params:
306             rand: { get_resource: random-str }
307
308   oam_ecomp_subnet:
309     type: OS::Neutron::Subnet
310     properties:
311       name:
312         str_replace:
313           template: oam_ecomp_rand
314           params:
315             rand: { get_resource: random-str }
316       network_id: { get_resource: oam_ecomp }
317       cidr: { get_param: oam_network_cidr }
318       dns_nameservers: { get_param: dns_list }
319
320   router:
321     type: OS::Neutron::Router
322     properties:
323       external_gateway_info:
324         network: { get_param: public_net_id }
325
326   router_interface:
327     type: OS::Neutron::RouterInterface
328     properties:
329       router_id: { get_resource: router }
330       subnet_id: { get_resource: oam_ecomp_subnet }
331
332
333   # DNS Server instantiation
334   dns_private_port:
335     type: OS::Neutron::Port
336     properties:
337       network: { get_resource: oam_ecomp }
338       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dns_ip_addr }}]
339
340   dns_floating_ip:
341     type: OS::Neutron::FloatingIP
342     properties:
343       floating_network_id: { get_param: public_net_id }
344       port_id: { get_resource: dns_private_port }
345
346   dns_vm:
347     type: OS::Nova::Server
348     properties:
349       image: { get_param: ubuntu_1404_image }
350       flavor: { get_param: flavor_small }
351       name:
352         str_replace:
353           template: base-dns-server
354           params:
355             base: { get_param: vm_base_name }
356       key_name: { get_resource: vm_key }
357       networks:
358         - port: { get_resource: dns_private_port }
359       user_data_format: RAW
360       user_data:
361         str_replace:
362           params:
363             __nexus_repo__: { get_param: nexus_repo }
364             __artifacts_version__: { get_param: artifacts_version }
365             __oam_network_cidr__: { get_attr: [oam_ecomp_subnet, cidr] }
366             __dns_ip_addr__: { get_param: dns_ip_addr }
367             __aai_ip_addr__: { get_param: aai_ip_addr }
368             __appc_ip_addr__: { get_param: appc_ip_addr }
369             __dcae_ip_addr__: { get_param: dcae_ip_addr }
370             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
371             __mso_ip_addr__: { get_param: mso_ip_addr }
372             __mr_ip_addr__: { get_param: mr_ip_addr }
373             __policy_ip_addr__: { get_param: policy_ip_addr }
374             __portal_ip_addr__: { get_param: portal_ip_addr }
375             __robot_ip_addr__: { get_param: robot_ip_addr }
376             __sdc_ip_addr__: { get_param: sdc_ip_addr }
377             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
378             __vid_ip_addr__: { get_param: vid_ip_addr }
379             __cloud_env__: { get_param: cloud_env }
380             __external_dns__: { get_param: external_dns }
381           template: |
382             #!/bin/bash
383
384             # Create configuration files
385             mkdir -p /opt/config
386             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
387             echo "__cloud_env__" > /opt/config/cloud_env.txt
388             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
389             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
390             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
391             echo "__aai_ip_addr__" > /opt/config/aai_ip_addr.txt
392             echo "__appc_ip_addr__" > /opt/config/appc_ip_addr.txt
393             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
394             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
395             echo "__mso_ip_addr__" > /opt/config/mso_ip_addr.txt
396             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
397             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
398             echo "__portal_ip_addr__" > /opt/config/portal_ip_addr.txt
399             echo "__robot_ip_addr__" > /opt/config/robot_ip_addr.txt
400             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
401             echo "__sdnc_ip_addr__" > /opt/config/sdnc_ip_addr.txt
402             echo "__vid_ip_addr__" > /opt/config/vid_ip_addr.txt
403             echo "__external_dns__" > /opt/config/external_dns.txt
404
405             # Download and run install script
406             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dns_install.sh -o /opt/dns_install.sh
407             cd /opt
408             chmod +x dns_install.sh
409             ./dns_install.sh
410
411
412   # A&AI instantiation
413   aai_private_port:
414     type: OS::Neutron::Port
415     properties:
416       network: { get_resource: oam_ecomp }
417       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: aai_ip_addr }}]
418
419   aai_floating_ip:
420     type: OS::Neutron::FloatingIP
421     properties:
422       floating_network_id: { get_param: public_net_id }
423       port_id: { get_resource: aai_private_port }
424
425   aai_vm:
426     type: OS::Nova::Server
427     properties:
428       image: { get_param: ubuntu_1404_image }
429       flavor: { get_param: flavor_xlarge }
430       name:
431         str_replace:
432           template: base-aai
433           params:
434             base: { get_param: vm_base_name }      
435       key_name: { get_resource: vm_key }
436       networks:
437         - port: { get_resource: aai_private_port }
438       user_data_format: RAW
439       user_data:
440         str_replace:
441           params:
442             __nexus_repo__: { get_param: nexus_repo }
443             __nexus_docker_repo__: { get_param: nexus_docker_repo }
444             __nexus_username__: { get_param: nexus_username }
445             __nexus_password__: { get_param: nexus_password }
446             __dmaap_topic__: { get_param: dmaap_topic }
447             __artifacts_version__: { get_param: artifacts_version }
448             __dns_ip_addr__: { get_param: dns_ip_addr }
449             __sdc_ip_addr__: { get_param: sdc_ip_addr }
450             __docker_version__: { get_param: docker_version }
451             __cloud_env__: { get_param: cloud_env }
452             __external_dns__: { get_param: external_dns }
453           template: |
454             #!/bin/bash
455
456             # Create configuration files
457             mkdir -p /opt/config
458             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
459             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
460             echo "__nexus_username__" > /opt/config/nexus_username.txt
461             echo "__nexus_password__" > /opt/config/nexus_password.txt
462             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
463             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
464             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
465             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
466             echo "__docker_version__" > /opt/config/docker_version.txt
467             echo "__cloud_env__" > /opt/config/cloud_env.txt
468             echo "__external_dns__" > /opt/config/external_dns.txt
469
470             # Download and run install script
471             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
472             cd /opt
473             chmod +x aai_install.sh
474             ./aai_install.sh
475
476
477   # MSO instantiation
478   mso_private_port:
479     type: OS::Neutron::Port
480     properties:
481       network: { get_resource: oam_ecomp }
482       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mso_ip_addr }}]
483
484   mso_floating_ip:
485     type: OS::Neutron::FloatingIP
486     properties:
487       floating_network_id: { get_param: public_net_id }
488       port_id: { get_resource: mso_private_port }
489
490   mso_vm:
491     type: OS::Nova::Server
492     properties:
493       image: { get_param: ubuntu_1604_image }
494       flavor: { get_param: flavor_large }
495       name:
496         str_replace:
497           template: base-mso
498           params:
499             base: { get_param: vm_base_name }      
500       key_name: { get_resource: vm_key }
501       networks:
502         - port: { get_resource: mso_private_port }
503       user_data_format: RAW
504       user_data:
505         str_replace:
506           params:
507             __nexus_repo__: { get_param: nexus_repo }
508             __nexus_docker_repo__: { get_param: nexus_docker_repo }
509             __nexus_username__: { get_param: nexus_username }
510             __nexus_password__: { get_param: nexus_password }
511             __openstack_username__: { get_param: openstack_username }
512             __openstack_tenant_id__: { get_param: openstack_tenant_id }
513             __openstack_api_key__: { get_param: openstack_api_key }
514             __openstack_region__: { get_param: openstack_region }
515             __keystone_url__: { get_param: keystone_url }
516             __dmaap_topic__: { get_param: dmaap_topic }
517             __artifacts_version__: { get_param: artifacts_version }
518             __dns_ip_addr__: { get_param: dns_ip_addr }
519             __docker_version__: { get_param: docker_version }
520             __gerrit_branch__: { get_param: gerrit_branch }
521             __cloud_env__: { get_param: cloud_env }
522             __external_dns__: { get_param: external_dns }
523           template: |
524             #!/bin/bash
525
526             # Create configuration files
527             mkdir -p /opt/config
528             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
529             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
530             echo "__nexus_username__" > /opt/config/nexus_username.txt
531             echo "__nexus_password__" > /opt/config/nexus_password.txt
532             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
533             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
534             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
535             echo "__openstack_username__" > /opt/config/openstack_username.txt
536             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
537             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
538             echo "__openstack_region__" > /opt/config/openstack_region.txt
539             echo "__keystone_url__" > /opt/config/keystone.txt
540             echo "__docker_version__" > /opt/config/docker_version.txt
541             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
542             echo "__cloud_env__" > /opt/config/cloud_env.txt
543             echo "__external_dns__" > /opt/config/external_dns.txt
544
545             # Download and run install script
546             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
547             cd /opt
548             chmod +x mso_install.sh
549             ./mso_install.sh
550
551
552   # Message Router instantiation
553   mrouter_private_port:
554     type: OS::Neutron::Port
555     properties:
556       network: { get_resource: oam_ecomp }
557       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mr_ip_addr }}]
558
559   mrouter_floating_ip:
560     type: OS::Neutron::FloatingIP
561     properties:
562       floating_network_id: { get_param: public_net_id }
563       port_id: { get_resource: mrouter_private_port }
564
565   mrouter_vm:
566     type: OS::Nova::Server
567     properties:
568       image: { get_param: ubuntu_1404_image }
569       flavor: { get_param: flavor_large }
570       name:
571         str_replace: 
572           template: base-message-router
573           params:
574             base: { get_param: vm_base_name }
575       key_name: { get_resource: vm_key }
576       networks:
577         - port: { get_resource: mrouter_private_port }
578       user_data_format: RAW
579       user_data:
580         str_replace:
581           params:
582             __nexus_repo__: { get_param: nexus_repo }
583             __nexus_docker_repo__: { get_param: nexus_docker_repo }
584             __nexus_username__: { get_param: nexus_username }
585             __nexus_password__: { get_param: nexus_password }
586             __artifacts_version__: { get_param: artifacts_version }
587             __dns_ip_addr__: { get_param: dns_ip_addr }
588             __gerrit_branch__: { get_param: gerrit_branch }
589             __cloud_env__: { get_param: cloud_env }
590             __external_dns__: { get_param: external_dns }
591           template: |
592             #!/bin/bash
593
594             # Create configuration files
595             mkdir -p /opt/config
596             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
597             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
598             echo "__nexus_username__" > /opt/config/nexus_username.txt
599             echo "__nexus_password__" > /opt/config/nexus_password.txt
600             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
601             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
602             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
603             echo "__cloud_env__" > /opt/config/cloud_env.txt
604             echo "__external_dns__" > /opt/config/external_dns.txt
605
606             # Download and run install script
607             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
608             cd /opt
609             chmod +x mr_install.sh
610             ./mr_install.sh
611
612
613   # Robot Framework instantiation
614   robot_private_port:
615     type: OS::Neutron::Port
616     properties:
617       network: { get_resource: oam_ecomp }
618       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
619
620   robot_floating_ip:
621     type: OS::Neutron::FloatingIP
622     properties:
623       floating_network_id: { get_param: public_net_id }
624       port_id: { get_resource: robot_private_port }
625  
626   robot_vm:
627     type: OS::Nova::Server
628     properties:
629       image: { get_param: ubuntu_1604_image }
630       flavor: { get_param: flavor_small }
631       name:
632         str_replace: 
633           template: base-robot
634           params:
635             base: { get_param: vm_base_name }
636       key_name: { get_resource: vm_key }
637       networks:
638         - port: { get_resource: robot_private_port }
639       user_data_format: RAW
640       user_data:
641         str_replace:
642           params:
643             __nexus_repo__: { get_param: nexus_repo }
644             __nexus_docker_repo__: { get_param: nexus_docker_repo }
645             __nexus_username__: { get_param: nexus_username }
646             __nexus_password__: { get_param: nexus_password }
647             __network_name__: { get_attr: [oam_ecomp, name] }
648             __openstack_username__: { get_param: openstack_username }
649             __openstack_api_key__: { get_param : openstack_api_key }
650             __artifacts_version__: { get_param: artifacts_version }
651             __openstack_region__: { get_param: openstack_region }
652             __dns_ip_addr__: { get_param: dns_ip_addr }
653             __docker_version__: { get_param: docker_version }
654             __gerrit_branch__: { get_param: gerrit_branch }
655             __cloud_env__: { get_param: cloud_env }
656             __external_dns__: { get_param: external_dns }
657           template: |
658             #!/bin/bash
659
660             # Create configuration files
661             mkdir -p /opt/config
662             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
663             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
664             echo "__nexus_username__" > /opt/config/nexus_username.txt
665             echo "__nexus_password__" > /opt/config/nexus_password.txt
666             echo "__network_name__" > /opt/config/network.txt
667             echo "__openstack_username__" > /opt/config/openstack_username.txt
668             echo "__openstack_api_key__" > /opt/config/openstack_password.txt
669             echo "__openstack_region__" > /opt/config/region.txt
670             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
671             echo "__docker_version__" > /opt/config/docker_version.txt
672             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
673             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
674             echo "__cloud_env__" > /opt/config/cloud_env.txt
675             echo "__external_dns__" > /opt/config/external_dns.txt
676
677             # Download and run install script
678             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
679             cd /opt
680             chmod +x robot_install.sh
681             ./robot_install.sh
682
683
684   # VID instantiation
685   vid_private_port:
686     type: OS::Neutron::Port
687     properties:
688       network: { get_resource: oam_ecomp }
689       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: vid_ip_addr }}]
690
691   vid_floating_ip:
692     type: OS::Neutron::FloatingIP
693     properties:
694       floating_network_id: { get_param: public_net_id }
695       port_id: { get_resource: vid_private_port }
696
697   vid_vm:
698     type: OS::Nova::Server
699     properties:
700       image: { get_param: ubuntu_1404_image }
701       flavor: { get_param: flavor_medium }
702       name:
703         str_replace: 
704           template: base-vid
705           params:
706             base: { get_param: vm_base_name }
707       key_name: { get_resource: vm_key }
708       networks:
709         - port: { get_resource: vid_private_port }
710       user_data_format: RAW
711       user_data:
712         str_replace:
713           params:
714             __nexus_repo__: { get_param: nexus_repo }
715             __nexus_docker_repo__: { get_param: nexus_docker_repo }
716             __nexus_username__: { get_param: nexus_username }
717             __nexus_password__: { get_param: nexus_password }
718             __artifacts_version__: { get_param: artifacts_version }
719             __dns_ip_addr__: { get_param: dns_ip_addr }
720             __docker_version__: { get_param: docker_version }
721             __gerrit_branch__: { get_param: gerrit_branch }
722             __cloud_env__: { get_param: cloud_env }
723             __external_dns__: { get_param: external_dns }
724           template: |
725             #!/bin/bash
726
727             # Create configuration files
728             mkdir -p /opt/config
729             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
730             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
731             echo "__nexus_username__" > /opt/config/nexus_username.txt
732             echo "__nexus_password__" > /opt/config/nexus_password.txt
733             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
734             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
735             echo "__docker_version__" > /opt/config/docker_version.txt
736             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
737             echo "__cloud_env__" > /opt/config/cloud_env.txt
738             echo "__external_dns__" > /opt/config/external_dns.txt
739
740             # Download and run install script
741             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
742             cd /opt
743             chmod +x vid_install.sh
744             ./vid_install.sh
745
746  
747   # SDN-C instantiation
748   sdnc_private_port:
749     type: OS::Neutron::Port
750     properties:
751       network: { get_resource: oam_ecomp }
752       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
753
754   sdnc_floating_ip:
755     type: OS::Neutron::FloatingIP
756     properties:
757       floating_network_id: { get_param: public_net_id }
758       port_id: { get_resource: sdnc_private_port }
759
760   sdnc_vm:
761     type: OS::Nova::Server
762     properties:
763       image: { get_param: ubuntu_1404_image }
764       flavor: { get_param: flavor_large }
765       name:
766         str_replace: 
767           template: base-sdnc
768           params:
769             base: { get_param: vm_base_name }
770       key_name: { get_resource: vm_key }
771       networks:
772         - port: { get_resource: sdnc_private_port }
773       user_data_format: RAW
774       user_data:
775         str_replace:
776           params:
777             __nexus_repo__: { get_param: nexus_repo }
778             __nexus_docker_repo__: { get_param: nexus_docker_repo }
779             __nexus_username__: { get_param: nexus_username }
780             __nexus_password__: { get_param: nexus_password }
781             __artifacts_version__: { get_param: artifacts_version }
782             __dns_ip_addr__: { get_param: dns_ip_addr }
783             __docker_version__: { get_param: docker_version }
784             __gerrit_branch__: { get_param: gerrit_branch }
785             __cloud_env__: { get_param: cloud_env }
786             __external_dns__: { get_param: external_dns }
787           template: |
788             #!/bin/bash
789
790             # Create configuration files
791             mkdir -p /opt/config
792             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
793             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
794             echo "__nexus_username__" > /opt/config/nexus_username.txt
795             echo "__nexus_password__" > /opt/config/nexus_password.txt
796             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
797             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
798             echo "__docker_version__" > /opt/config/docker_version.txt
799             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
800             echo "__cloud_env__" > /opt/config/cloud_env.txt
801             echo "__external_dns__" > /opt/config/external_dns.txt
802
803             # Download and run install script
804             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
805             cd /opt
806             chmod +x sdnc_install.sh
807             ./sdnc_install.sh
808
809
810   # SDC instantiation
811   sdc_private_port:
812     type: OS::Neutron::Port
813     properties:
814       network: { get_resource: oam_ecomp }
815       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
816
817   sdc_floating_ip:
818     type: OS::Neutron::FloatingIP
819     properties:
820       floating_network_id: { get_param: public_net_id }
821       port_id: { get_resource: sdc_private_port }
822
823   sdc_volume_data:
824     type: OS::Cinder::Volume
825     properties:
826       name: vol1-sdc-data
827       size: 100
828
829   sdc_vm:
830     type: OS::Nova::Server
831     properties:
832       image: { get_param: ubuntu_1604_image }
833       flavor: { get_param: flavor_xlarge }
834       name:
835         str_replace: 
836           template: base-sdc
837           params:
838             base: { get_param: vm_base_name }
839       key_name: { get_resource: vm_key }
840       networks:
841         - port: { get_resource: sdc_private_port }
842       block_device_mapping:
843         - device_name: /dev/vdb
844           volume_id: {get_resource: sdc_volume_data}
845       user_data_format: RAW
846       user_data:
847         str_replace:
848           params:
849             __nexus_repo__: { get_param: nexus_repo }
850             __nexus_docker_repo__: { get_param: nexus_docker_repo }
851             __nexus_username__: { get_param: nexus_username }
852             __nexus_password__: { get_param: nexus_password }
853             __env_name__: { get_param: dmaap_topic }
854             __artifacts_version__: { get_param: artifacts_version }
855             __dns_ip_addr__: { get_param: dns_ip_addr }
856             __mr_ip_addr__: { get_param: mr_ip_addr }
857             __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
858             __docker_version__: { get_param: docker_version }
859             __gerrit_branch__: { get_param: gerrit_branch }
860             __cloud_env__: { get_param: cloud_env }
861             __external_dns__: { get_param: external_dns }
862           template: |
863             #!/bin/bash
864
865             # Create configuration files
866             mkdir -p /opt/config
867             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
868             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
869             echo "__nexus_username__" > /opt/config/nexus_username.txt
870             echo "__nexus_password__" > /opt/config/nexus_password.txt
871             echo "__env_name__" > /opt/config/env_name.txt
872             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
873             echo "__public_ip__" > /opt/config/public_ip.txt
874             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
875             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
876             echo "__docker_version__" > /opt/config/docker_version.txt
877             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
878             echo "__cloud_env__" > /opt/config/cloud_env.txt
879             echo "__external_dns__" > /opt/config/external_dns.txt
880
881             # Download and run install script
882             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_install.sh -o /opt/asdc_install.sh
883             cd /opt
884             chmod +x asdc_install.sh
885             ./asdc_install.sh
886
887
888   # PORTAL instantiation
889   portal_private_port:
890     type: OS::Neutron::Port
891     properties:
892       network: { get_resource: oam_ecomp }
893       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: portal_ip_addr }}]
894
895   portal_floating_ip:
896     type: OS::Neutron::FloatingIP
897     properties:
898       floating_network_id: { get_param: public_net_id }
899       port_id: { get_resource: portal_private_port }
900
901   portal_vm:
902     type: OS::Nova::Server
903     properties:
904       image: { get_param: ubuntu_1404_image }
905       flavor: { get_param: flavor_large }
906       name:
907         str_replace: 
908           template: base-portal
909           params:
910             base: { get_param: vm_base_name }
911       key_name: { get_resource: vm_key }
912       networks:
913         - port: { get_resource: portal_private_port }
914       user_data_format: RAW
915       user_data:
916         str_replace:
917           params:
918             __nexus_repo__: { get_param: nexus_repo }
919             __nexus_docker_repo__: { get_param: nexus_docker_repo }
920             __nexus_username__: { get_param: nexus_username }
921             __nexus_password__: { get_param: nexus_password }
922             __artifacts_version__: { get_param: artifacts_version }
923             __dns_ip_addr__: { get_param: dns_ip_addr }
924             __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
925             __docker_version__: { get_param: docker_version }
926             __gerrit_branch__: { get_param: gerrit_branch }
927             __cloud_env__: { get_param: cloud_env }
928             __external_dns__: { get_param: external_dns }
929           template: |
930             #!/bin/bash
931
932             # Create configuration files
933             mkdir -p /opt/config
934             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
935             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
936             echo "__nexus_username__" > /opt/config/nexus_username.txt
937             echo "__nexus_password__" > /opt/config/nexus_password.txt
938             echo "__public_ip__" > /opt/config/public_ip.txt
939             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
940             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
941             echo "__docker_version__" > /opt/config/docker_version.txt
942             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
943             echo "__cloud_env__" > /opt/config/cloud_env.txt
944             echo "__external_dns__" > /opt/config/external_dns.txt
945
946             # Download and run install script
947             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
948             cd /opt
949             chmod +x portal_install.sh
950             ./portal_install.sh
951
952
953   # DCAE Controller instantiation
954   dcae_c_private_port:
955     type: OS::Neutron::Port
956     properties:
957       network: { get_resource: oam_ecomp }
958       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
959
960   dcae_c_floating_ip:
961     type: OS::Neutron::FloatingIP
962     properties:
963       floating_network_id: { get_param: public_net_id }
964       port_id: { get_resource: dcae_c_private_port }
965
966   dcae_c_vm:
967     type: OS::Nova::Server
968     properties:
969       image: { get_param: ubuntu_1404_image }
970       flavor: { get_param: flavor_medium }
971       name:
972         str_replace: 
973           template: base-dcae-controller
974           params:
975             base: { get_param: vm_base_name }
976       key_name: { get_resource: vm_key }
977       networks:
978         - port: { get_resource: dcae_c_private_port }
979       user_data_format: RAW
980       user_data:
981         str_replace:
982           params:
983             __nexus_repo__: { get_param: nexus_repo }
984             __nexus_docker_repo__: { get_param: nexus_docker_repo }
985             __nexus_username__: { get_param: nexus_username }
986             __nexus_password__: { get_param: nexus_password }
987             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
988             __gitlab_branch__: { get_param: gitlab_branch }
989             __dns_ip_addr__: { get_param: dns_ip_addr }
990             __dcae_zone__: { get_param: dcae_zone }
991             __dcae_state__: { get_param: dcae_state }
992             __artifacts_version__: { get_param: artifacts_version }
993             __tenant_id__: { get_param: openstack_tenant_id }
994             __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
995             __openstack_user__: { get_param: openstack_username }
996             __openstack_password__: { get_param: openstack_api_key }
997             __openstack_auth_method__: { get_param: openstack_auth_method }
998             __key_name__: { get_param: key_name }
999             __rand_str__: { get_resource: random-str }
1000             __pub_key__: { get_param: pub_key }
1001             __nexus_repo_root__: { get_param: nexus_repo_root }
1002             __openstack_region__: { get_param: openstack_region }
1003             __horizon_url__: { get_param: horizon_url }
1004             __keystone_url__: { get_param: keystone_url }
1005             __docker_version__: { get_param: docker_version }
1006             __gerrit_branch__: { get_param: gerrit_branch }
1007             __dcae_code_version__: { get_param: dcae_code_version }
1008             __cloud_env__: { get_param: cloud_env }
1009             __public_net_id__: { get_param: public_net_id }
1010             __dcae_base_environment__: { get_param: dcae_base_environment }
1011             __dcae_ip_addr__: { get_param: dcae_ip_addr }
1012             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
1013             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
1014             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
1015             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
1016             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
1017             __external_dns__: { get_param: external_dns }
1018             __ubuntu_1404_image__: { get_param: ubuntu_1404_image }
1019             __ubuntu_1604_image__: { get_param: ubuntu_1604_image }
1020             __flavor_small__: { get_param: flavor_small }
1021             __flavor_medium__: { get_param: flavor_medium }
1022             __flavor_large__: { get_param: flavor_large }
1023             __flavor_xlarge__: { get_param: flavor_xlarge }
1024           template: |
1025             #!/bin/bash
1026
1027             # Create configuration files
1028             mkdir -p /opt/config
1029             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1030             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1031             echo "__nexus_username__" > /opt/config/nexus_username.txt
1032             echo "__nexus_password__" > /opt/config/nexus_password.txt
1033             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
1034             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1035             echo "__docker_version__" > /opt/config/docker_version.txt
1036             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1037             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1038             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1039             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
1040             echo "__dcae_state__" > /opt/config/dcae_state.txt
1041             echo "__tenant_id__" > /opt/config/tenant_id.txt
1042             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
1043             echo "__openstack_user__" > /opt/config/openstack_user.txt
1044             echo "__openstack_password__" > /opt/config/openstack_password.txt
1045             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
1046             echo "__key_name__" > /opt/config/key_name.txt
1047             echo "__rand_str__" > /opt/config/rand_str.txt
1048             echo "__pub_key__" > /opt/config/pub_key.txt
1049             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
1050             echo "__openstack_region__" > /opt/config/openstack_region.txt
1051             echo "__horizon_url__" > /opt/config/horizon_url.txt
1052             echo "__keystone_url__" > /opt/config/keystone_url.txt
1053             echo "__cloud_env__" > /opt/config/cloud_env.txt
1054             echo "__public_net_id__" > /opt/config/public_net_id.txt
1055             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
1056             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
1057             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
1058             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
1059             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
1060             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
1061             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
1062             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
1063             echo "__external_dns__" > /opt/config/external_dns.txt
1064             echo "__ubuntu_1404_image__" > /opt/config/ubuntu_1404_image.txt
1065             echo "__ubuntu_1604_image__" > /opt/config/ubuntu_1604_image.txt
1066             echo "__flavor_small__" > /opt/config/flavor_small.txt
1067             echo "__flavor_medium__" > /opt/config/flavor_medium.txt
1068             echo "__flavor_large__" > /opt/config/flavor_large.txt
1069             echo "__flavor_xlarge__" > /opt/config/flavor_xlarge.txt
1070
1071             # Download and run install script
1072             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
1073             cd /opt
1074             chmod +x dcae_install.sh
1075             ./dcae_install.sh
1076
1077
1078   # Policy Engine instantiation
1079   policy_private_port:
1080     type: OS::Neutron::Port
1081     properties:
1082       network: { get_resource: oam_ecomp }
1083       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1084
1085   policy_floating_ip:
1086     type: OS::Neutron::FloatingIP
1087     properties:
1088       floating_network_id: { get_param: public_net_id }
1089       port_id: { get_resource: policy_private_port }
1090
1091   policy_vm:
1092     type: OS::Nova::Server
1093     properties:
1094       image: { get_param: ubuntu_1404_image }
1095       flavor: { get_param: flavor_xlarge }
1096       name:
1097         str_replace: 
1098           template: base-policy
1099           params:
1100             base: { get_param: vm_base_name }
1101       key_name: { get_resource: vm_key }
1102       networks:
1103         - port: { get_resource: policy_private_port }
1104       user_data_format: RAW
1105       user_data:
1106         str_replace:
1107           params:
1108             __nexus_repo__: { get_param: nexus_repo }
1109             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1110             __nexus_username__: { get_param: nexus_username }
1111             __nexus_password__: { get_param: nexus_password }
1112             __artifacts_version__: { get_param: artifacts_version }
1113             __dns_ip_addr__: { get_param: dns_ip_addr }
1114             __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
1115             __docker_version__: { get_param: docker_version }
1116             __gerrit_branch__: { get_param: gerrit_branch }
1117             __cloud_env__: { get_param: cloud_env }
1118             __external_dns__: { get_param: external_dns }
1119           template: |
1120             #!/bin/bash
1121
1122             # Create configuration files
1123             mkdir -p /opt/config
1124             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1125             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1126             echo "__nexus_username__" > /opt/config/nexus_username.txt
1127             echo "__nexus_password__" > /opt/config/nexus_password.txt
1128             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1129             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1130             echo "__public_ip__" > /opt/config/public_ip.txt
1131             echo "__docker_version__" > /opt/config/docker_version.txt
1132             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1133             echo "__cloud_env__" > /opt/config/cloud_env.txt
1134             echo "__external_dns__" > /opt/config/external_dns.txt
1135
1136             # Download and run install script
1137             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
1138             cd /opt
1139             chmod +x policy_install.sh
1140             ./policy_install.sh
1141
1142
1143   # APP-C instantiation
1144   appc_private_port:
1145     type: OS::Neutron::Port
1146     properties:
1147       network: { get_resource: oam_ecomp }
1148       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1149
1150   appc_floating_ip:
1151     type: OS::Neutron::FloatingIP
1152     properties:
1153       floating_network_id: { get_param: public_net_id }
1154       port_id: { get_resource: appc_private_port }
1155
1156   appc_vm:
1157     type: OS::Nova::Server
1158     properties:
1159       image: { get_param: ubuntu_1404_image }
1160       flavor: { get_param: flavor_large }
1161       name:
1162         str_replace: 
1163           template: base-appc
1164           params:
1165             base: { get_param: vm_base_name }
1166       key_name: { get_resource: vm_key }
1167       networks:
1168         - port: { get_resource: appc_private_port }
1169       user_data_format: RAW
1170       user_data:
1171         str_replace:
1172           params:
1173             __nexus_repo__: { get_param: nexus_repo }
1174             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1175             __nexus_username__: { get_param: nexus_username }
1176             __nexus_password__: { get_param: nexus_password }
1177             __dmaap_topic__: { get_param: dmaap_topic }
1178             __artifacts_version__: { get_param: artifacts_version }
1179             __dns_ip_addr__: { get_param: dns_ip_addr }
1180             __docker_version__: { get_param: docker_version }
1181             __gerrit_branch__: { get_param: gerrit_branch }
1182             __cloud_env__: { get_param: cloud_env }
1183             __external_dns__: { get_param: external_dns }
1184           template: |
1185             #!/bin/bash
1186
1187             # Create configuration files
1188             mkdir -p /opt/config
1189             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1190             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1191             echo "__nexus_username__" > /opt/config/nexus_username.txt
1192             echo "__nexus_password__" > /opt/config/nexus_password.txt
1193             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1194             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1195             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1196             echo "__docker_version__" > /opt/config/docker_version.txt
1197             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1198             echo "__cloud_env__" > /opt/config/cloud_env.txt
1199             echo "__external_dns__" > /opt/config/external_dns.txt
1200
1201             # Download and run install script
1202             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
1203             cd /opt
1204             chmod +x appc_install.sh
1205             ./appc_install.sh