7237dee475c3441c9c55c43320cf4862f16fd0ee
[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
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
404             # Download and run install script
405             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dns_install.sh -o /opt/dns_install.sh
406             cd /opt
407             chmod +x dns_install.sh
408             ./dns_install.sh
409
410
411   # A&AI instantiation
412   aai_private_port:
413     type: OS::Neutron::Port
414     properties:
415       network: { get_resource: oam_ecomp }
416       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: aai_ip_addr }}]
417
418   aai_floating_ip:
419     type: OS::Neutron::FloatingIP
420     properties:
421       floating_network_id: { get_param: public_net_id }
422       port_id: { get_resource: aai_private_port }
423
424   aai_vm:
425     type: OS::Nova::Server
426     properties:
427       image: { get_param: ubuntu_1404_image }
428       flavor: { get_param: flavor_xlarge }
429       name: 
430         str_replace:
431           template: base-aai
432           params:
433             base: { get_param: vm_base_name }      
434       key_name: { get_resource: vm_key }
435       networks:
436         - port: { get_resource: aai_private_port }
437       user_data_format: RAW
438       user_data:
439         str_replace:
440           params:
441             __nexus_repo__: { get_param: nexus_repo }
442             __nexus_docker_repo__: { get_param: nexus_docker_repo }
443             __nexus_username__: { get_param: nexus_username }
444             __nexus_password__: { get_param: nexus_password }
445             __dmaap_topic__: { get_param: dmaap_topic }
446             __artifacts_version__: { get_param: artifacts_version }
447             __dns_ip_addr__: { get_param: dns_ip_addr }
448             __sdc_ip_addr__: { get_param: sdc_ip_addr }
449             __docker_version__: { get_param: docker_version }
450             __cloud_env__: { get_param: cloud_env }
451             __external_dns__: { get_param: external_dns }
452           template: |
453             #!/bin/bash
454
455             # Create configuration files
456             mkdir -p /opt/config
457             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
458             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
459             echo "__nexus_username__" > /opt/config/nexus_username.txt
460             echo "__nexus_password__" > /opt/config/nexus_password.txt
461             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
462             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
463             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
464             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
465             echo "__docker_version__" > /opt/config/docker_version.txt
466             echo "__cloud_env__" > /opt/config/cloud_env.txt
467             echo "__external_dns__" > /opt/config/external_dns.txt
468
469             # Download and run install script
470             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
471             cd /opt
472             chmod +x aai_install.sh
473             ./aai_install.sh
474
475
476   # MSO instantiation
477   mso_private_port:
478     type: OS::Neutron::Port
479     properties:
480       network: { get_resource: oam_ecomp }
481       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mso_ip_addr }}]
482
483   mso_floating_ip:
484     type: OS::Neutron::FloatingIP
485     properties:
486       floating_network_id: { get_param: public_net_id }
487       port_id: { get_resource: mso_private_port }
488
489   mso_vm:
490     type: OS::Nova::Server
491     properties:
492       image: { get_param: ubuntu_1604_image }
493       flavor: { get_param: flavor_large }
494       name: 
495         str_replace:
496           template: base-mso
497           params:
498             base: { get_param: vm_base_name }      
499       key_name: { get_resource: vm_key }
500       networks:
501         - port: { get_resource: mso_private_port }
502       user_data_format: RAW
503       user_data:
504         str_replace:
505           params:
506             __nexus_repo__: { get_param: nexus_repo }
507             __nexus_docker_repo__: { get_param: nexus_docker_repo }
508             __nexus_username__: { get_param: nexus_username }
509             __nexus_password__: { get_param: nexus_password }
510             __openstack_username__: { get_param: openstack_username }
511             __openstack_tenant_id__: { get_param: openstack_tenant_id }
512             __openstack_api_key__: { get_param: openstack_api_key }
513             __openstack_region__: { get_param: openstack_region }
514             __keystone_url__: { get_param: keystone_url }
515             __dmaap_topic__: { get_param: dmaap_topic }
516             __artifacts_version__: { get_param: artifacts_version }
517             __dns_ip_addr__: { get_param: dns_ip_addr }
518             __docker_version__: { get_param: docker_version }
519             __gerrit_branch__: { get_param: gerrit_branch }
520             __cloud_env__: { get_param: cloud_env }
521             __external_dns__: { get_param: external_dns }
522           template: |
523             #!/bin/bash
524
525             # Create configuration files
526             mkdir -p /opt/config
527             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
528             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
529             echo "__nexus_username__" > /opt/config/nexus_username.txt
530             echo "__nexus_password__" > /opt/config/nexus_password.txt
531             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
532             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
533             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
534             echo "__openstack_username__" > /opt/config/openstack_username.txt
535             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
536             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
537             echo "__openstack_region__" > /opt/config/openstack_region.txt
538             echo "__keystone_url__" > /opt/config/keystone.txt
539             echo "__docker_version__" > /opt/config/docker_version.txt
540             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
541             echo "__cloud_env__" > /opt/config/cloud_env.txt
542             echo "__external_dns__" > /opt/config/external_dns.txt
543
544             # Download and run install script
545             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
546             cd /opt
547             chmod +x mso_install.sh
548             ./mso_install.sh
549
550
551   # Message Router instantiation
552   mrouter_private_port:
553     type: OS::Neutron::Port
554     properties:
555       network: { get_resource: oam_ecomp }
556       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mr_ip_addr }}]
557
558   mrouter_floating_ip:
559     type: OS::Neutron::FloatingIP
560     properties:
561       floating_network_id: { get_param: public_net_id }
562       port_id: { get_resource: mrouter_private_port }
563
564   mrouter_vm:
565     type: OS::Nova::Server
566     properties:
567       image: { get_param: ubuntu_1404_image }
568       flavor: { get_param: flavor_large }
569       name: 
570         str_replace: 
571           template: base-message-router
572           params:
573             base: { get_param: vm_base_name }
574       key_name: { get_resource: vm_key }
575       networks:
576         - port: { get_resource: mrouter_private_port }
577       user_data_format: RAW
578       user_data:
579         str_replace:
580           params:
581             __nexus_repo__: { get_param: nexus_repo }
582             __nexus_docker_repo__: { get_param: nexus_docker_repo }
583             __nexus_username__: { get_param: nexus_username }
584             __nexus_password__: { get_param: nexus_password }
585             __artifacts_version__: { get_param: artifacts_version }
586             __dns_ip_addr__: { get_param: dns_ip_addr }
587             __gerrit_branch__: { get_param: gerrit_branch }
588             __cloud_env__: { get_param: cloud_env }
589             __external_dns__: { get_param: external_dns }
590           template: |
591             #!/bin/bash
592
593             # Create configuration files
594             mkdir -p /opt/config
595             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
596             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
597             echo "__nexus_username__" > /opt/config/nexus_username.txt
598             echo "__nexus_password__" > /opt/config/nexus_password.txt
599             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
600             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
601             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
602             echo "__cloud_env__" > /opt/config/cloud_env.txt
603             echo "__external_dns__" > /opt/config/external_dns.txt
604
605             # Download and run install script
606             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
607             cd /opt
608             chmod +x mr_install.sh
609             ./mr_install.sh
610
611
612   # Robot Framework instantiation
613   robot_private_port:
614     type: OS::Neutron::Port
615     properties:
616       network: { get_resource: oam_ecomp }
617       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
618
619   robot_floating_ip:
620     type: OS::Neutron::FloatingIP
621     properties:
622       floating_network_id: { get_param: public_net_id }
623       port_id: { get_resource: robot_private_port }
624  
625   robot_vm:
626     type: OS::Nova::Server
627     properties:
628       image: { get_param: ubuntu_1604_image }
629       flavor: { get_param: flavor_small }
630       name: 
631         str_replace: 
632           template: base-robot
633           params:
634             base: { get_param: vm_base_name }
635       key_name: { get_resource: vm_key }
636       networks:
637         - port: { get_resource: robot_private_port }
638       user_data_format: RAW
639       user_data:
640         str_replace:
641           params:
642             __nexus_repo__: { get_param: nexus_repo }
643             __nexus_docker_repo__: { get_param: nexus_docker_repo }
644             __nexus_username__: { get_param: nexus_username }
645             __nexus_password__: { get_param: nexus_password }
646             __network_name__: { get_attr: [oam_ecomp, name] }
647             __openstack_username__: { get_param: openstack_username }
648             __openstack_api_key__: { get_param : openstack_api_key }
649             __artifacts_version__: { get_param: artifacts_version }
650             __openstack_region__: { get_param: openstack_region }
651             __dns_ip_addr__: { get_param: dns_ip_addr }
652             __docker_version__: { get_param: docker_version }
653             __gerrit_branch__: { get_param: gerrit_branch }
654             __cloud_env__: { get_param: cloud_env }
655             __external_dns__: { get_param: external_dns }
656           template: |
657             #!/bin/bash
658
659             # Create configuration files
660             mkdir -p /opt/config
661             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
662             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
663             echo "__nexus_username__" > /opt/config/nexus_username.txt
664             echo "__nexus_password__" > /opt/config/nexus_password.txt
665             echo "__network_name__" > /opt/config/network.txt
666             echo "__openstack_username__" > /opt/config/openstack_username.txt
667             echo "__openstack_api_key__" > /opt/config/openstack_password.txt
668             echo "__openstack_region__" > /opt/config/region.txt
669             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
670             echo "__docker_version__" > /opt/config/docker_version.txt
671             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
672             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
673             echo "__cloud_env__" > /opt/config/cloud_env.txt
674             echo "__external_dns__" > /opt/config/external_dns.txt
675
676             # Download and run install script
677             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
678             cd /opt
679             chmod +x robot_install.sh
680             ./robot_install.sh
681
682
683   # VID instantiation
684   vid_private_port:
685     type: OS::Neutron::Port
686     properties:
687       network: { get_resource: oam_ecomp }
688       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: vid_ip_addr }}]
689
690   vid_floating_ip:
691     type: OS::Neutron::FloatingIP
692     properties:
693       floating_network_id: { get_param: public_net_id }
694       port_id: { get_resource: vid_private_port }
695
696   vid_vm:
697     type: OS::Nova::Server
698     properties:
699       image: { get_param: ubuntu_1404_image }
700       flavor: { get_param: flavor_medium }
701       name: 
702         str_replace: 
703           template: base-vid
704           params:
705             base: { get_param: vm_base_name }
706       key_name: { get_resource: vm_key }
707       networks:
708         - port: { get_resource: vid_private_port }
709       user_data_format: RAW
710       user_data:
711         str_replace:
712           params:
713             __nexus_repo__: { get_param: nexus_repo }
714             __nexus_docker_repo__: { get_param: nexus_docker_repo }
715             __nexus_username__: { get_param: nexus_username }
716             __nexus_password__: { get_param: nexus_password }
717             __artifacts_version__: { get_param: artifacts_version }
718             __dns_ip_addr__: { get_param: dns_ip_addr }
719             __docker_version__: { get_param: docker_version }
720             __gerrit_branch__: { get_param: gerrit_branch }
721             __cloud_env__: { get_param: cloud_env }
722             __external_dns__: { get_param: external_dns }
723           template: |
724             #!/bin/bash
725
726             # Create configuration files
727             mkdir -p /opt/config
728             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
729             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
730             echo "__nexus_username__" > /opt/config/nexus_username.txt
731             echo "__nexus_password__" > /opt/config/nexus_password.txt
732             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
733             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
734             echo "__docker_version__" > /opt/config/docker_version.txt
735             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
736             echo "__cloud_env__" > /opt/config/cloud_env.txt
737             echo "__external_dns__" > /opt/config/external_dns.txt
738
739             # Download and run install script
740             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
741             cd /opt
742             chmod +x vid_install.sh
743             ./vid_install.sh
744
745  
746   # SDN-C instantiation
747   sdnc_private_port:
748     type: OS::Neutron::Port
749     properties:
750       network: { get_resource: oam_ecomp }
751       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
752
753   sdnc_floating_ip:
754     type: OS::Neutron::FloatingIP
755     properties:
756       floating_network_id: { get_param: public_net_id }
757       port_id: { get_resource: sdnc_private_port }
758
759   sdnc_vm:
760     type: OS::Nova::Server
761     properties:
762       image: { get_param: ubuntu_1404_image }
763       flavor: { get_param: flavor_large }
764       name: 
765         str_replace: 
766           template: base-sdnc
767           params:
768             base: { get_param: vm_base_name }
769       key_name: { get_resource: vm_key }
770       networks:
771         - port: { get_resource: sdnc_private_port }
772       user_data_format: RAW
773       user_data:
774         str_replace:
775           params:
776             __nexus_repo__: { get_param: nexus_repo }
777             __nexus_docker_repo__: { get_param: nexus_docker_repo }
778             __nexus_username__: { get_param: nexus_username }
779             __nexus_password__: { get_param: nexus_password }
780             __artifacts_version__: { get_param: artifacts_version }
781             __dns_ip_addr__: { get_param: dns_ip_addr }
782             __docker_version__: { get_param: docker_version }
783             __gerrit_branch__: { get_param: gerrit_branch }
784             __cloud_env__: { get_param: cloud_env }
785             __external_dns__: { get_param: external_dns }
786           template: |
787             #!/bin/bash
788
789             # Create configuration files
790             mkdir -p /opt/config
791             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
792             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
793             echo "__nexus_username__" > /opt/config/nexus_username.txt
794             echo "__nexus_password__" > /opt/config/nexus_password.txt
795             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
796             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
797             echo "__docker_version__" > /opt/config/docker_version.txt
798             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
799             echo "__cloud_env__" > /opt/config/cloud_env.txt
800             echo "__external_dns__" > /opt/config/external_dns.txt
801
802             # Download and run install script
803             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
804             cd /opt
805             chmod +x sdnc_install.sh
806             ./sdnc_install.sh
807
808
809   # SDC instantiation
810   sdc_private_port:
811     type: OS::Neutron::Port
812     properties:
813       network: { get_resource: oam_ecomp }
814       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
815
816   sdc_floating_ip:
817     type: OS::Neutron::FloatingIP
818     properties:
819       floating_network_id: { get_param: public_net_id }
820       port_id: { get_resource: sdc_private_port }
821
822   sdc_volume_data:
823     type: OS::Cinder::Volume
824     properties:
825       name: vol1-sdc-data
826       size: 100
827
828   sdc_vm:
829     type: OS::Nova::Server
830     properties:
831       image: { get_param: ubuntu_1604_image }
832       flavor: { get_param: flavor_xlarge }
833       name: 
834         str_replace: 
835           template: base-sdc
836           params:
837             base: { get_param: vm_base_name }
838       key_name: { get_resource: vm_key }
839       networks:
840         - port: { get_resource: sdc_private_port }
841       block_device_mapping:
842         - device_name: /dev/vdb
843           volume_id: {get_resource: sdc_volume_data}
844       user_data_format: RAW
845       user_data:
846         str_replace:
847           params:
848             __nexus_repo__: { get_param: nexus_repo }
849             __nexus_docker_repo__: { get_param: nexus_docker_repo }
850             __nexus_username__: { get_param: nexus_username }
851             __nexus_password__: { get_param: nexus_password }
852             __env_name__: { get_param: dmaap_topic }
853             __artifacts_version__: { get_param: artifacts_version }
854             __dns_ip_addr__: { get_param: dns_ip_addr }
855             __mr_ip_addr__: { get_param: mr_ip_addr }
856             __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
857             __docker_version__: { get_param: docker_version }
858             __gerrit_branch__: { get_param: gerrit_branch }
859             __cloud_env__: { get_param: cloud_env }
860             __external_dns__: { get_param: external_dns }
861           template: |
862             #!/bin/bash
863
864             # Create configuration files
865             mkdir -p /opt/config
866             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
867             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
868             echo "__nexus_username__" > /opt/config/nexus_username.txt
869             echo "__nexus_password__" > /opt/config/nexus_password.txt
870             echo "__env_name__" > /opt/config/env_name.txt
871             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
872             echo "__public_ip__" > /opt/config/public_ip.txt
873             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
874             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
875             echo "__docker_version__" > /opt/config/docker_version.txt
876             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
877             echo "__cloud_env__" > /opt/config/cloud_env.txt
878             echo "__external_dns__" > /opt/config/external_dns.txt
879
880             # Download and run install script
881             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_install.sh -o /opt/asdc_install.sh
882             cd /opt
883             chmod +x asdc_install.sh
884             ./asdc_install.sh
885
886
887   # PORTAL instantiation
888   portal_private_port:
889     type: OS::Neutron::Port
890     properties:
891       network: { get_resource: oam_ecomp }
892       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: portal_ip_addr }}]
893
894   portal_floating_ip:
895     type: OS::Neutron::FloatingIP
896     properties:
897       floating_network_id: { get_param: public_net_id }
898       port_id: { get_resource: portal_private_port }
899
900   portal_vm:
901     type: OS::Nova::Server
902     properties:
903       image: { get_param: ubuntu_1404_image }
904       flavor: { get_param: flavor_large }
905       name: 
906         str_replace: 
907           template: base-portal
908           params:
909             base: { get_param: vm_base_name }
910       key_name: { get_resource: vm_key }
911       networks:
912         - port: { get_resource: portal_private_port }
913       user_data_format: RAW
914       user_data:
915         str_replace:
916           params:
917             __nexus_repo__: { get_param: nexus_repo }
918             __nexus_docker_repo__: { get_param: nexus_docker_repo }
919             __nexus_username__: { get_param: nexus_username }
920             __nexus_password__: { get_param: nexus_password }
921             __artifacts_version__: { get_param: artifacts_version }
922             __dns_ip_addr__: { get_param: dns_ip_addr }
923             __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
924             __docker_version__: { get_param: docker_version }
925             __gerrit_branch__: { get_param: gerrit_branch }
926             __cloud_env__: { get_param: cloud_env }
927             __external_dns__: { get_param: external_dns }
928           template: |
929             #!/bin/bash
930
931             # Create configuration files
932             mkdir -p /opt/config
933             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
934             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
935             echo "__nexus_username__" > /opt/config/nexus_username.txt
936             echo "__nexus_password__" > /opt/config/nexus_password.txt
937             echo "__public_ip__" > /opt/config/public_ip.txt
938             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
939             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
940             echo "__docker_version__" > /opt/config/docker_version.txt
941             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
942             echo "__cloud_env__" > /opt/config/cloud_env.txt
943             echo "__external_dns__" > /opt/config/external_dns.txt
944
945             # Download and run install script
946             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
947             cd /opt
948             chmod +x portal_install.sh
949             ./portal_install.sh
950
951
952   # DCAE Controller instantiation
953   dcae_c_private_port:
954     type: OS::Neutron::Port
955     properties:
956       network: { get_resource: oam_ecomp }
957       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
958
959   dcae_c_floating_ip:
960     type: OS::Neutron::FloatingIP
961     properties:
962       floating_network_id: { get_param: public_net_id }
963       port_id: { get_resource: dcae_c_private_port }
964
965   dcae_c_vm:
966     type: OS::Nova::Server
967     properties:
968       image: { get_param: ubuntu_1404_image }
969       flavor: { get_param: flavor_medium }
970       name: 
971         str_replace: 
972           template: base-dcae-controller
973           params:
974             base: { get_param: vm_base_name }
975       key_name: { get_resource: vm_key }
976       networks:
977         - port: { get_resource: dcae_c_private_port }
978       user_data_format: RAW
979       user_data:
980         str_replace:
981           params:
982             __nexus_repo__: { get_param: nexus_repo }
983             __nexus_docker_repo__: { get_param: nexus_docker_repo }
984             __nexus_username__: { get_param: nexus_username }
985             __nexus_password__: { get_param: nexus_password }
986             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
987             __gitlab_branch__: { get_param: gitlab_branch }
988             __dns_ip_addr__: { get_param: dns_ip_addr }
989             __dcae_zone__: { get_param: dcae_zone }
990             __dcae_state__: { get_param: dcae_state }
991             __artifacts_version__: { get_param: artifacts_version }
992             __tenant_id__: { get_param: openstack_tenant_id }
993             __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
994             __openstack_user__: { get_param: openstack_username }
995             __openstack_password__: { get_param: openstack_api_key }
996             __openstack_auth_method__: { get_param: openstack_auth_method }
997             __key_name__: { get_param: key_name }
998             __rand_str__: { get_resource: random-str }
999             __pub_key__: { get_param: pub_key }
1000             __nexus_repo_root__: { get_param: nexus_repo_root }
1001             __openstack_region__: { get_param: openstack_region }
1002             __horizon_url__: { get_param: horizon_url }
1003             __keystone_url__: { get_param: keystone_url }
1004             __docker_version__: { get_param: docker_version }
1005             __gerrit_branch__: { get_param: gerrit_branch }
1006             __dcae_code_version__: { get_param: dcae_code_version }
1007             __cloud_env__: { get_param: cloud_env }
1008             __public_net_id__: { get_param: public_net_id }
1009             __dcae_base_environment__: { get_param: dcae_base_environment }
1010             __dcae_ip_addr__: { get_param: dcae_ip_addr }
1011             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
1012             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
1013             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
1014             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
1015             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
1016             __external_dns__: { get_param: external_dns }
1017             __ubuntu_1404_image__: { get_param: ubuntu_1404_image }
1018             __ubuntu_1604_image__: { get_param: ubuntu_1604_image }
1019             __flavor_small__: { get_param: flavor_small }
1020             __flavor_medium__: { get_param: flavor_medium }
1021             __flavor_large__: { get_param: flavor_large }
1022             __flavor_xlarge__: { get_param: flavor_xlarge }
1023           template: |
1024             #!/bin/bash
1025
1026             # Create configuration files
1027             mkdir -p /opt/config
1028             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1029             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1030             echo "__nexus_username__" > /opt/config/nexus_username.txt
1031             echo "__nexus_password__" > /opt/config/nexus_password.txt
1032             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
1033             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1034             echo "__docker_version__" > /opt/config/docker_version.txt
1035             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1036             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1037             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1038             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
1039             echo "__dcae_state__" > /opt/config/dcae_state.txt
1040             echo "__tenant_id__" > /opt/config/tenant_id.txt
1041             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
1042             echo "__openstack_user__" > /opt/config/openstack_user.txt
1043             echo "__openstack_password__" > /opt/config/openstack_password.txt
1044             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
1045             echo "__key_name__" > /opt/config/key_name.txt
1046             echo "__rand_str__" > /opt/config/rand_str.txt
1047             echo "__pub_key__" > /opt/config/pub_key.txt
1048             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
1049             echo "__openstack_region__" > /opt/config/openstack_region.txt
1050             echo "__horizon_url__" > /opt/config/horizon_url.txt
1051             echo "__keystone_url__" > /opt/config/keystone_url.txt
1052             echo "__cloud_env__" > /opt/config/cloud_env.txt
1053             echo "__public_net_id__" > /opt/config/public_net_id.txt
1054             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
1055             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
1056             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
1057             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
1058             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
1059             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
1060             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
1061             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
1062             echo "__external_dns__" > /opt/config/external_dns.txt
1063             echo "__ubuntu_1404_image__" > /opt/config/ubuntu_1404_image.txt
1064             echo "__ubuntu_1604_image__" > /opt/config/ubuntu_1604_image.txt
1065             echo "__flavor_small__" > /opt/config/flavor_small.txt
1066             echo "__flavor_medium__" > /opt/config/flavor_medium.txt
1067             echo "__flavor_large__" > /opt/config/flavor_large.txt
1068             echo "__flavor_xlarge__" > /opt/config/flavor_xlarge.txt
1069
1070             # Download and run install script
1071             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
1072             cd /opt
1073             chmod +x dcae_install.sh
1074             ./dcae_install.sh
1075
1076
1077   # Policy Engine instantiation
1078   policy_private_port:
1079     type: OS::Neutron::Port
1080     properties:
1081       network: { get_resource: oam_ecomp }
1082       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1083
1084   policy_floating_ip:
1085     type: OS::Neutron::FloatingIP
1086     properties:
1087       floating_network_id: { get_param: public_net_id }
1088       port_id: { get_resource: policy_private_port }
1089
1090   policy_vm:
1091     type: OS::Nova::Server
1092     properties:
1093       image: { get_param: ubuntu_1404_image }
1094       flavor: { get_param: flavor_xlarge }
1095       name: 
1096         str_replace: 
1097           template: base-policy
1098           params:
1099             base: { get_param: vm_base_name }
1100       key_name: { get_resource: vm_key }
1101       networks:
1102         - port: { get_resource: policy_private_port }
1103       user_data_format: RAW
1104       user_data:
1105         str_replace:
1106           params:
1107             __nexus_repo__: { get_param: nexus_repo }
1108             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1109             __nexus_username__: { get_param: nexus_username }
1110             __nexus_password__: { get_param: nexus_password }
1111             __artifacts_version__: { get_param: artifacts_version }
1112             __dns_ip_addr__: { get_param: dns_ip_addr }
1113             __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
1114             __docker_version__: { get_param: docker_version }
1115             __gerrit_branch__: { get_param: gerrit_branch }
1116             __cloud_env__: { get_param: cloud_env }
1117             __external_dns__: { get_param: external_dns }
1118           template: |
1119             #!/bin/bash
1120
1121             # Create configuration files
1122             mkdir -p /opt/config
1123             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1124             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1125             echo "__nexus_username__" > /opt/config/nexus_username.txt
1126             echo "__nexus_password__" > /opt/config/nexus_password.txt
1127             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1128             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1129             echo "__public_ip__" > /opt/config/public_ip.txt
1130             echo "__docker_version__" > /opt/config/docker_version.txt
1131             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1132             echo "__cloud_env__" > /opt/config/cloud_env.txt
1133             echo "__external_dns__" > /opt/config/external_dns.txt
1134
1135             # Download and run install script
1136             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
1137             cd /opt
1138             chmod +x policy_install.sh
1139             ./policy_install.sh
1140
1141
1142   # APP-C instantiation
1143   appc_private_port:
1144     type: OS::Neutron::Port
1145     properties:
1146       network: { get_resource: oam_ecomp }
1147       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1148
1149   appc_floating_ip:
1150     type: OS::Neutron::FloatingIP
1151     properties:
1152       floating_network_id: { get_param: public_net_id }
1153       port_id: { get_resource: appc_private_port }
1154
1155   appc_vm:
1156     type: OS::Nova::Server
1157     properties:
1158       image: { get_param: ubuntu_1404_image }
1159       flavor: { get_param: flavor_large }
1160       name: 
1161         str_replace: 
1162           template: base-appc
1163           params:
1164             base: { get_param: vm_base_name }
1165       key_name: { get_resource: vm_key }
1166       networks:
1167         - port: { get_resource: appc_private_port }
1168       user_data_format: RAW
1169       user_data:
1170         str_replace:
1171           params:
1172             __nexus_repo__: { get_param: nexus_repo }
1173             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1174             __nexus_username__: { get_param: nexus_username }
1175             __nexus_password__: { get_param: nexus_password }
1176             __dmaap_topic__: { get_param: dmaap_topic }
1177             __artifacts_version__: { get_param: artifacts_version }
1178             __dns_ip_addr__: { get_param: dns_ip_addr }
1179             __docker_version__: { get_param: docker_version }
1180             __gerrit_branch__: { get_param: gerrit_branch }
1181             __cloud_env__: { get_param: cloud_env }
1182             __external_dns__: { get_param: external_dns }
1183           template: |
1184             #!/bin/bash
1185
1186             # Create configuration files
1187             mkdir -p /opt/config
1188             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1189             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1190             echo "__nexus_username__" > /opt/config/nexus_username.txt
1191             echo "__nexus_password__" > /opt/config/nexus_password.txt
1192             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1193             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1194             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1195             echo "__docker_version__" > /opt/config/docker_version.txt
1196             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1197             echo "__cloud_env__" > /opt/config/cloud_env.txt
1198             echo "__external_dns__" > /opt/config/external_dns.txt
1199
1200             # Download and run install script
1201             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
1202             cd /opt
1203             chmod +x appc_install.sh
1204             ./appc_install.sh