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