Add vCPE use case heat/install scripts
[demo.git] / heat / ONAP / onap_rackspace.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: 2013-05-23
26
27 description: Heat template to deploy ONAP components
28
29 parameters:
30
31   # Generic parameters used across all ONAP components
32   public_net_id:
33     type: string
34     description: Public network that enables remote connection to the compute instance
35
36   key_name:
37     type: string
38     description: Public/Private key pair name
39
40   vm_base_name:
41     type: string
42     description: Base name of ONAP VMs
43
44   pub_key:
45     type: string
46     description: Public key or SSL certificate to be installed on the compute instance
47
48   nexus_repo:
49     type: string
50     description: Complete URL for the Nexus repository.
51
52   nexus_docker_repo:
53     type: string
54     description: Complete URL for the Nexus repository for docker images.
55
56   nexus_username:
57     type: string
58     description: Nexus Repository username
59
60   nexus_password:
61     type: string
62     description: Nexus Repository Password
63
64   openstack_tenant_id:
65     type: string
66     description: Rackspace tenant ID
67
68   openstack_username:
69     type: string
70     description: Rackspace username
71
72   openstack_api_key:
73     type: string
74     description: Rackspace API Key
75
76   openstack_password:
77     type: string
78     description: Rackspace Password
79
80   openstack_auth_method:
81     type: string
82     description: Openstack authentication method (password VS. api-key)
83
84   dmaap_topic:
85     type: string
86     description: DMaaP topic name
87
88   artifacts_version:
89     type: string
90     description: Artifacts version of ONAP components
91
92   docker_version:
93     type: string
94     description: Docker version of ONAP docker images
95
96   gerrit_branch:
97     type: string
98     description: Gerrit branch where to download the code from
99
100   cloud_env:
101     type: string
102     description: Cloud Provider Name
103
104
105   # Parameters for DCAE instantiation
106   dcae_base_environment:
107     type: string
108     description: DCAE Base Environment configuration (RACKSPACE/2-NIC/...)
109
110   dcae_zone:
111     type: string
112     description: DCAE Zone to use in VM names created by DCAE controller
113
114   dcae_state:
115     type: string
116     description: DCAE State to use in VM names created by DCAE controller
117
118   nexus_repo_root:
119     type: string
120     description: Root URL of nexus repository
121
122   nexus_url_snapshot:
123     type: string
124     description: Snapshot of Maven repository
125
126   openstack_region:
127     type: string
128     description: Rackspace region where the DCAE controller will spin the VMs
129
130   gitlab_branch:
131     type: string
132     description: Branch of the Gitlab repository
133
134   dcae_code_version:
135     type: string
136     description: DCAE Code Version Number
137
138   dcae_ip_addr:
139     type: string
140     description: DCAE IP Address
141  
142   dcae_coll_ip_addr:
143     type: string
144     description: DCAE Collector IP Address
145
146   dcae_db_ip_addr:
147     type: string
148     description: DCAE Database IP Address
149
150   dcae_hdp1_ip_addr:
151     type: string
152     description: Hadoop VM1 IP Address
153
154   dcae_hdp2_ip_addr:
155     type: string
156     description: Hadoop VM2 IP Address
157
158   dcae_hdp3_ip_addr:
159     type: string
160     description: Hadoop VM3 IP Address
161
162
163 resources:
164   random-str:
165     type: OS::Heat::RandomString
166     properties:
167       length: 4
168
169   # Public key used to access ONAP components
170   vm_key:
171     type: OS::Nova::KeyPair
172     properties:
173       name:
174         str_replace:
175           template: base_rand
176           params:
177             base: { get_param: key_name }
178             rand: { get_resource: random-str }
179       public_key: { get_param: pub_key }
180       save_private_key: false
181
182
183   # ONAP management private network
184   oam_ecomp:
185     type: OS::Neutron::Net
186     properties:
187       name:
188         str_replace:
189           template: oam_ecomp_rand
190           params:
191             rand: { get_resource: random-str }
192
193   oam_ecomp_subnet:
194     type: OS::Neutron::Subnet
195     properties:
196       name:
197         str_replace:
198           template: oam_ecomp_rand
199           params:
200             rand: { get_resource: random-str }
201       network_id: { get_resource: oam_ecomp }
202       cidr: 10.0.0.0/16
203
204
205   # DNS Server instantiation
206   dns_private_port:
207     type: OS::Neutron::Port
208     properties:
209       network: { get_resource: oam_ecomp }
210       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.0.1}]
211
212   dns_vm:
213     type: OS::Nova::Server
214     properties:
215       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
216       flavor: 4 GB General Purpose v1
217       name:
218         str_replace:
219           template: base-dns-server
220           params:
221             base: { get_param: vm_base_name }
222       key_name: { get_resource: vm_key }
223       networks:
224         - network: { get_param: public_net_id }
225         - port: { get_resource: dns_private_port }
226       user_data_format: RAW
227       user_data:
228         str_replace:
229           params:
230             __nexus_repo__: { get_param: nexus_repo }
231             __artifacts_version__: { get_param: artifacts_version }
232             __cloud_env__: { get_param: cloud_env }
233           template: |
234             #!/bin/bash
235
236             # Create configuration files
237             mkdir -p /opt/config
238             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
239             echo "__cloud_env__" > /opt/config/cloud_env.txt
240             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
241
242             # Download and run install script
243             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dns_install.sh -o /opt/dns_install.sh
244             cd /opt
245             chmod +x dns_install.sh
246             ./dns_install.sh
247
248
249   # A&AI instantiation (2 VMs)
250   aai1_private_port:
251     type: OS::Neutron::Port
252     properties:
253       network: { get_resource: oam_ecomp }
254       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.1.1}]
255
256   aai1_volume:
257     type: OS::Cinder::Volume
258     properties:
259       name: vol1-aai
260       size: 50
261       volume_type: SSD
262       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
263
264   aai1_vm:
265     type: OS::Nova::Server
266     depends_on: aai2_vm
267     properties:
268       flavor: 15 GB Compute v1
269       name:
270         str_replace:
271           template: base-aai-inst1
272           params:
273             base: { get_param: vm_base_name }
274       key_name: { get_resource: vm_key }
275       block_device_mapping:
276         - volume_id: { get_resource: aai1_volume }
277           device_name: vda
278       networks:
279         - network: { get_param: public_net_id }
280         - port: { get_resource: aai1_private_port }
281       user_data_format: RAW
282       user_data:
283         str_replace:
284           params:
285             __nexus_repo__: { get_param: nexus_repo }
286             __nexus_docker_repo__: { get_param: nexus_docker_repo }
287             __nexus_username__: { get_param: nexus_username }
288             __nexus_password__: { get_param: nexus_password }
289             __dmaap_topic__: { get_param: dmaap_topic }
290             __artifacts_version__: { get_param: artifacts_version }
291             __docker_version__: { get_param: docker_version }
292             __gerrit_branch__: { get_param: gerrit_branch }
293             __cloud_env__: { get_param: cloud_env }
294           template: |
295             #!/bin/bash
296
297             # Create configuration files
298             mkdir -p /opt/config
299             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
300             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
301             echo "__nexus_username__" > /opt/config/nexus_username.txt
302             echo "__nexus_password__" > /opt/config/nexus_password.txt
303             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
304             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
305             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
306             echo "__docker_version__" > /opt/config/docker_version.txt
307             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
308             echo "aai_instance_1" > /opt/config/aai_instance.txt
309             echo "__cloud_env__" > /opt/config/cloud_env.txt
310
311             # Download and run install script
312             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aai2_install.sh -o /opt/aai2_install.sh
313             cd /opt
314             chmod +x aai2_install.sh
315             ./aai2_install.sh
316
317
318   aai2_private_port:
319     type: OS::Neutron::Port
320     properties:
321       network: { get_resource: oam_ecomp }
322       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.1.2}]
323
324   aai2_volume:
325     type: OS::Cinder::Volume
326     properties:
327       name: vol2-aai
328       size: 50
329       volume_type: SSD
330       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
331
332   aai2_vm:
333     type: OS::Nova::Server
334     properties:
335       flavor: 15 GB Compute v1
336       name:
337         str_replace:
338           template: base-aai-inst2
339           params:
340             base: { get_param: vm_base_name }
341       key_name: { get_resource: vm_key }
342       block_device_mapping:
343         - volume_id: { get_resource: aai2_volume }
344           device_name: vda
345       networks:
346         - network: { get_param: public_net_id }
347         - port: { get_resource: aai2_private_port }
348       user_data_format: RAW
349       user_data:
350         str_replace:
351           params:
352             __nexus_repo__: { get_param: nexus_repo }
353             __nexus_docker_repo__: { get_param: nexus_docker_repo }
354             __nexus_username__: { get_param: nexus_username }
355             __nexus_password__: { get_param: nexus_password }
356             __dmaap_topic__: { get_param: dmaap_topic }
357             __artifacts_version__: { get_param: artifacts_version }
358             __docker_version__: { get_param: docker_version }
359             __gerrit_branch__: { get_param: gerrit_branch }
360             __cloud_env__: { get_param: cloud_env }
361           template: |
362             #!/bin/bash
363
364             # Create configuration files
365             mkdir -p /opt/config
366             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
367             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
368             echo "__nexus_username__" > /opt/config/nexus_username.txt
369             echo "__nexus_password__" > /opt/config/nexus_password.txt
370             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
371             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
372             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
373             echo "__docker_version__" > /opt/config/docker_version.txt
374             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
375             echo "aai_instance_2" > /opt/config/aai_instance.txt
376             echo "__cloud_env__" > /opt/config/cloud_env.txt
377
378             # Download and run install script
379             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/aai2_install.sh -o /opt/aai2_install.sh
380             cd /opt
381             chmod +x aai2_install.sh
382             ./aai2_install.sh
383
384
385   # MSO instantiation
386   mso_private_port:
387     type: OS::Neutron::Port
388     properties:
389       network: { get_resource: oam_ecomp }
390       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.5.1}]
391
392   mso_vm:
393     type: OS::Nova::Server
394     properties:
395       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
396       flavor: 4 GB General Purpose v1
397       name:
398         str_replace:
399           template: base-mso
400           params:
401             base: { get_param: vm_base_name }
402       key_name: { get_resource: vm_key }
403       networks:
404         - network: { get_param: public_net_id }
405         - port: { get_resource: mso_private_port }
406       user_data_format: RAW
407       user_data:
408         str_replace:
409           params:
410             __nexus_repo__: { get_param: nexus_repo }
411             __nexus_docker_repo__: { get_param: nexus_docker_repo }
412             __nexus_username__: { get_param: nexus_username }
413             __nexus_password__: { get_param: nexus_password }
414             __openstack_username__: { get_param: openstack_username }
415             __openstack_tenant_id__: { get_param: openstack_tenant_id }
416             __openstack_api_key__: { get_param: openstack_api_key }
417             __dmaap_topic__: { get_param: dmaap_topic }
418             __artifacts_version__: { get_param: artifacts_version }
419             __docker_version__: { get_param: docker_version }
420             __gerrit_branch__: { get_param: gerrit_branch }
421             __cloud_env__: { get_param: cloud_env }
422           template: |
423             #!/bin/bash
424
425             # Create configuration files
426             mkdir -p /opt/config
427             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
428             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
429             echo "__nexus_username__" > /opt/config/nexus_username.txt
430             echo "__nexus_password__" > /opt/config/nexus_password.txt
431             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
432             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
433             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
434             echo "__openstack_username__" > /opt/config/openstack_username.txt
435             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
436             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
437             echo "__docker_version__" > /opt/config/docker_version.txt
438             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
439             echo "__cloud_env__" > /opt/config/cloud_env.txt
440
441             # Download and run install script
442             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
443             cd /opt
444             chmod +x mso_install.sh
445             ./mso_install.sh
446
447
448   # Message Router instantiation
449   mrouter_private_port:
450     type: OS::Neutron::Port
451     properties:
452       network: { get_resource: oam_ecomp }
453       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.11.1}]
454
455   mrouter_vm:
456     type: OS::Nova::Server
457     properties:
458       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
459       flavor: 15 GB I/O v1
460       name:
461         str_replace:
462           template: base-message-router
463           params:
464             base: { get_param: vm_base_name }
465       key_name: { get_resource: vm_key }
466       networks:
467         - network: { get_param: public_net_id }
468         - port: { get_resource: mrouter_private_port }
469       user_data_format: RAW
470       user_data:
471         str_replace:
472           params:
473             __nexus_repo__: { get_param: nexus_repo }
474             __nexus_docker_repo__: { get_param: nexus_docker_repo }
475             __nexus_username__: { get_param: nexus_username }
476             __nexus_password__: { get_param: nexus_password }
477             __artifacts_version__: { get_param: artifacts_version }
478             __gerrit_branch__: { get_param: gerrit_branch }
479             __cloud_env__: { get_param: cloud_env }
480           template: |
481             #!/bin/bash
482
483             # Create configuration files
484             mkdir -p /opt/config
485             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
486             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
487             echo "__nexus_username__" > /opt/config/nexus_username.txt
488             echo "__nexus_password__" > /opt/config/nexus_password.txt
489             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
490             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
491             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
492             echo "__cloud_env__" > /opt/config/cloud_env.txt
493
494             # Download and run install script
495             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
496             cd /opt
497             chmod +x mr_install.sh
498             ./mr_install.sh
499
500
501   # RobotE2E instantiation
502   robot_private_port:
503     type: OS::Neutron::Port
504     properties:
505       network: { get_resource: oam_ecomp }
506       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.10.1}]
507
508   robot_vm:
509     type: OS::Nova::Server
510     properties:
511       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
512       flavor: 2 GB General Purpose v1
513       name:
514         str_replace:
515           template: base-robot
516           params:
517             base: { get_param: vm_base_name }
518       key_name: { get_resource: vm_key }
519       networks:
520         - network: { get_param: public_net_id }
521         - port: { get_resource: robot_private_port }
522       user_data_format: RAW
523       user_data:
524         str_replace:
525           params:
526             __nexus_repo__: { get_param: nexus_repo }
527             __nexus_docker_repo__: { get_param: nexus_docker_repo }
528             __nexus_username__: { get_param: nexus_username }
529             __nexus_password__: { get_param: nexus_password }
530             __network_name__: { get_attr: [oam_ecomp, name] }
531             __openstack_username__: { get_param: openstack_username }
532             __openstack_api_key__: { get_param : openstack_api_key }
533             __openstack_password__: { get_param: openstack_password }
534             __artifacts_version__: { get_param: artifacts_version }
535             __openstack_region__: { get_param: openstack_region }
536             __docker_version__: { get_param: docker_version }
537             __gerrit_branch__: { get_param: gerrit_branch }
538             __cloud_env__: { get_param: cloud_env }
539           template: |
540             #!/bin/bash
541
542             # Create configuration files
543             mkdir -p /opt/config
544             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
545             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
546             echo "__nexus_username__" > /opt/config/nexus_username.txt
547             echo "__nexus_password__" > /opt/config/nexus_password.txt
548             echo "__network_name__" > /opt/config/network.txt
549             echo "__openstack_username__" > /opt/config/openstack_username.txt
550             echo "__openstack_password__" > /opt/config/openstack_password.txt
551             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
552             echo "__openstack_region__" > /opt/config/region.txt
553             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
554             echo "__docker_version__" > /opt/config/docker_version.txt
555             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
556             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
557             echo "https://identity.api.rackspacecloud.com/v2.0" > /opt/config/keystone.txt
558             echo "10.0.1.1" > /opt/config/aai1_ip_addr.txt
559             echo "10.0.1.2" > /opt/config/aai2_ip_addr.txt
560             echo "10.0.2.1" > /opt/config/appc_ip_addr.txt
561             echo "10.0.4.1" > /opt/config/dcae_ip_addr.txt
562             echo "10.0.5.1" > /opt/config/mso_ip_addr.txt
563             echo "10.0.11.1" > /opt/config/mr_ip_addr.txt
564             echo "10.0.6.1" > /opt/config/policy_ip_addr.txt
565             echo "10.0.9.1" > /opt/config/portal_ip_addr.txt
566             echo "10.0.3.1" > /opt/config/sdc_ip_addr.txt
567             echo "10.0.7.1" > /opt/config/sdnc_ip_addr.txt
568             echo "10.0.8.1" > /opt/config/vid_ip_addr.txt
569             echo "Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)" > /opt/config/vm_image_name.txt
570             echo "4 GB General Purpose v1" > /opt/config/vm_flavor.txt
571             echo "__cloud_env__" > /opt/config/cloud_env.txt
572
573             # Download and run install script
574             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
575             cd /opt
576             chmod +x robot_install.sh
577             ./robot_install.sh
578
579
580   # VID instantiation
581   vid_private_port:
582     type: OS::Neutron::Port
583     properties:
584       network: { get_resource: oam_ecomp }
585       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.8.1}]
586
587   vid_vm:
588     type: OS::Nova::Server
589     properties:
590       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
591       flavor: 2 GB General Purpose v1
592       name:
593         str_replace:
594           template: base-vid
595           params:
596             base: { get_param: vm_base_name }
597       key_name: { get_resource: vm_key }
598       networks:
599         - network: { get_param: public_net_id }
600         - port: { get_resource: vid_private_port }
601       user_data_format: RAW
602       user_data:
603         str_replace:
604           params:
605             __nexus_repo__: { get_param: nexus_repo }
606             __nexus_docker_repo__: { get_param: nexus_docker_repo }
607             __nexus_username__: { get_param: nexus_username }
608             __nexus_password__: { get_param: nexus_password }
609             __artifacts_version__: { get_param: artifacts_version }
610             __docker_version__: { get_param: docker_version }
611             __gerrit_branch__: { get_param: gerrit_branch }
612             __cloud_env__: { get_param: cloud_env }
613           template: |
614             #!/bin/bash
615
616             # Create configuration files
617             mkdir -p /opt/config
618             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
619             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
620             echo "__nexus_username__" > /opt/config/nexus_username.txt
621             echo "__nexus_password__" > /opt/config/nexus_password.txt
622             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
623             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
624             echo "__docker_version__" > /opt/config/docker_version.txt
625             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
626             echo "__cloud_env__" > /opt/config/cloud_env.txt
627
628             # Download and run install script
629             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
630             cd /opt
631             chmod +x vid_install.sh
632             ./vid_install.sh
633
634
635   # SDN-C instantiation
636   sdnc_private_port:
637     type: OS::Neutron::Port
638     properties:
639       network: { get_resource: oam_ecomp }
640       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.7.1}]
641
642   sdnc_vm:
643     type: OS::Nova::Server
644     properties:
645       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
646       flavor: 4 GB General Purpose v1
647       name:
648         str_replace:
649           template: base-sdnc
650           params:
651             base: { get_param: vm_base_name }
652       key_name: { get_resource: vm_key }
653       networks:
654         - network: { get_param: public_net_id }
655         - port: { get_resource: sdnc_private_port }
656       user_data_format: RAW
657       user_data:
658         str_replace:
659           params:
660             __nexus_repo__: { get_param: nexus_repo }
661             __nexus_docker_repo__: { get_param: nexus_docker_repo }
662             __nexus_username__: { get_param: nexus_username }
663             __nexus_password__: { get_param: nexus_password }
664             __artifacts_version__: { get_param: artifacts_version }
665             __docker_version__: { get_param: docker_version }
666             __gerrit_branch__: { get_param: gerrit_branch }
667             __cloud_env__: { get_param: cloud_env }
668           template: |
669             #!/bin/bash
670
671             # Create configuration files
672             mkdir -p /opt/config
673             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
674             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
675             echo "__nexus_username__" > /opt/config/nexus_username.txt
676             echo "__nexus_password__" > /opt/config/nexus_password.txt
677             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
678             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
679             echo "__docker_version__" > /opt/config/docker_version.txt
680             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
681             echo "__cloud_env__" > /opt/config/cloud_env.txt
682
683             # Download and run install script
684             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
685             cd /opt
686             chmod +x sdnc_install.sh
687             ./sdnc_install.sh
688
689
690   # SDC instantiation
691   sdc_private_port:
692     type: OS::Neutron::Port
693     properties:
694       network: { get_resource: oam_ecomp }
695       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.3.1}]
696
697   sdc_volume_local:
698     type: OS::Cinder::Volume
699     properties:
700       name: vol1-sdc-local
701       size: 50
702       volume_type: SSD
703       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
704
705   sdc_volume_data:
706     type: OS::Cinder::Volume
707     properties:
708       name: vol1-sdc-data
709       size: 100
710       volume_type: SSD
711
712   sdc_volume_attachment:
713     type: OS::Cinder::VolumeAttachment
714     properties:
715       volume_id: { get_resource: sdc_volume_data }
716       instance_uuid: { get_resource: sdc_vm }
717       mountpoint: /dev/xvdb
718
719   sdc_vm:
720     type: OS::Nova::Server
721     properties:
722       flavor: 15 GB Compute v1
723       name:
724         str_replace:
725           template: base-sdc
726           params:
727             base: { get_param: vm_base_name }
728       key_name: { get_resource: vm_key }
729       block_device_mapping:
730         - volume_id: { get_resource: sdc_volume_local }
731           device_name: vda
732       networks:
733         - network: { get_param: public_net_id }
734         - port: { get_resource: sdc_private_port }
735       user_data_format: RAW
736       user_data:
737         str_replace:
738           params:
739             __nexus_repo__: { get_param: nexus_repo }
740             __nexus_docker_repo__: { get_param: nexus_docker_repo }
741             __nexus_username__: { get_param: nexus_username }
742             __nexus_password__: { get_param: nexus_password }
743             __env_name__: { get_param: dmaap_topic }
744             __artifacts_version__: { get_param: artifacts_version }
745             __docker_version__: { get_param: docker_version }
746             __gerrit_branch__: { get_param: gerrit_branch }
747             __cloud_env__: { get_param: cloud_env }
748           template: |
749             #!/bin/bash
750
751             # Create configuration files
752             mkdir -p /opt/config
753             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
754             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
755             echo "__nexus_username__" > /opt/config/nexus_username.txt
756             echo "__nexus_password__" > /opt/config/nexus_password.txt
757             echo "__env_name__" > /opt/config/env_name.txt
758             echo "10.0.11.1" > /opt/config/mr_ip_addr.txt
759             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
760             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
761             echo "__docker_version__" > /opt/config/docker_version.txt
762             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
763             echo "__cloud_env__" > /opt/config/cloud_env.txt
764
765             # Download and run install script
766             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/asdc_install.sh -o /opt/asdc_install.sh
767             cd /opt
768             chmod +x asdc_install.sh
769             ./asdc_install.sh
770
771
772   # PORTAL instantiation
773   portal_private_port:
774     type: OS::Neutron::Port
775     properties:
776       network: { get_resource: oam_ecomp }
777       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.9.1}]
778
779   portal_volume:
780     type: OS::Cinder::Volume
781     properties:
782       name: vol1-portal
783       size: 50
784       volume_type: SSD
785       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
786
787   portal_vm:
788     type: OS::Nova::Server
789     properties:
790       flavor: 15 GB Memory v1
791       name:
792         str_replace:
793           template: base-portal
794           params:
795             base: { get_param: vm_base_name }
796       key_name: { get_resource: vm_key }
797       block_device_mapping:
798         - volume_id: { get_resource: portal_volume }
799           device_name: vda
800       networks:
801         - network: { get_param: public_net_id }
802         - port: { get_resource: portal_private_port }
803       user_data_format: RAW
804       user_data:
805         str_replace:
806           params:
807             __nexus_repo__: { get_param: nexus_repo }
808             __nexus_docker_repo__: { get_param: nexus_docker_repo }
809             __nexus_username__: { get_param: nexus_username }
810             __nexus_password__: { get_param: nexus_password }
811             __artifacts_version__: { get_param: artifacts_version }
812             __docker_version__: { get_param: docker_version }
813             __gerrit_branch__: { get_param: gerrit_branch }
814             __cloud_env__: { get_param: cloud_env }
815           template: |
816             #!/bin/bash
817
818             # Create configuration files
819             mkdir -p /opt/config
820             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
821             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
822             echo "__nexus_username__" > /opt/config/nexus_username.txt
823             echo "__nexus_password__" > /opt/config/nexus_password.txt
824             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
825             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
826             echo "__docker_version__" > /opt/config/docker_version.txt
827             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
828             echo "__cloud_env__" > /opt/config/cloud_env.txt
829
830             # Download and run install script
831             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
832             cd /opt
833             chmod +x portal_install.sh
834             ./portal_install.sh
835
836
837   # DCAE Controller instantiation
838   dcae_c_private_port:
839     type: OS::Neutron::Port
840     properties:
841       network: { get_resource: oam_ecomp }
842       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.4.1}]
843   dcae_c_vm:
844     type: OS::Nova::Server
845     properties:
846       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
847       flavor: 8 GB General Purpose v1
848       name:
849         str_replace:
850           template: base-dcae-controller
851           params:
852             base: { get_param: vm_base_name }
853       key_name: { get_resource: vm_key }
854       networks:
855         - network: { get_param: public_net_id }
856         - port: { get_resource: dcae_c_private_port }
857       user_data_format: RAW
858       user_data:
859         str_replace:
860           params:
861             __nexus_repo__: { get_param: nexus_repo }
862             __nexus_docker_repo__: { get_param: nexus_docker_repo }
863             __nexus_username__: { get_param: nexus_username }
864             __nexus_password__: { get_param: nexus_password }
865             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
866             __gitlab_branch__: { get_param: gitlab_branch }
867             __dcae_zone__: { get_param: dcae_zone }
868             __dcae_state__: { get_param: dcae_state }
869             __artifacts_version__: { get_param: artifacts_version }
870             __tenant_id__: { get_param: openstack_tenant_id }
871             __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
872             __openstack_user__: { get_param: openstack_username }
873             __openstack_password__: { get_param: openstack_api_key }
874             __openstack_auth_method__: { get_param: openstack_auth_method }
875             __key_name__: { get_param: key_name }
876             __rand_str__: { get_resource: random-str }
877             __pub_key__: { get_param: pub_key }
878             __nexus_repo_root__: { get_param: nexus_repo_root }
879             __openstack_region__: { get_param: openstack_region }
880             __docker_version__: { get_param: docker_version }
881             __gerrit_branch__: { get_param: gerrit_branch }
882             __cloud_env__: { get_param: cloud_env }
883             __dcae_code_version__: { get_param: dcae_code_version }
884             __public_net_id__: { get_param: public_net_id }
885             __dcae_base_environment__: { get_param: dcae_base_environment }
886             __dcae_ip_addr__: { get_param: dcae_ip_addr }
887             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
888             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
889             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
890             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
891             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
892           template: |
893             #!/bin/bash
894
895             # Create configuration files
896             mkdir -p /opt/config
897             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
898             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
899             echo "__nexus_username__" > /opt/config/nexus_username.txt
900             echo "__nexus_password__" > /opt/config/nexus_password.txt
901             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
902             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
903             echo "__docker_version__" > /opt/config/docker_version.txt
904             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
905             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
906             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
907             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
908             echo "__dcae_state__" > /opt/config/dcae_state.txt
909             echo "__tenant_id__" > /opt/config/tenant_id.txt
910             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
911             echo "__openstack_user__" > /opt/config/openstack_user.txt
912             echo "__openstack_password__" > /opt/config/openstack_password.txt
913             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
914             echo "__key_name__" > /opt/config/key_name.txt
915             echo "__rand_str__" > /opt/config/rand_str.txt
916             echo "__pub_key__" > /opt/config/pub_key.txt
917             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
918             echo "__openstack_region__" > /opt/config/openstack_region.txt
919             echo "https://mycloud.rackspace.com/cloud" > /opt/config/horizon_url.txt
920             echo "https://identity.api.rackspacecloud.com/v2.0" > /opt/config/keystone_url.txt
921             echo "__cloud_env__" > /opt/config/cloud_env.txt
922             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
923             echo "__public_net_id__" > /opt/config/public_net_id.txt
924             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
925             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
926             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
927             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
928             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
929             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
930             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
931
932             # Download and run install script
933             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
934             cd /opt
935             chmod +x dcae_install.sh
936             ./dcae_install.sh
937
938
939   # Policy engine instantiation
940   policy_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": 10.0.6.1}]
945
946   policy_volume:
947     type: OS::Cinder::Volume
948     properties:
949       name: vol1-policy
950       size: 50
951       volume_type: SSD
952       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
953
954   policy_vm:
955     type: OS::Nova::Server
956     properties:
957       flavor: 15 GB Compute v1
958       name:
959         str_replace:
960           template: base-policy
961           params:
962             base: { get_param: vm_base_name }
963       key_name: { get_resource: vm_key }
964       block_device_mapping:
965         - volume_id: { get_resource: policy_volume }
966           device_name: vda
967       networks:
968         - network: { get_param: public_net_id }
969         - port: { get_resource: policy_private_port }
970       user_data_format: RAW
971       user_data:
972         str_replace:
973           params:
974             __nexus_repo__: { get_param: nexus_repo }
975             __nexus_docker_repo__: { get_param: nexus_docker_repo }
976             __nexus_username__: { get_param: nexus_username }
977             __nexus_password__: { get_param: nexus_password }
978             __artifacts_version__: { get_param: artifacts_version }
979             __docker_version__: { get_param: docker_version }
980             __gerrit_branch__: { get_param: gerrit_branch }
981             __cloud_env__: { get_param: cloud_env }
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 "__artifacts_version__" > /opt/config/artifacts_version.txt
992             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
993             echo "__docker_version__" > /opt/config/docker_version.txt
994             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
995             echo "__cloud_env__" > /opt/config/cloud_env.txt
996
997             # Download and run install script
998             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
999             cd /opt
1000             chmod +x policy_install.sh
1001             ./policy_install.sh
1002
1003
1004   # APP-C instantiation
1005   appc_private_port:
1006     type: OS::Neutron::Port
1007     properties:
1008       network: { get_resource: oam_ecomp }
1009       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.2.1}]
1010
1011   appc_vm:
1012     type: OS::Nova::Server
1013     properties:
1014       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
1015       flavor: 4 GB General Purpose v1
1016       name:
1017         str_replace:
1018           template: base-appc
1019           params:
1020             base: { get_param: vm_base_name }
1021       key_name: { get_resource: vm_key }
1022       networks:
1023         - network: { get_param: public_net_id }
1024         - port: { get_resource: appc_private_port }
1025       user_data_format: RAW
1026       user_data:
1027         str_replace:
1028           params:
1029             __nexus_repo__: { get_param: nexus_repo }
1030             __nexus_docker_repo__: { get_param: nexus_docker_repo }
1031             __nexus_username__: { get_param: nexus_username }
1032             __nexus_password__: { get_param: nexus_password }
1033             __dmaap_topic__: { get_param: dmaap_topic }
1034             __artifacts_version__: { get_param: artifacts_version }
1035             __docker_version__: { get_param: docker_version }
1036             __gerrit_branch__: { get_param: gerrit_branch }
1037             __cloud_env__: { get_param: cloud_env }
1038           template: |
1039             #!/bin/bash
1040
1041             # Create configuration files
1042             mkdir -p /opt/config
1043             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
1044             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1045             echo "__nexus_username__" > /opt/config/nexus_username.txt
1046             echo "__nexus_password__" > /opt/config/nexus_password.txt
1047             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
1048             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
1049             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1050             echo "__docker_version__" > /opt/config/docker_version.txt
1051             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
1052             echo "__cloud_env__" > /opt/config/cloud_env.txt
1053
1054             # Download and run install script
1055             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
1056             cd /opt
1057             chmod +x appc_install.sh
1058             ./appc_install.sh