summaryrefslogtreecommitdiffstats
path: root/heat/vIMS/base_clearwater.yaml
blob: f290a71984aaf52c5d37e174e02ac8f54483f8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# Project Clearwater - IMS in the Cloud
# Copyright (C) 2015  Metaswitch Networks Ltd
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version, along with the "Special Exception" for use of
# the program along with SSL, set forth below. This program is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more
# details. You should have received a copy of the GNU General Public
# License along with this program.  If not, see
# <http://www.gnu.org/licenses/>.
#
# The author can be reached by email at clearwater@metaswitch.com or by
# post at Metaswitch Networks Ltd, 100 Church St, Enfield EN2 6BQ, UK
#
# Special Exception
# Metaswitch Networks Ltd  grants you permission to copy, modify,
# propagate, and distribute a work formed by combining OpenSSL with The
# Software, or a work derivative of such a combination, even if such
# copying, modification, propagation, or distribution would otherwise
# violate the terms of the GPL. You must comply with the GPL in all
# respects for all of the code used other than OpenSSL.
# "OpenSSL" means OpenSSL toolkit software distributed by the OpenSSL
# Project and licensed under the OpenSSL Licenses, or a work based on such
# software and licensed under the OpenSSL Licenses.
# "OpenSSL Licenses" means the OpenSSL License and Original SSLeay License
# under which the OpenSSL Project distributes the OpenSSL toolkit software,
# as those licenses appear in the file LICENSE-OPENSSL.

heat_template_version: 2015-04-30

description: >
  Base Project Clearwater Nazgul deployment on ONAP (Open Network Automation Platform)

parameters:
# Metadata required by ONAP
  vnf_name:
    type: string
    label: VNF name
    description: Unique name for this VNF instance
  vnf_id:
    type: string
    label: VNF ID
    description: The VNF ID provided by ONAP
  vf_module_id:
    type: string
    label: VNF module ID
    description: The VNF module ID provided by ONAP

# flavor parameters, naming required by ONAP
  bono_flavor_name:
    type: string
    description: VM flavor for bono VMs
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  sprout_flavor_name:
    type: string
    description: VM flavor for sprout VMs
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  vellum_flavor_name:
    type: string
    description: VM flavor for homestead VMs
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  homer_flavor_name:
    type: string
    description: VM flavor for homer VMs
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  dime_flavor_name:
    type: string
    description: VM flavor for dime VMs
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  ellis_flavor_name:
    type: string
    description: VM flavor for ellis VM
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  dns_flavor_name:
    type: string
    description: VM flavor for dns VM
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name
  robot_flavor_name:
    type: string
    description: VM flavor for robot_test VM
    constraints:
      - custom_constraint: nova.flavor
        description: Must be a valid flavor name

# image parameters, naming required by ONAP
  bono_image_name:
    type: string
    description: Name of image for bono VMs
  sprout_image_name:
    type: string
    description: Name of image for sprout VMs
  vellum_image_name:
    type: string
    description: Name of image for homestead VMs
  homer_image_name:
    type: string
    description: Name of image for homer VMs
  dime_image_name:
    type: string
    description: Name of image for dime VMs
  ellis_image_name:
    type: string
    description: Name of image for ellis VM
  dns_image_name:
    type: string
    description: Name of image for dns VMs
  robot_image_name:
    type: string
    description: Name of image for robot_test VMs

# overall clearwater parameters, naming required by ONAP
  clearwater_key_name:
    type: string
    label: openSSH Key name
    description: openSSH key name
  clearwater_pub_key:
    type: string
    label: Public key
    description: Public key to be installed on the compute instance
  repo_url:
    type: string
    description: URL for Clearwater repository
  zone:
    type: string
    description: DNS zone
  dn_range_start:
    type: string
    description: First directory number in pool
    constraints:
      - allowed_pattern: "[0-9]+"
        description: Must be numeric
  dn_range_length:
    type: string
    description: Number of directory numbers to add to pool
    constraints:
      - allowed_pattern: "[0-9]+"
        description: Must be numeric
  dnssec_key:
    type: string
    description: DNSSEC private key (Base64-encoded)
    constraints:
      - allowed_pattern: "[0-9A-Za-z+/=]+"
        description: Must be Base64-encoded
