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