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