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