# names parameters
  bono_name_0:
    type: string
    description: The VM name
  sprout_name_0:
    type: string
    description: The VM name
  vellum_name_0:
    type: string
    description: The VM name
  homer_name_0:
    type: string
    description: The VM name
  dime_name_0:
    type: string
    description: The VM name
  ellis_name_0:
    type: string
    description: The VM name
  dns_name_0:
    type: string
    description: The VM name


# Network parameters, naming required by ONAP
  admin_plane_net_name:
    type: string
    label: external management network
    description: The external management network


resources:

  clearwater_random_str:
    type: OS::Heat::RandomString
    properties:
      length: 4

  clearwater_instantiated_key_name:
    type: OS::Nova::KeyPair
    properties:
      name:
        str_replace:
          template: pre_base_rand
          params:
            pre: key_
            base: { get_param: vnf_name }
            rand: { get_resource: clearwater_random_str }
      public_key: { get_param: clearwater_pub_key }
      save_private_key: false

  dns:
    type: dns.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      dns_flavor_name: { get_param: dns_flavor_name }
      dns_image_name: { get_param: dns_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      zone: { get_param: zone }
      dnssec_key: { get_param: dnssec_key }
      dns_name_0: { get_param: dns_name_0 }


  ellis:
    type: ellis.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      ellis_flavor_name: { get_param: ellis_flavor_name }
      ellis_image_name: { get_param: ellis_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      repo_url: { get_param: repo_url }
      zone: { get_param: zone }
      dn_range_start: { get_param: dn_range_start }
      dn_range_length: { get_param: dn_range_length }
      dns_ip: { get_attr: [ dns, dns_ip ] }
      dnssec_key: { get_param: dnssec_key }
      etcd_ip: "" #for ellis etcd_ip is empty
      ellis_name_0: { get_param: ellis_name_0 }

  bono:
    type: bono.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      bono_flavor_name: { get_param: bono_flavor_name }
      bono_image_name: { get_param: bono_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      repo_url: { get_param: repo_url }
      zone: { get_param: zone }
      dns_ip: { get_attr: [ dns, dns_ip ] }
      dnssec_key: { get_param: dnssec_key }
      etcd_ip: { get_attr: [ ellis, ellis_ip ] }
      bono_name_0: { get_param: bono_name_0 }

  sprout:
    type: sprout.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      sprout_flavor_name: { get_param: sprout_flavor_name }
      sprout_image_name: { get_param: sprout_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      repo_url: { get_param: repo_url }
      zone: { get_param: zone }
      dns_ip: { get_attr: [ dns, dns_ip ] }
      dnssec_key: { get_param: dnssec_key }
      etcd_ip: { get_attr: [ ellis, ellis_ip ] }
      sprout_name_0: { get_param: sprout_name_0 }


  homer:
    type: homer.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      homer_flavor_name: { get_param: homer_flavor_name }
      homer_image_name: { get_param: homer_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      repo_url: { get_param: repo_url }
      zone: { get_param: zone }
      dns_ip: { get_attr: [ dns, dns_ip ] }
      dnssec_key: { get_param: dnssec_key }
      etcd_ip: { get_attr: [ ellis, ellis_ip ] }
      homer_name_0: { get_param: homer_name_0 }

  vellum:
    type: vellum.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      vellum_flavor_name: { get_param: vellum_flavor_name }
      vellum_image_name: { get_param: vellum_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      repo_url: { get_param: repo_url }
      zone: { get_param: zone }
      dns_ip: { get_attr: [ dns, dns_ip ] }
      dnssec_key: { get_param: dnssec_key }
      etcd_ip: { get_attr: [ ellis, ellis_ip ] }
      vellum_name_0:  { get_param: vellum_name_0 }

  dime:
    type: dime.yaml
    properties:
      vnf_id: { get_param: vnf_id }
      vf_module_id: { get_param: vf_module_id }
      vnf_name: { get_param: vnf_name }
      public_net_id: { get_param: admin_plane_net_name }
      dime_flavor_name: { get_param: dime_flavor_name }
      dime_image_name: { get_param: dime_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      repo_url: { get_param: repo_url }
      zone: { get_param: zone }
      dns_ip: { get_attr: [ dns, dns_ip ] }
      dnssec_key: { get_param: dnssec_key }
      etcd_ip: { get_attr: [ ellis, ellis_ip ] }
      dime_name_0: { get_param: dime_name_0 }

  robot_0_security_group:
    type: OS::Neutron::SecurityGroup
    properties:
      description: security group
      name:
        str_replace:
          template: pre_base_rand
          params:
            pre: robot_sg_
            base: { get_param: vnf_name }
            rand: { get_resource: clearwater_random_str }
      rules: [
        {remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 22, port_range_max: 22},
        {remote_ip_prefix: 0.0.0.0/0, protocol: udp, port_range_min: 161, port_range_max: 162},
        {remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 2380, port_range_max: 2380},
        {remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 4000, port_range_max: 4000},
        {remote_ip_prefix: 0.0.0.0/0, protocol: tcp, port_range_min: 443, port_range_max: 443},
        {remote_ip_prefix: 0.0.0.0/0, protocol: icmp}]

  robot_0_admin_plane_port_0:
    type: OS::Neutron::Port
    properties:
      name:
        str_replace:
          template: pre_base_rand
          params:
            pre: admin_port_0_
            base: { get_param: vnf_name }
            rand: { get_resource: clearwater_random_str }
      network: { get_param: admin_plane_net_name }
      security_groups: [{ get_resource: robot_0_security_group }]

  robot_server_0:
    type: OS::Nova::Server
    properties:
      name:
        str_replace:
          template: pre_base_rand
          params:
            pre: robot_server_0_
            base: { get_param: vnf_name }
            rand: { get_resource: clearwater_random_str }
      flavor: { get_param: robot_flavor_name }
      image: { get_param: robot_image_name }
      key_name: { get_resource: clearwater_instantiated_key_name }
      networks:
        - port: { get_resource: robot_0_admin_plane_port_0 }
      metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }, vnf_name: { get_param: vnf_name }}
      user_data_format: RAW
      user_data:
        str_replace:
          params:
            __zone__: { get_param: zone }
            __DNS_IP_ADDR__: { get_attr: [ dns, dns_ip ] }

          template: |
            #!/bin/bash

            ## activate debug
            set -x

            ## install 'clearwater-live-test' in ubuntu home directory
            ## without this all is installed in root dir
            mkdir /home/ubuntu -p
            cd /home/ubuntu

            sudo apt-get update
            sudo apt-get install build-essential git --yes
            curl -sSL https://rvm.io/mpapis.asc | gpg --import -
            curl -L https://get.rvm.io | bash -s stable
            source /etc/profile.d/rvm.sh
            rvm autolibs enable
            rvm install 1.9.3
            rvm use 1.9.3

            git config --global url."https://".insteadOf git://
            git config --global url."https://github.com/Metaswitch".insteadOf "git@github.com:Metaswitch"
            git clone -b stable https://github.com/Metaswitch/clearwater-live-test.git --recursive
            cd clearwater-live-test
            sudo apt-get install bundler --yes
            sudo bundle install

            ##update dns
            echo "nameserver __DNS_IP_ADDR__" >> /etc/resolvconf/resolv.conf.d/head
            resolvconf -u

            echo "To start live-test run: rake test[__zone__] SIGNUP_CODE=secret"

            #rake test[vimstest.onap.org] SIGNUP_CODE=secret PROXY=84.39.37.62 ELLIS=84.39.34.60