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