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