2eb0c251fb4df0d3e1c4b6036da78cb7595963b1
[demo.git] / heat / OpenECOMP / onap_openstack_nofloat.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4
5 #
6 # Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2013-05-23
26
27 description: Heat template to 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   external_dns:
151     type: string
152     description: External DNS for OAM ONAP network
153
154   ### Private IP addresses ###
155   oam_network_cidr:
156     type: string
157     description: CIDR of the OAM ONAP network
158
159   aai_ip_addr:
160     type: string
161     description: AAI IP Address
162
163   appc_ip_addr:
164     type: string
165     description: APP-C IP Address
166
167   dcae_ip_addr:
168     type: string
169     description: DCAE IP Address
170  
171   dcae_coll_ip_addr:
172     type: string
173     description: DCAE Collector IP Address
174
175   dcae_db_ip_addr:
176     type: string
177     description: DCAE Database IP Address
178
179   dcae_hdp1_ip_addr:
180     type: string
181     description: Hadoop VM1 IP Address
182
183   dcae_hdp2_ip_addr:
184     type: string
185     description: Hadoop VM2 IP Address
186
187   dcae_hdp3_ip_addr:
188     type: string
189     description: Hadoop VM3 IP Address
190
191   dns_ip_addr:
192     type: string
193     description: DNS IP Address
194
195   mso_ip_addr:
196     type: string
197     description: MSO IP Address
198
199   mr_ip_addr:
200     type: string
201     description: Message Router IP Address
202
203   policy_ip_addr:
204     type: string
205     description: Policy Engine IP Address
206
207   portal_ip_addr:
208     type: string
209     description: Portal IP Address
210
211   robot_ip_addr:
212     type: string
213     description: Robot Framework IP Address
214
215   sdc_ip_addr:
216     type: string
217     description: SDC IP Address
218
219   sdnc_ip_addr:
220     type: string
221     description: SDN-C IP Address
222
223   vid_ip_addr:
224     type: string
225     description: VID IP Address
226
227
228   ###########################
229   #                         #
230   # Parameters used by DCAE #
231   #                         #
232   ###########################
233
234   dcae_base_environment:
235     type: string
236     description: DCAE Base Environment configuration (RACKSPACE/2-NIC/1-NIC-FLOATING-IPS)
237
238   dcae_zone:
239     type: string
240     description: DCAE Zone to use in VM names created by DCAE controller
241
242   dcae_state:
243     type: string
244     description: DCAE State to use in VM names created by DCAE controller
245
246   nexus_repo_root:
247     type: string
248     description: Root URL of Nexus repository
249
250   nexus_url_snapshot:
251     type: string
252     description: Snapshot of Maven repository for DCAE deployment
253
254   openstack_region:
255     type: string
256     description: Region where the DCAE controller will spin the VMs
257
258   gitlab_branch:
259     type: string
260     description: Branch of the Gitlab repository
261     
262   dcae_code_version:
263     type: string
264     description: DCAE Code Version Number
265
266
267 #############
268 #           #
269 # RESOURCES #
270 #           #
271 #############
272
273 resources:
274   random-str:
275     type: OS::Heat::RandomString
276     properties:
277       length: 4
278
279
280   # Public key used to access ONAP components
281   vm_key:
282     type: OS::Nova::KeyPair
283     properties:
284       name:
285         str_replace:
286           template: base_rand
287           params:
288             base: { get_param: key_name }
289             rand: { get_resource: random-str }
290       public_key: { get_param: pub_key }
291       save_private_key: false
292
293
294   # ONAP management private network
295   oam_ecomp:
296     type: OS::Neutron::Net
297     properties:
298       name:
299         str_replace:
300           template: oam_ecomp_rand
301           params:
302             rand: { get_resource: random-str }
303
304   oam_ecomp_subnet:
305     type: OS::Neutron::Subnet
306     properties:
307       name:
308         str_replace:
309           template: oam_ecomp_rand
310           params:
311             rand: { get_resource: random-str }
312       network_id: { get_resource: oam_ecomp }
313       cidr: { get_param: oam_network_cidr }
314
315
316   # DNS Server instantiation
317   dns_private_port:
318     type: OS::Neutron::Port
319     properties:
320       network: { get_resource: oam_ecomp }
321       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dns_ip_addr }}]
322
323   dns_vm:
324     type: OS::Nova::Server
325     properties:
326       image: { get_param: ubuntu_1404_image }
327       flavor: { get_param: flavor_small }
328       name: 
329         str_replace:
330           template: base-dns-server
331           params:
332             base: { get_param: vm_base_name }
333       key_name: { get_resource: vm_key }
334       networks:
335         - network: { get_param: public_net_id }
336         - port: { get_resource: dns_private_port }
337       user_data_format: RAW
338       user_data:
339         str_replace:
340           params:
341             __nexus_repo__: { get_param: nexus_repo }
342             __artifacts_version__: { get_param: artifacts_version }
343             __oam_network_cidr__: { get_param: oam_network_cidr }
344             __dns_ip_addr__: { get_param: dns_ip_addr }
345             __aai_ip_addr__: { get_param: aai_ip_addr }
346             __appc_ip_addr__: { get_param: appc_ip_addr }
347             __dcae_ip_addr__: { get_param: dcae_ip_addr }
348             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
349             __mso_ip_addr__: { get_param: mso_ip_addr }
350             __mr_ip_addr__: { get_param: mr_ip_addr }
351             __policy_ip_addr__: { get_param: policy_ip_addr }
352             __portal_ip_addr__: { get_param: portal_ip_addr }
353             __robot_ip_addr__: { get_param: robot_ip_addr }
354             __sdc_ip_addr__: { get_param: sdc_ip_addr }
355             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
356             __vid_ip_addr__: { get_param: vid_ip_addr }
357             __cloud_env__: { get_param: cloud_env }
358
359           template: |
360             #!/bin/bash
361
362             # Create configuration files
363             mkdir -p /opt/config
364             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
365             echo "__cloud_env__" > /opt/config/cloud_env.txt
366             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
367             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
368             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
369             echo "__aai_ip_addr__" > /opt/config/aai_ip_addr.txt
370             echo "__appc_ip_addr__" > /opt/config/appc_ip_addr.txt
371             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
372             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
373             echo "__mso_ip_addr__" > /opt/config/mso_ip_addr.txt
374             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
375             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
376             echo "__portal_ip_addr__" > /opt/config/portal_ip_addr.txt
377             echo "__robot_ip_addr__" > /opt/config/robot_ip_addr.txt
378             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
379             echo "__sdnc_ip_addr__" > /opt/config/sdnc_ip_addr.txt
380             echo "__vid_ip_addr__" > /opt/config/vid_ip_addr.txt
381
382             # Download and run install script
383             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dns_install.sh -o /opt/dns_install.sh
384             cd /opt
385             chmod +x dns_install.sh
386             ./dns_install.sh
387
388
389   # A&AI instantiation
390   aai_private_port:
391     type: OS::Neutron::Port
392     properties:
393       network: { get_resource: oam_ecomp }
394       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: aai_ip_addr }}]
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         - network: { get_param: public_net_id }
409         - port: { get_resource: aai_private_port }
410       user_data_format: RAW
411       user_data:
412         str_replace:
413           params:
414             __nexus_repo__: { get_param: nexus_repo }
415             __nexus_docker_repo__: { get_param: nexus_docker_repo }
416             __nexus_username__: { get_param: nexus_username }
417             __nexus_password__: { get_param: nexus_password }
418             __dmaap_topic__: { get_param: dmaap_topic }
419             __artifacts_version__: { get_param: artifacts_version }
420             __dns_ip_addr__: { get_param: dns_ip_addr }
421             __aai_ip_addr__: { get_param: aai_ip_addr }
422             __sdc_ip_addr__: { get_param: sdc_ip_addr }
423             __oam_network_cidr__: { get_param: oam_network_cidr }
424             __docker_version__: { get_param: docker_version }
425             __cloud_env__: { get_param: cloud_env }
426             __external_dns__: { get_param: external_dns }
427           template: |
428             #!/bin/bash
429
430             # Create configuration files
431             mkdir -p /opt/config
432             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
433             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
434             echo "__nexus_username__" > /opt/config/nexus_username.txt
435             echo "__nexus_password__" > /opt/config/nexus_password.txt
436             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
437             echo "__aai_ip_addr__" > /opt/config/local_ip_addr.txt
438             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
439             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
440             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
441             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
442             echo "__docker_version__" > /opt/config/docker_version.txt
443             echo "__cloud_env__" > /opt/config/cloud_env.txt
444             echo "__external_dns__" > /opt/config/external_dns.txt
445
446             # Download and run install script
447             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
448             cd /opt
449             chmod +x aai_install.sh
450             ./aai_install.sh
451
452
453   # MSO instantiation
454   mso_private_port:
455     type: OS::Neutron::Port
456     properties:
457       network: { get_resource: oam_ecomp }
458       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mso_ip_addr }}]
459
460   mso_vm:
461     type: OS::Nova::Server
462     properties:
463       image: { get_param: ubuntu_1604_image }
464       flavor: { get_param: flavor_large }
465       name: 
466         str_replace:
467           template: base-mso
468           params:
469             base: { get_param: vm_base_name }      
470       key_name: { get_resource: vm_key }
471       networks:
472         - network: { get_param: public_net_id }
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             __openstack_region__: { get_param: openstack_region }
486             __keystone_url__: { get_param: keystone_url }
487             __dmaap_topic__: { get_param: dmaap_topic }
488             __artifacts_version__: { get_param: artifacts_version }
489             __dns_ip_addr__: { get_param: dns_ip_addr }
490             __mso_ip_addr__: { get_param: mso_ip_addr }
491             __oam_network_cidr__: { get_param: oam_network_cidr }
492             __docker_version__: { get_param: docker_version }
493             __gerrit_branch__: { get_param: gerrit_branch }
494             __cloud_env__: { get_param: cloud_env }
495             __external_dns__: { get_param: external_dns }
496           template: |
497             #!/bin/bash
498
499             # Create configuration files
500             mkdir -p /opt/config
501             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
502             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
503             echo "__nexus_username__" > /opt/config/nexus_username.txt
504             echo "__nexus_password__" > /opt/config/nexus_password.txt
505             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
506             echo "__mso_ip_addr__" > /opt/config/local_ip_addr.txt
507             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
508             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
509             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
510             echo "__openstack_username__" > /opt/config/openstack_username.txt
511             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
512             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
513             echo "__openstack_region__" > /opt/config/openstack_region.txt
514             echo "__keystone_url__" > /opt/config/keystone.txt
515             echo "__docker_version__" > /opt/config/docker_version.txt
516             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
517             echo "__cloud_env__" > /opt/config/cloud_env.txt
518             echo "__external_dns__" > /opt/config/external_dns.txt
519
520             # Download and run install script
521             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
522             cd /opt
523             chmod +x mso_install.sh
524             ./mso_install.sh
525
526
527   # Message Router instantiation
528   mrouter_private_port:
529     type: OS::Neutron::Port
530     properties:
531       network: { get_resource: oam_ecomp }
532       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mr_ip_addr }}]
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         - network: { get_param: public_net_id }
547         - port: { get_resource: mrouter_private_port }
548       user_data_format: RAW
549       user_data:
550         str_replace:
551           params:
552             __nexus_repo__: { get_param: nexus_repo }
553             __nexus_docker_repo__: { get_param: nexus_docker_repo }
554             __nexus_username__: { get_param: nexus_username }
555             __nexus_password__: { get_param: nexus_password }
556             __artifacts_version__: { get_param: artifacts_version }
557             __mr_ip_addr__: { get_param: mr_ip_addr }
558             __dns_ip_addr__: { get_param: dns_ip_addr }
559             __oam_network_cidr__: { get_param: oam_network_cidr }
560             __gerrit_branch__: { get_param: gerrit_branch }
561             __cloud_env__: { get_param: cloud_env }
562             __external_dns__: { get_param: external_dns }
563           template: |
564             #!/bin/bash
565
566             # Create configuration files
567             mkdir -p /opt/config
568             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
569             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
570             echo "__nexus_username__" > /opt/config/nexus_username.txt
571             echo "__nexus_password__" > /opt/config/nexus_password.txt
572             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
573             echo "__mr_ip_addr__" > /opt/config/local_ip_addr.txt
574             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
575             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
576             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
577             echo "__cloud_env__" > /opt/config/cloud_env.txt
578             echo "__external_dns__" > /opt/config/external_dns.txt
579
580             # Download and run install script
581             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
582             cd /opt
583             chmod +x mr_install.sh
584             ./mr_install.sh
585
586
587   # Robot Framework instantiation
588   robot_private_port:
589     type: OS::Neutron::Port
590     properties:
591       network: { get_resource: oam_ecomp }
592       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
593  
594   robot_vm:
595     type: OS::Nova::Server
596     properties:
597       image: { get_param: ubuntu_1604_image }
598       flavor: { get_param: flavor_small }
599       name: 
600         str_replace: 
601           template: base-robot
602           params:
603             base: { get_param: vm_base_name }
604       key_name: { get_resource: vm_key }
605       networks:
606         - network: { get_param: public_net_id }
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             __robot_ip_addr__: { get_param: robot_ip_addr }
622             __dns_ip_addr__: { get_param: dns_ip_addr }
623             __oam_network_cidr__: { get_param: oam_network_cidr }
624             __docker_version__: { get_param: docker_version }
625             __gerrit_branch__: { get_param: gerrit_branch }
626             __cloud_env__: { get_param: cloud_env }
627             __external_dns__: { get_param: external_dns }
628           template: |
629             #!/bin/bash
630
631             # Create configuration files
632             mkdir -p /opt/config
633             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
634             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
635             echo "__nexus_username__" > /opt/config/nexus_username.txt
636             echo "__nexus_password__" > /opt/config/nexus_password.txt
637             echo "__network_name__" > /opt/config/network.txt
638             echo "__openstack_username__" > /opt/config/openstack_username.txt
639             echo "__openstack_api_key__" > /opt/config/openstack_password.txt
640             echo "__openstack_region__" > /opt/config/region.txt
641             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
642             echo "__robot_ip_addr__" > /opt/config/local_ip_addr.txt
643             echo "__docker_version__" > /opt/config/docker_version.txt
644             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
645             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
646             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
647             echo "__cloud_env__" > /opt/config/cloud_env.txt
648             echo "__external_dns__" > /opt/config/external_dns.txt
649
650             # Download and run install script
651             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
652             cd /opt
653             chmod +x robot_install.sh
654             ./robot_install.sh
655
656
657   # VID instantiation
658   vid_private_port:
659     type: OS::Neutron::Port
660     properties:
661       network: { get_resource: oam_ecomp }
662       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: vid_ip_addr }}]
663
664   vid_vm:
665     type: OS::Nova::Server
666     properties:
667       image: { get_param: ubuntu_1404_image }
668       flavor: { get_param: flavor_medium }
669       name: 
670         str_replace: 
671           template: base-vid
672           params:
673             base: { get_param: vm_base_name }
674       key_name: { get_resource: vm_key }
675       networks:
676         - network: { get_param: public_net_id }
677         - port: { get_resource: vid_private_port }
678       user_data_format: RAW
679       user_data:
680         str_replace:
681           params:
682             __nexus_repo__: { get_param: nexus_repo }
683             __nexus_docker_repo__: { get_param: nexus_docker_repo }
684             __nexus_username__: { get_param: nexus_username }
685             __nexus_password__: { get_param: nexus_password }
686             __artifacts_version__: { get_param: artifacts_version }
687             __vid_ip_addr__: { get_param: vid_ip_addr }
688             __dns_ip_addr__: { get_param: dns_ip_addr }
689             __oam_network_cidr__: { get_param: oam_network_cidr }
690             __docker_version__: { get_param: docker_version }
691             __gerrit_branch__: { get_param: gerrit_branch }
692             __cloud_env__: { get_param: cloud_env }
693             __external_dns__: { get_param: external_dns }
694           template: |
695             #!/bin/bash
696
697             # Create configuration files
698             mkdir -p /opt/config
699             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
700             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
701             echo "__nexus_username__" > /opt/config/nexus_username.txt
702             echo "__nexus_password__" > /opt/config/nexus_password.txt
703             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
704             echo "__vid_ip_addr__" > /opt/config/local_ip_addr.txt
705             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
706             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
707             echo "__docker_version__" > /opt/config/docker_version.txt
708             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
709             echo "__cloud_env__" > /opt/config/cloud_env.txt
710             echo "__external_dns__" > /opt/config/external_dns.txt
711
712             # Download and run install script
713             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
714             cd /opt
715             chmod +x vid_install.sh
716             ./vid_install.sh
717
718  
719   # SDN-C instantiation
720   sdnc_private_port:
721     type: OS::Neutron::Port
722     properties:
723       network: { get_resource: oam_ecomp }
724       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
725
726   sdnc_vm:
727     type: OS::Nova::Server
728     properties:
729       image: { get_param: ubuntu_1404_image }
730       flavor: { get_param: flavor_large }
731       name: 
732         str_replace: 
733           template: base-sdnc
734           params:
735             base: { get_param: vm_base_name }
736       key_name: { get_resource: vm_key }
737       networks:
738         - network: { get_param: public_net_id }
739         - port: { get_resource: sdnc_private_port }
740       user_data_format: RAW
741       user_data:
742         str_replace:
743           params:
744             __nexus_repo__: { get_param: nexus_repo }
745             __nexus_docker_repo__: { get_param: nexus_docker_repo }
746             __nexus_username__: { get_param: nexus_username }
747             __nexus_password__: { get_param: nexus_password }
748             __artifacts_version__: { get_param: artifacts_version }
749             __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
750             __dns_ip_addr__: { get_param: dns_ip_addr }
751             __oam_network_cidr__: { get_param: oam_network_cidr }
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 "__sdnc_ip_addr__" > /opt/config/local_ip_addr.txt
767             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
768             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
769             echo "__docker_version__" > /opt/config/docker_version.txt
770             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
771             echo "__cloud_env__" > /opt/config/cloud_env.txt
772             echo "__external_dns__" > /opt/config/external_dns.txt
773
774             # Download and run install script
775             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
776             cd /opt
777             chmod +x sdnc_install.sh
778             ./sdnc_install.sh
779
780
781   # SDC instantiation
782   sdc_private_port:
783     type: OS::Neutron::Port
784     properties:
785       network: { get_resource: oam_ecomp }
786       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
787
788   sdc_volume_data:
789     type: OS::Cinder::Volume
790     properties:
791       name: vol1-sdc-data
792       size: 100
793
794   sdc_vm:
795     type: OS::Nova::Server
796     properties:
797       image: { get_param: ubuntu_1604_image }
798       flavor: { get_param: flavor_xlarge }
799       name:
800         str_replace:
801           template: base-sdc
802           params:
803             base: { get_param: vm_base_name }
804       key_name: { get_resource: vm_key }
805       networks:
806         - network: { get_param: public_net_id }
807         - port: { get_resource: sdc_private_port }
808       block_device_mapping:
809         - device_name: /dev/vdb
810           volume_id: { get_resource: sdc_volume_data }
811       user_data_format: RAW
812       user_data:
813         str_replace:
814           params:
815             __nexus_repo__: { get_param: nexus_repo }
816             __nexus_docker_repo__: { get_param: nexus_docker_repo }
817             __nexus_username__: { get_param: nexus_username }
818             __nexus_password__: { get_param: nexus_password }
819             __env_name__: { get_param: dmaap_topic }
820             __artifacts_version__: { get_param: artifacts_version }
821             __sdc_ip_addr__: { get_param: sdc_ip_addr }
822             __dns_ip_addr__: { get_param: dns_ip_addr }
823             __oam_network_cidr__: { get_param: oam_network_cidr }
824             __mr_ip_addr__: { get_param: mr_ip_addr }
825             __docker_version__: { get_param: docker_version }
826             __gerrit_branch__: { get_param: gerrit_branch }
827             __cloud_env__: { get_param: cloud_env }
828             __external_dns__: { get_param: external_dns }
829           template: |
830             #!/bin/bash
831
832             # Create configuration files
833             mkdir -p /opt/config
834             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
835             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
836             echo "__nexus_username__" > /opt/config/nexus_username.txt
837             echo "__nexus_password__" > /opt/config/nexus_password.txt
838             echo "__env_name__" > /opt/config/env_name.txt
839             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
840             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
841             echo "__sdc_ip_addr__" > /opt/config/local_ip_addr.txt
842             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
843             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
844             echo "__docker_version__" > /opt/config/docker_version.txt
845             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
846             echo "__cloud_env__" > /opt/config/cloud_env.txt
847             echo "__external_dns__" > /opt/config/external_dns.txt
848
849             # Download and run install script
850             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_install.sh -o /opt/asdc_install.sh
851             cd /opt
852             chmod +x asdc_install.sh
853             ./asdc_install.sh
854
855
856   # PORTAL instantiation
857   portal_private_port:
858     type: OS::Neutron::Port
859     properties:
860       network: { get_resource: oam_ecomp }
861       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: portal_ip_addr }}]
862
863   portal_vm:
864     type: OS::Nova::Server
865     properties:
866       image: { get_param: ubuntu_1404_image }
867       flavor: { get_param: flavor_large }
868       name: 
869         str_replace: 
870           template: base-portal
871           params:
872             base: { get_param: vm_base_name }
873       key_name: { get_resource: vm_key }
874       networks:
875         - network: { get_param: public_net_id }
876         - port: { get_resource: portal_private_port }
877       user_data_format: RAW
878       user_data:
879         str_replace:
880           params:
881             __nexus_repo__: { get_param: nexus_repo }
882             __nexus_docker_repo__: { get_param: nexus_docker_repo }
883             __nexus_username__: { get_param: nexus_username }
884             __nexus_password__: { get_param: nexus_password }
885             __artifacts_version__: { get_param: artifacts_version }
886             __portal_ip_addr__: { get_param: portal_ip_addr }
887             __dns_ip_addr__: { get_param: dns_ip_addr }
888             __oam_network_cidr__: { get_param: oam_network_cidr }
889             __docker_version__: { get_param: docker_version }
890             __gerrit_branch__: { get_param: gerrit_branch }
891             __cloud_env__: { get_param: cloud_env }
892             __external_dns__: { get_param: external_dns }
893           template: |
894             #!/bin/bash
895
896             # Create configuration files
897             mkdir -p /opt/config
898             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
899             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
900             echo "__nexus_username__" > /opt/config/nexus_username.txt
901             echo "__nexus_password__" > /opt/config/nexus_password.txt
902             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
903             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
904             echo "__portal_ip_addr__" > /opt/config/local_ip_addr.txt
905             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
906             echo "__docker_version__" > /opt/config/docker_version.txt
907             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
908             echo "__cloud_env__" > /opt/config/cloud_env.txt
909             echo "__external_dns__" > /opt/config/external_dns.txt
910
911             # Download and run install script
912             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
913             cd /opt
914             chmod +x portal_install.sh
915             ./portal_install.sh
916
917
918   # DCAE Controller instantiation
919   dcae_c_private_port:
920     type: OS::Neutron::Port
921     properties:
922       network: { get_resource: oam_ecomp }
923       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
924
925   dcae_c_vm:
926     type: OS::Nova::Server
927     properties:
928       image: { get_param: ubuntu_1404_image }
929       flavor: { get_param: flavor_medium }
930       name: 
931         str_replace: 
932           template: base-dcae-controller
933           params:
934             base: { get_param: vm_base_name }
935       key_name: { get_resource: vm_key }
936       networks:
937         - network: { get_param: public_net_id }
938         - port: { get_resource: dcae_c_private_port }
939       user_data_format: RAW
940       user_data:
941         str_replace:
942           params:
943             __nexus_repo__: { get_param: nexus_repo }
944             __nexus_docker_repo__: { get_param: nexus_docker_repo }
945             __nexus_username__: { get_param: nexus_username }
946             __nexus_password__: { get_param: nexus_password }
947             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
948             __gitlab_branch__: { get_param: gitlab_branch }
949             __dns_ip_addr__: { get_param: dns_ip_addr }
950             __oam_network_cidr__: { get_param: oam_network_cidr }
951             __dcae_zone__: { get_param: dcae_zone }
952             __dcae_state__: { get_param: dcae_state }
953             __artifacts_version__: { get_param: artifacts_version }
954             __tenant_id__: { get_param: openstack_tenant_id }
955             __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
956             __openstack_user__: { get_param: openstack_username }
957             __openstack_password__: { get_param: openstack_api_key }
958             __openstack_auth_method__: { get_param: openstack_auth_method }
959             __key_name__: { get_param: key_name }
960             __rand_str__: { get_resource: random-str }
961             __pub_key__: { get_param: pub_key }
962             __nexus_repo_root__: { get_param: nexus_repo_root }
963             __openstack_region__: { get_param: openstack_region }
964             __horizon_url__: { get_param: horizon_url }
965             __keystone_url__: { get_param: keystone_url }
966             __docker_version__: { get_param: docker_version }
967             __gerrit_branch__: { get_param: gerrit_branch }
968             __dcae_code_version__: { get_param: dcae_code_version }
969             __cloud_env__: { get_param: cloud_env }
970             __public_net_id__: { get_param: public_net_id }
971             __dcae_base_environment__: { get_param: dcae_base_environment }
972             __dcae_ip_addr__: { get_param: dcae_ip_addr }
973             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
974             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
975             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
976             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
977             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
978             __external_dns__: { get_param: external_dns }
979             __ubuntu_1404_image__: { get_param: ubuntu_1404_image }
980             __ubuntu_1604_image__: { get_param: ubuntu_1604_image }
981             __flavor_small__: { get_param: flavor_small }
982             __flavor_medium__: { get_param: flavor_medium }
983             __flavor_large__: { get_param: flavor_large }
984             __flavor_xlarge__: { get_param: flavor_xlarge }
985           template: |
986             #!/bin/bash
987
988             # Create configuration files
989             mkdir -p /opt/config
990             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
991             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
992             echo "__nexus_username__" > /opt/config/nexus_username.txt
993             echo "__nexus_password__" > /opt/config/nexus_password.txt
994             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
995             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
996             echo "__docker_version__" > /opt/config/docker_version.txt
997             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
998             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
999             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1000             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
1001             echo "__dcae_state__" > /opt/config/dcae_state.txt
1002             echo "__tenant_id__" > /opt/config/tenant_id.txt
1003             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
1004             echo "__openstack_user__" > /opt/config/openstack_user.txt
1005             echo "__openstack_password__" > /opt/config/openstack_password.txt
1006             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
1007             echo "__key_name__" > /opt/config/key_name.txt
1008             echo "__rand_str__" > /opt/config/rand_str.txt
1009             echo "__pub_key__" > /opt/config/pub_key.txt
1010             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
1011             echo "__openstack_region__" > /opt/config/openstack_region.txt
1012             echo "__horizon_url__" > /opt/config/horizon_url.txt
1013             echo "__keystone_url__" > /opt/config/keystone_url.txt
1014             echo "__cloud_env__" > /opt/config/cloud_env.txt
1015             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1016             echo "__public_net_id__" > /opt/config/public_net_id.txt
1017             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
1018             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
1019             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
1020             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
1021             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
1022             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
1023             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
1024             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
1025             echo "__external_dns__" > /opt/config/external_dns.txt
1026             echo "__ubuntu_1404_image__" > /opt/config/ubuntu_1404_image.txt
1027             echo "__ubuntu_1604_image__" > /opt/config/ubuntu_1604_image.txt
1028             echo "__flavor_small__" > /opt/config/flavor_small.txt
1029             echo "__flavor_medium__" > /opt/config/flavor_medium.txt
1030             echo "__flavor_large__" > /opt/config/flavor_large.txt
1031             echo "__flavor_xlarge__" > /opt/config/flavor_xlarge.txt
1032
1033             # Download and run install script
1034             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
1035             cd /opt
1036             chmod +x dcae_install.sh
1037             ./dcae_install.sh
1038
1039
1040   # Policy Engine instantiation
1041   policy_private_port:
1042     type: OS::Neutron::Port
1043     properties:
1044       network: { get_resource: oam_ecomp }
1045       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1046
1047   policy_vm:
1048     type: OS::Nova::Server
1049     properties:
1050       image: { get_param: ubuntu_1404_image }
1051       flavor: { get_param: flavor_xlarge }
1052       name: 
1053         str_replace: 
1054           template: base-policy
1055           params:
1056             base: { get_param: vm_base_name }
1057       key_name: { get_resource: vm_key }
1058       networks:
1059         - network: { get_param: public_net_id }
1060         - port: { get_resource: policy_private_port }
1061       user_data_format: RAW
1062       user_data:
1063         str_replace:
1064           params:
1065             __nexus_repo__: { get_param: nexus_repo }
1066             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1067             __nexus_username__: { get_param: nexus_username }
1068             __nexus_password__: { get_param: nexus_password }
1069             __artifacts_version__: { get_param: artifacts_version }
1070             __policy_ip_addr__: { get_param: policy_ip_addr }
1071             __dns_ip_addr__: { get_param: dns_ip_addr }
1072             __oam_network_cidr__: { get_param: oam_network_cidr }
1073             __docker_version__: { get_param: docker_version }
1074             __gerrit_branch__: { get_param: gerrit_branch }
1075             __cloud_env__: { get_param: cloud_env }
1076             __external_dns__: { get_param: external_dns }
1077           template: |
1078             #!/bin/bash
1079
1080             # Create configuration files
1081             mkdir -p /opt/config
1082             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1083             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1084             echo "__nexus_username__" > /opt/config/nexus_username.txt
1085             echo "__nexus_password__" > /opt/config/nexus_password.txt
1086             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1087             echo "__policy_ip_addr__" > /opt/config/local_ip_addr.txt
1088             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1089             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1090             echo "__docker_version__" > /opt/config/docker_version.txt
1091             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1092             echo "__cloud_env__" > /opt/config/cloud_env.txt
1093             echo "__external_dns__" > /opt/config/external_dns.txt
1094
1095             # Download and run install script
1096             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
1097             cd /opt
1098             chmod +x policy_install.sh
1099             ./policy_install.sh
1100
1101
1102   # APP-C instantiation
1103   appc_private_port:
1104     type: OS::Neutron::Port
1105     properties:
1106       network: { get_resource: oam_ecomp }
1107       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1108
1109   appc_vm:
1110     type: OS::Nova::Server
1111     properties:
1112       image: { get_param: ubuntu_1404_image }
1113       flavor: { get_param: flavor_large }
1114       name: 
1115         str_replace: 
1116           template: base-appc
1117           params:
1118             base: { get_param: vm_base_name }
1119       key_name: { get_resource: vm_key }
1120       networks:
1121         - network: { get_param: public_net_id }
1122         - port: { get_resource: appc_private_port }
1123       user_data_format: RAW
1124       user_data:
1125         str_replace:
1126           params:
1127             __nexus_repo__: { get_param: nexus_repo }
1128             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1129             __nexus_username__: { get_param: nexus_username }
1130             __nexus_password__: { get_param: nexus_password }
1131             __dmaap_topic__: { get_param: dmaap_topic }
1132             __artifacts_version__: { get_param: artifacts_version }
1133             __appc_ip_addr__: { get_param: appc_ip_addr }
1134             __dns_ip_addr__: { get_param: dns_ip_addr }
1135             __oam_network_cidr__: { get_param: oam_network_cidr }
1136             __docker_version__: { get_param: docker_version }
1137             __gerrit_branch__: { get_param: gerrit_branch }
1138             __cloud_env__: { get_param: cloud_env }
1139             __external_dns__: { get_param: external_dns }
1140           template: |
1141             #!/bin/bash
1142
1143             # Create configuration files
1144             mkdir -p /opt/config
1145             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1146             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1147             echo "__nexus_username__" > /opt/config/nexus_username.txt
1148             echo "__nexus_password__" > /opt/config/nexus_password.txt
1149             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1150             echo "__appc_ip_addr__" > /opt/config/local_ip_addr.txt
1151             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
1152             echo "__oam_network_cidr__" > /opt/config/oam_network_cidr.txt
1153             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1154             echo "__docker_version__" > /opt/config/docker_version.txt
1155             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1156             echo "__cloud_env__" > /opt/config/cloud_env.txt
1157             echo "__external_dns__" > /opt/config/external_dns.txt
1158
1159             # Download and run install script
1160             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
1161             cd /opt
1162             chmod +x appc_install.sh
1163             ./appc_install.sh