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