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