Add base name to VMs in Rackspace
[demo.git] / heat / OpenECOMP / 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/8
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.openecomp.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
250   aai_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   aai_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   aai_vm:
265     type: OS::Nova::Server
266     properties:
267       flavor: 15 GB Compute v1
268       name: 
269         str_replace:
270           template: base-aai
271           params:
272             base: { get_param: vm_base_name }
273       key_name: { get_resource: vm_key }
274       block_device_mapping:
275         - volume_id: { get_resource: aai_volume }
276           device_name: vda
277       networks:
278         - network: { get_param: public_net_id }
279         - port: { get_resource: aai_private_port }
280       user_data_format: RAW
281       user_data:
282         str_replace:
283           params:
284             __nexus_repo__: { get_param: nexus_repo }
285             __nexus_docker_repo__: { get_param: nexus_docker_repo }
286             __nexus_username__: { get_param: nexus_username }
287             __nexus_password__: { get_param: nexus_password }
288             __dmaap_topic__: { get_param: dmaap_topic }
289             __artifacts_version__: { get_param: artifacts_version }
290             __docker_version__: { get_param: docker_version }
291             __cloud_env__: { get_param: cloud_env }
292           template: |
293             #!/bin/bash
294
295             # Create configuration files
296             mkdir -p /opt/config
297             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
298             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
299             echo "__nexus_username__" > /opt/config/nexus_username.txt
300             echo "__nexus_password__" > /opt/config/nexus_password.txt
301             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
302             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
303             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
304             echo "__docker_version__" > /opt/config/docker_version.txt
305             echo "__cloud_env__" > /opt/config/cloud_env.txt
306
307             # Download and run install script
308             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_install.sh -o /opt/aai_install.sh
309             cd /opt
310             chmod +x aai_install.sh
311             ./aai_install.sh
312
313
314   # MSO instantiation
315   mso_private_port:
316     type: OS::Neutron::Port
317     properties:
318       network: { get_resource: oam_ecomp }
319       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.5.1}]
320
321   mso_vm:
322     type: OS::Nova::Server
323     properties:
324       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
325       flavor: 4 GB General Purpose v1
326       name: 
327         str_replace:
328           template: base-mso
329           params:
330             base: { get_param: vm_base_name }
331       key_name: { get_resource: vm_key }
332       networks:
333         - network: { get_param: public_net_id }
334         - port: { get_resource: mso_private_port }
335       user_data_format: RAW
336       user_data:
337         str_replace:
338           params:
339             __nexus_repo__: { get_param: nexus_repo }
340             __nexus_docker_repo__: { get_param: nexus_docker_repo }
341             __nexus_username__: { get_param: nexus_username }
342             __nexus_password__: { get_param: nexus_password }
343             __openstack_username__: { get_param: openstack_username }
344             __openstack_tenant_id__: { get_param: openstack_tenant_id }
345             __openstack_api_key__: { get_param: openstack_api_key }
346             __dmaap_topic__: { get_param: dmaap_topic }
347             __artifacts_version__: { get_param: artifacts_version }
348             __docker_version__: { get_param: docker_version }
349             __gerrit_branch__: { get_param: gerrit_branch }
350             __cloud_env__: { get_param: cloud_env }
351           template: |
352             #!/bin/bash
353
354             # Create configuration files
355             mkdir -p /opt/config
356             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
357             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
358             echo "__nexus_username__" > /opt/config/nexus_username.txt
359             echo "__nexus_password__" > /opt/config/nexus_password.txt
360             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
361             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
362             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
363             echo "__openstack_username__" > /opt/config/openstack_username.txt
364             echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
365             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
366             echo "__docker_version__" > /opt/config/docker_version.txt
367             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
368             echo "__cloud_env__" > /opt/config/cloud_env.txt
369
370             # Download and run install script
371             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_install.sh -o /opt/mso_install.sh
372             cd /opt
373             chmod +x mso_install.sh
374             ./mso_install.sh
375
376
377   # Message Router instantiation
378   mrouter_private_port:
379     type: OS::Neutron::Port
380     properties:
381       network: { get_resource: oam_ecomp }
382       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.11.1}]
383
384   mrouter_vm:
385     type: OS::Nova::Server
386     properties:
387       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
388       flavor: 15 GB I/O v1
389       name: 
390         str_replace:
391           template: base-message-router
392           params:
393             base: { get_param: vm_base_name }
394       key_name: { get_resource: vm_key }
395       networks:
396         - network: { get_param: public_net_id }
397         - port: { get_resource: mrouter_private_port }
398       user_data_format: RAW
399       user_data:
400         str_replace:
401           params:
402             __nexus_repo__: { get_param: nexus_repo }
403             __nexus_docker_repo__: { get_param: nexus_docker_repo }
404             __nexus_username__: { get_param: nexus_username }
405             __nexus_password__: { get_param: nexus_password }
406             __artifacts_version__: { get_param: artifacts_version }
407             __gerrit_branch__: { get_param: gerrit_branch }
408             __cloud_env__: { get_param: cloud_env }
409           template: |
410             #!/bin/bash
411
412             # Create configuration files
413             mkdir -p /opt/config
414             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
415             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
416             echo "__nexus_username__" > /opt/config/nexus_username.txt
417             echo "__nexus_password__" > /opt/config/nexus_password.txt
418             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
419             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
420             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
421             echo "__cloud_env__" > /opt/config/cloud_env.txt
422
423             # Download and run install script
424             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_install.sh -o /opt/mr_install.sh
425             cd /opt
426             chmod +x mr_install.sh
427             ./mr_install.sh
428
429
430   # RobotE2E instantiation
431   robot_private_port:
432     type: OS::Neutron::Port
433     properties:
434       network: { get_resource: oam_ecomp }
435       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.10.1}]
436
437   robot_vm:
438     type: OS::Nova::Server
439     properties:
440       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
441       flavor: 2 GB General Purpose v1
442       name: 
443         str_replace:
444           template: base-robot
445           params:
446             base: { get_param: vm_base_name }
447       key_name: { get_resource: vm_key }
448       networks:
449         - network: { get_param: public_net_id }
450         - port: { get_resource: robot_private_port }
451       user_data_format: RAW
452       user_data:
453         str_replace:
454           params:
455             __nexus_repo__: { get_param: nexus_repo }
456             __nexus_docker_repo__: { get_param: nexus_docker_repo }
457             __nexus_username__: { get_param: nexus_username }
458             __nexus_password__: { get_param: nexus_password }
459             __network_name__: { get_attr: [oam_ecomp, name] }
460             __openstack_username__: { get_param: openstack_username }
461             __openstack_api_key__: { get_param : openstack_api_key }
462             __openstack_password__: { get_param: openstack_password }
463             __artifacts_version__: { get_param: artifacts_version }
464             __openstack_region__: { get_param: openstack_region }
465             __docker_version__: { get_param: docker_version }
466             __gerrit_branch__: { get_param: gerrit_branch }
467             __cloud_env__: { get_param: cloud_env }
468           template: |
469             #!/bin/bash
470
471             # Create configuration files
472             mkdir -p /opt/config
473             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
474             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
475             echo "__nexus_username__" > /opt/config/nexus_username.txt
476             echo "__nexus_password__" > /opt/config/nexus_password.txt
477             echo "__network_name__" > /opt/config/network.txt
478             echo "__openstack_username__" > /opt/config/openstack_username.txt
479             echo "__openstack_password__" > /opt/config/openstack_password.txt
480             echo "__openstack_api_key__" > /opt/config/openstack_api_key.txt
481             echo "__openstack_region__" > /opt/config/region.txt
482             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
483             echo "__docker_version__" > /opt/config/docker_version.txt
484             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
485             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
486             echo "__cloud_env__" > /opt/config/cloud_env.txt
487
488             # Download and run install script
489             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_install.sh -o /opt/robot_install.sh
490             cd /opt
491             chmod +x robot_install.sh
492             ./robot_install.sh
493
494
495   # VID instantiation
496   vid_private_port:
497     type: OS::Neutron::Port
498     properties:
499       network: { get_resource: oam_ecomp }
500       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.8.1}]
501
502   vid_vm:
503     type: OS::Nova::Server
504     properties:
505       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
506       flavor: 2 GB General Purpose v1
507       name: 
508         str_replace:
509           template: base-vid
510           params:
511             base: { get_param: vm_base_name }
512       key_name: { get_resource: vm_key }
513       networks:
514         - network: { get_param: public_net_id }
515         - port: { get_resource: vid_private_port }
516       user_data_format: RAW
517       user_data:
518         str_replace:
519           params:
520             __nexus_repo__: { get_param: nexus_repo }
521             __nexus_docker_repo__: { get_param: nexus_docker_repo }
522             __nexus_username__: { get_param: nexus_username }
523             __nexus_password__: { get_param: nexus_password }
524             __artifacts_version__: { get_param: artifacts_version }
525             __docker_version__: { get_param: docker_version }
526             __gerrit_branch__: { get_param: gerrit_branch }
527             __cloud_env__: { get_param: cloud_env }
528           template: |
529             #!/bin/bash
530
531             # Create configuration files
532             mkdir -p /opt/config
533             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
534             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
535             echo "__nexus_username__" > /opt/config/nexus_username.txt
536             echo "__nexus_password__" > /opt/config/nexus_password.txt
537             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
538             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
539             echo "__docker_version__" > /opt/config/docker_version.txt
540             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
541             echo "__cloud_env__" > /opt/config/cloud_env.txt
542
543             # Download and run install script
544             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_install.sh -o /opt/vid_install.sh
545             cd /opt
546             chmod +x vid_install.sh
547             ./vid_install.sh
548
549
550   # SDN-C instantiation
551   sdnc_private_port:
552     type: OS::Neutron::Port
553     properties:
554       network: { get_resource: oam_ecomp }
555       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.7.1}]
556
557   sdnc_vm:
558     type: OS::Nova::Server
559     properties:
560       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
561       flavor: 4 GB General Purpose v1
562       name: 
563         str_replace:
564           template: base-sdnc
565           params:
566             base: { get_param: vm_base_name }
567       key_name: { get_resource: vm_key }
568       networks:
569         - network: { get_param: public_net_id }
570         - port: { get_resource: sdnc_private_port }
571       user_data_format: RAW
572       user_data:
573         str_replace:
574           params:
575             __nexus_repo__: { get_param: nexus_repo }
576             __nexus_docker_repo__: { get_param: nexus_docker_repo }
577             __nexus_username__: { get_param: nexus_username }
578             __nexus_password__: { get_param: nexus_password }
579             __artifacts_version__: { get_param: artifacts_version }
580             __docker_version__: { get_param: docker_version }
581             __gerrit_branch__: { get_param: gerrit_branch }
582             __cloud_env__: { get_param: cloud_env }
583           template: |
584             #!/bin/bash
585
586             # Create configuration files
587             mkdir -p /opt/config
588             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
589             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
590             echo "__nexus_username__" > /opt/config/nexus_username.txt
591             echo "__nexus_password__" > /opt/config/nexus_password.txt
592             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
593             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
594             echo "__docker_version__" > /opt/config/docker_version.txt
595             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
596             echo "__cloud_env__" > /opt/config/cloud_env.txt
597
598             # Download and run install script
599             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_install.sh -o /opt/sdnc_install.sh
600             cd /opt
601             chmod +x sdnc_install.sh
602             ./sdnc_install.sh
603
604
605   # SDC instantiation
606   sdc_private_port:
607     type: OS::Neutron::Port
608     properties:
609       network: { get_resource: oam_ecomp }
610       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.3.1}]
611
612   sdc_volume_local:
613     type: OS::Cinder::Volume
614     properties:
615       name: vol1-sdc-local
616       size: 50
617       volume_type: SSD
618       image: Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)
619
620   sdc_volume_data:
621     type: OS::Cinder::Volume
622     properties:
623       name: vol1-sdc-data
624       size: 100
625       volume_type: SSD
626
627   sdc_volume_attachment:
628     type: OS::Cinder::VolumeAttachment
629     properties:
630       volume_id: { get_resource: sdc_volume_data }
631       instance_uuid: { get_resource: sdc_vm }
632       mountpoint: /dev/xvdb
633
634   sdc_vm:
635     type: OS::Nova::Server
636     properties:
637       flavor: 15 GB Compute v1
638       name: 
639         str_replace:
640           template: base-sdc
641           params:
642             base: { get_param: vm_base_name }
643       key_name: { get_resource: vm_key }
644       block_device_mapping:
645         - volume_id: { get_resource: sdc_volume_local }
646           device_name: vda
647       networks:
648         - network: { get_param: public_net_id }
649         - port: { get_resource: sdc_private_port }
650       user_data_format: RAW
651       user_data:
652         str_replace:
653           params:
654             __nexus_repo__: { get_param: nexus_repo }
655             __nexus_docker_repo__: { get_param: nexus_docker_repo }
656             __nexus_username__: { get_param: nexus_username }
657             __nexus_password__: { get_param: nexus_password }
658             __env_name__: { get_param: dmaap_topic }
659             __artifacts_version__: { get_param: artifacts_version }
660             __docker_version__: { get_param: docker_version }
661             __gerrit_branch__: { get_param: gerrit_branch }
662             __cloud_env__: { get_param: cloud_env }
663           template: |
664             #!/bin/bash
665
666             # Create configuration files
667             mkdir -p /opt/config
668             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
669             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
670             echo "__nexus_username__" > /opt/config/nexus_username.txt
671             echo "__nexus_password__" > /opt/config/nexus_password.txt
672             echo "__env_name__" > /opt/config/env_name.txt
673             echo "10.0.11.1" > /opt/config/mr_ip_addr.txt
674             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
675             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
676             echo "__docker_version__" > /opt/config/docker_version.txt
677             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
678             echo "__cloud_env__" > /opt/config/cloud_env.txt
679
680             # Download and run install script
681             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_install.sh -o /opt/asdc_install.sh
682             cd /opt
683             chmod +x asdc_install.sh
684             ./asdc_install.sh
685
686
687   # PORTAL instantiation
688   portal_private_port:
689     type: OS::Neutron::Port
690     properties:
691       network: { get_resource: oam_ecomp }
692       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.9.1}]
693
694   portal_volume:
695     type: OS::Cinder::Volume
696     properties:
697       name: vol1-portal
698       size: 50
699       volume_type: SSD
700       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
701
702   portal_vm:
703     type: OS::Nova::Server
704     properties:
705       flavor: 15 GB Memory v1
706       name: 
707         str_replace:
708           template: base-portal
709           params:
710             base: { get_param: vm_base_name }
711       key_name: { get_resource: vm_key }
712       block_device_mapping:
713         - volume_id: { get_resource: portal_volume }
714           device_name: vda
715       networks:
716         - network: { get_param: public_net_id }
717         - port: { get_resource: portal_private_port }
718       user_data_format: RAW
719       user_data:
720         str_replace:
721           params:
722             __nexus_repo__: { get_param: nexus_repo }
723             __nexus_docker_repo__: { get_param: nexus_docker_repo }
724             __nexus_username__: { get_param: nexus_username }
725             __nexus_password__: { get_param: nexus_password }
726             __artifacts_version__: { get_param: artifacts_version }
727             __docker_version__: { get_param: docker_version }
728             __gerrit_branch__: { get_param: gerrit_branch }
729             __cloud_env__: { get_param: cloud_env }
730           template: |
731             #!/bin/bash
732
733             # Create configuration files
734             mkdir -p /opt/config
735             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
736             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
737             echo "__nexus_username__" > /opt/config/nexus_username.txt
738             echo "__nexus_password__" > /opt/config/nexus_password.txt
739             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
740             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
741             echo "__docker_version__" > /opt/config/docker_version.txt
742             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
743             echo "__cloud_env__" > /opt/config/cloud_env.txt
744
745             # Download and run install script
746             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_install.sh -o /opt/portal_install.sh
747             cd /opt
748             chmod +x portal_install.sh
749             ./portal_install.sh
750
751
752   # DCAE Controller instantiation
753   dcae_c_private_port:
754     type: OS::Neutron::Port
755     properties:
756       network: { get_resource: oam_ecomp }
757       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.4.1}]
758   dcae_c_vm:
759     type: OS::Nova::Server
760     properties:
761       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
762       flavor: 8 GB General Purpose v1
763       name: 
764         str_replace:
765           template: base-dcae-controller
766           params:
767             base: { get_param: vm_base_name }
768       key_name: { get_resource: vm_key }
769       networks:
770         - network: { get_param: public_net_id }
771         - port: { get_resource: dcae_c_private_port }
772       user_data_format: RAW
773       user_data:
774         str_replace:
775           params:
776             __nexus_repo__: { get_param: nexus_repo }
777             __nexus_docker_repo__: { get_param: nexus_docker_repo }
778             __nexus_username__: { get_param: nexus_username }
779             __nexus_password__: { get_param: nexus_password }
780             __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
781             __gitlab_branch__: { get_param: gitlab_branch }
782             __dcae_zone__: { get_param: dcae_zone }
783             __dcae_state__: { get_param: dcae_state }
784             __artifacts_version__: { get_param: artifacts_version }
785             __tenant_id__: { get_param: openstack_tenant_id }
786             __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
787             __openstack_user__: { get_param: openstack_username }
788             __openstack_password__: { get_param: openstack_api_key }
789             __openstack_auth_method__: { get_param: openstack_auth_method }
790             __key_name__: { get_param: key_name }
791             __rand_str__: { get_resource: random-str }
792             __pub_key__: { get_param: pub_key }
793             __nexus_repo_root__: { get_param: nexus_repo_root }
794             __openstack_region__: { get_param: openstack_region }
795             __docker_version__: { get_param: docker_version }
796             __gerrit_branch__: { get_param: gerrit_branch }
797             __cloud_env__: { get_param: cloud_env }
798             __dcae_code_version__: { get_param: dcae_code_version }
799             __public_net_id__: { get_param: public_net_id }
800             __dcae_base_environment__: { get_param: dcae_base_environment }
801             __dcae_ip_addr__: { get_param: dcae_ip_addr }
802             __dcae_coll_ip_addr__: { get_param: dcae_coll_ip_addr }
803             __dcae_db_ip_addr__: { get_param: dcae_db_ip_addr }
804             __dcae_hdp1_ip_addr__: { get_param: dcae_hdp1_ip_addr }
805             __dcae_hdp2_ip_addr__: { get_param: dcae_hdp2_ip_addr }
806             __dcae_hdp3_ip_addr__: { get_param: dcae_hdp3_ip_addr }
807           template: |
808             #!/bin/bash
809
810             # Create configuration files
811             mkdir -p /opt/config
812             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
813             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
814             echo "__nexus_username__" > /opt/config/nexus_username.txt
815             echo "__nexus_password__" > /opt/config/nexus_password.txt
816             echo "__nexus_url_snapshots__" > /opt/config/nexus_url_snapshots.txt
817             echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
818             echo "__docker_version__" > /opt/config/docker_version.txt
819             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
820             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
821             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
822             echo "__dcae_zone__" > /opt/config/dcae_zone.txt
823             echo "__dcae_state__" > /opt/config/dcae_state.txt
824             echo "__tenant_id__" > /opt/config/tenant_id.txt
825             echo "__openstack_private_network_name__" > /opt/config/openstack_private_network_name.txt
826             echo "__openstack_user__" > /opt/config/openstack_user.txt
827             echo "__openstack_password__" > /opt/config/openstack_password.txt
828             echo "__openstack_auth_method__" > /opt/config/openstack_auth_method.txt
829             echo "__key_name__" > /opt/config/key_name.txt
830             echo "__rand_str__" > /opt/config/rand_str.txt
831             echo "__pub_key__" > /opt/config/pub_key.txt
832             echo "__nexus_repo_root__" > /opt/config/nexus_repo_root.txt
833             echo "__openstack_region__" > /opt/config/openstack_region.txt
834             echo "https://mycloud.rackspace.com/cloud" > /opt/config/horizon_url.txt
835             echo "https://identity.api.rackspacecloud.com/v2.0" > /opt/config/keystone_url.txt
836             echo "__cloud_env__" > /opt/config/cloud_env.txt
837             echo "__dcae_code_version__" > /opt/config/dcae_code_version.txt
838             echo "__public_net_id__" > /opt/config/public_net_id.txt
839             echo "__dcae_base_environment__" > /opt/config/dcae_base_environment.txt
840             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
841             echo "__dcae_coll_ip_addr__" > /opt/config/dcae_coll_ip_addr.txt
842             echo "__dcae_db_ip_addr__" > /opt/config/dcae_db_ip_addr.txt
843             echo "__dcae_hdp1_ip_addr__" > /opt/config/dcae_hdp1_ip_addr.txt
844             echo "__dcae_hdp2_ip_addr__" > /opt/config/dcae_hdp2_ip_addr.txt
845             echo "__dcae_hdp3_ip_addr__" > /opt/config/dcae_hdp3_ip_addr.txt
846
847             # Download and run install script
848             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_install.sh -o /opt/dcae_install.sh
849             cd /opt
850             chmod +x dcae_install.sh
851             ./dcae_install.sh
852
853
854   # Policy engine instantiation
855   policy_private_port:
856     type: OS::Neutron::Port
857     properties:
858       network: { get_resource: oam_ecomp }
859       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.6.1}]
860
861   policy_volume:
862     type: OS::Cinder::Volume
863     properties:
864       name: vol1-policy
865       size: 50
866       volume_type: SSD
867       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
868
869   policy_vm:
870     type: OS::Nova::Server
871     properties:
872       flavor: 15 GB Compute v1
873       name: 
874         str_replace:
875           template: base-policy
876           params:
877             base: { get_param: vm_base_name }
878       key_name: { get_resource: vm_key }
879       block_device_mapping:
880         - volume_id: { get_resource: policy_volume }
881           device_name: vda
882       networks:
883         - network: { get_param: public_net_id }
884         - port: { get_resource: policy_private_port }
885       user_data_format: RAW
886       user_data:
887         str_replace:
888           params:
889             __nexus_repo__: { get_param: nexus_repo }
890             __nexus_docker_repo__: { get_param: nexus_docker_repo }
891             __nexus_username__: { get_param: nexus_username }
892             __nexus_password__: { get_param: nexus_password }
893             __artifacts_version__: { get_param: artifacts_version }
894             __docker_version__: { get_param: docker_version }
895             __gerrit_branch__: { get_param: gerrit_branch }
896             __cloud_env__: { get_param: cloud_env }
897           template: |
898             #!/bin/bash
899
900             # Create configuration files
901             mkdir -p /opt/config
902             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
903             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
904             echo "__nexus_username__" > /opt/config/nexus_username.txt
905             echo "__nexus_password__" > /opt/config/nexus_password.txt
906             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
907             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
908             echo "__docker_version__" > /opt/config/docker_version.txt
909             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
910             echo "__cloud_env__" > /opt/config/cloud_env.txt
911
912             # Download and run install script
913             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_install.sh -o /opt/policy_install.sh
914             cd /opt
915             chmod +x policy_install.sh
916             ./policy_install.sh
917
918
919   # APP-C instantiation
920   appc_private_port:
921     type: OS::Neutron::Port
922     properties:
923       network: { get_resource: oam_ecomp }
924       fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": 10.0.2.1}]
925
926   appc_vm:
927     type: OS::Nova::Server
928     properties:
929       image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
930       flavor: 4 GB General Purpose v1
931       name: 
932         str_replace:
933           template: base-appc
934           params:
935             base: { get_param: vm_base_name }
936       key_name: { get_resource: vm_key }
937       networks:
938         - network: { get_param: public_net_id }
939         - port: { get_resource: appc_private_port }
940       user_data_format: RAW
941       user_data:
942         str_replace:
943           params:
944             __nexus_repo__: { get_param: nexus_repo }
945             __nexus_docker_repo__: { get_param: nexus_docker_repo }
946             __nexus_username__: { get_param: nexus_username }
947             __nexus_password__: { get_param: nexus_password }
948             __dmaap_topic__: { get_param: dmaap_topic }
949             __artifacts_version__: { get_param: artifacts_version }
950             __docker_version__: { get_param: docker_version }
951             __gerrit_branch__: { get_param: gerrit_branch }
952             __cloud_env__: { get_param: cloud_env }
953           template: |
954             #!/bin/bash
955
956             # Create configuration files
957             mkdir -p /opt/config
958             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
959             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
960             echo "__nexus_username__" > /opt/config/nexus_username.txt
961             echo "__nexus_password__" > /opt/config/nexus_password.txt
962             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
963             echo "10.0.0.1" > /opt/config/dns_ip_addr.txt
964             echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
965             echo "__docker_version__" > /opt/config/docker_version.txt
966             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
967             echo "__cloud_env__" > /opt/config/cloud_env.txt
968
969             # Download and run install script
970             curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_install.sh -o /opt/appc_install.sh
971             cd /opt
972             chmod +x appc_install.sh
973             ./appc_install.sh