summaryrefslogtreecommitdiffstats
path: root/docs/tosca2heat/examples/Simple_RNC.yaml
blob: 9f99c5708034002f922bfe1ffd1b5c3d9a8f51f6 (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
# Required TOSCA Definitions version string
tosca_definitions_version: tosca_simple_yaml_1_0

metadata:
  template_name: tosca_simple_profile_for_nfv
  template_author: opnfv_parser_project
  template_version: tosca_simple_profile_for_nfv_1_0

# Optional description of the definitions inside the file.
description: >
  TOSCA simple profile for RNC
    1, Compute Node MM, CM, DM, LB...
      1.1 MM: MaintainModule;
      1.2 CM: Control Module;
      1.3 DM: Data Module;
      1.4 LB: LineCard Module
    2, Network Node VL and CP

imports:
  - Simple_RNC_definition.yaml

# list of YAML alias anchors (or macros)
dsl_definitions:
  compute_props_os_DEF: &compute_props_os_DEF
    architecture: x86_64
    type: Linux
    distribution: Ubuntu
    version: 14.10

  compute_props_host_MM: &compute_props_host_MM
    disk_size: 80 GB
    iops: 300
    num_cpus: 8
    mem_size: 8192 MB
    swap: 512 MB

  compute_props_host_CM: &compute_props_host_CM
    disk_size: 0 GB
    num_cpus: 8
    mem_size: 8192 MB

  compute_props_host_DM: &compute_props_host_DM
    disk_size: 0 GB
    num_cpus: 8
    mem_size: 8192 MB

  compute_props_host_LB: &compute_props_host_LB
    disk_size: 0 GB
    num_cpus: 4
    mem_size: 8192 MB

# topology template definition of the cloud application or service
topology_template:
  # a description of the topology template
  description: >
    simple RNC template

  inputs:
    mm_storage_size:
      type: integer
      default: 40 GB
      description: mm additional block storage size
      constraints:
          - valid_values: [ 10, 20, 40, 80 ]

  substitution_mappings:
    type: rnc.nodes.VNF
    properties:
      vnfmtype: RADIO

  # definition of the node templates of the topology
  node_templates:
    MM_Active:
      type: rnc.nodes.compute.MM
      properties:
        activestatus: 1
      requirements:
        - host: MM_Active_Host
        - high_availability: MM_Passive
      artifacts:
        #the VM image of MM
        vm_image: mm.image
      interfaces:
        Standard:
          create:
            implementation: mm_install.sh
          configure:
            implementation: mm_active_configure.sh

    MM_Passive:
      type: rnc.nodes.compute.MM
      properties:
        activestatus: 0
      requirements:
        - host: MM_Passive_Host
        - high_availability: MM_Active
      artifacts:
        #the VM image of MM
        vm_image: mm.image
      interfaces:
        Standard:
          create:
            implementation: mm_install.sh
          configure:
            implementation: mm_passvie_configure.sh

    MM_Active_Host:
      type: rnc.nodes.compute.MM_Host
      capabilities:
        os:
          properties: *compute_props_os_DEF
        host:
          properties: *compute_props_host_MM
      requirements:
        - local_storage:
            node: MM_BlockStorage
            relationship: Storage_attachesto
      attributes:
        ip_address: { get_attribute: [ SELF, private_address ] }

    MM_Passive_Host:
      type: rnc.nodes.compute.MM_Host
      copy: MM_Active_Host

    CM_Active:
      type: rnc.nodes.compute.CM
      properties:
        activestatus: 1
      requirements:
        - host: CM_Active_Host
        - high_availability: CM_Passive
      artifacts:
        #the VM image of CM
        vm_image: cm.image
      interfaces:
        Standard:
          create:
            implementation: cm_install.sh
          configure:
            implementation: cm_active_configure.sh

    CM_Passive:
      type: rnc.nodes.compute.CM
      properties:
        activestatus: 0
      requirements:
        - host: CM_Passive_Host
        - high_availability: CM_Active
      artifacts:
        #the VM image of CM
        vm_image: mm.image
      interfaces:
        Standard:
          create:
            implementation: cm_install.sh
          configure:
            implementation: cm_passvie_configure.sh

    CM_Active_Host:
      type: rnc.nodes.compute.CM_Host
      capabilities:
        os:
          properties: *compute_props_os_DEF
        host:
          properties: *compute_props_host_CM
        scalable:
          properties:
            min_instances: 1
            max_instances: 126
            default_instances: 1
      attributes:
        ip_address: { get_attribute: [ SELF, private_address ] }

    CM_Passive_Host:
      type: rnc.nodes.compute.MM_Host
      copy: CM_Active_Host

    DM:
      type: rnc.nodes.compute.DM
      requirements:
        - host: DM_Host
      artifacts:
        vm_image: dm.image
      interfaces:
        Standard:
          create:
            implementation: dm_install.sh
          configure:
            implementation: dm_configure.sh

    DM_Host:
      type: rnc.nodes.compute.DM_Host
      capabilities:
        os:
          properties: *compute_props_os_DEF
        host:
          properties: *compute_props_host_DM
        scalable:
          properties:
            min_instances: 1
            max_instances: 120
            default_instances: 1
      attributes:
        ip_address: { get_attribute: [ SELF, private_address ] }

    LB:
      type: rnc.nodes.compute.LB
      requirements:
        - host: LB_Host
      artifacts:
        #the VM image of LB
        vm_image: lb.image
      interfaces:
        Standard:
          create:
            implementation: lb_install.sh
          configure:
            implementation: lb_configure.sh

    LB_Host:
      type: rnc.nodes.compute.LB_Host
      capabilities:
        os:
          properties: *compute_props_os_DEF
        host:
          properties: *compute_props_host_LB
        scalable:
          properties:
            min_instances: 1
            max_instances: 20
            default_instances: 1
      attributes:
        ip_address: { get_attribute: [ SELF, private_address ] }

    MM_BlockStorage:
      type: rnc.nodes.BlockStorage
      properties:
        size: { get_input: mm_storage_size }
      interfaces:
        Configure:
          post_configure_target:
            implementation: default_script.sh

    CTRL_NetWork:
      type: rnc.nodes.VL
      properties:
        vendor: "zte"
        cidr: "128.0.0.0/8"
        network_name: net1
        dhcp_enabled: false

    INTERMEDIA_NetWork:
      type: rnc.nodes.VL
      properties:
        vendor: "zte"
        cidr: "10.0.0.0/8"
        network_name: net3
        dhcp_enabled: true

    EXTERMEDIA_NetWork:
      type: rnc.nodes.VL
      properties:
        vendor: "zte"
        cidr: "172.1.0.0/20"
        network_name: net2
        dhcp_enabled: true

    EMS_NetWork:
      type: rnc.nodes.VL
      properties:
        vendor: "zte"
        cidr: "129.0.0.0/8"
        network_name: net2
        dhcp_enabled: true

    MM_Port_EMS:
      type: rnc.nodes.CP
      properties:
        order: 1
        is_default: true
      requirements:
        - virtualbinding: MM_Active
        - virtualLink: EMS_NetWork

    MM_Port_CTRL:
      type: rnc.nodes.CP
      properties:
        order: 0
        is_default: true
      requirements:
        - virtualbinding: MM_Active
        - virtualLink: CTRL_NetWork

    MM_Port_EXTERMEDIA:
      type: rnc.nodes.CP
      properties:
        order: 2
        is_default: true
      requirements:
        - virtualbinding: MM_Active
        - virtualLink: EXTERMEDIA_NetWork

    CM_Port_CTRL:
      type: rnc.nodes.CP
      properties:
        order: 0
        is_default: true
      requirements:
        - virtualbinding: CM_Active
        - virtualLink: CTRL_NetWork

    CM_Port_INTERMEDIA:
      type: rnc.nodes.CP
      properties:
        order: 1
        is_default: false
      requirements:
        - virtualbinding: CM_Active
        - virtualLink: INTERMEDIA_NetWork

    DM_Port_CTRL:
      type: rnc.nodes.CP
      properties:
        order: 0
        is_default: true
      requirements:
        - virtualbinding: DM
        - virtualLink: CTRL_NetWork

    DM_Port_INTERMEDIA:
      type: rnc.nodes.CP
      properties:
        order: 1
        is_default: false
      requirements:
        - virtualbinding: DM
        - virtualLink: INTERMEDIA_NetWork

    LB_Port_CTRL:
      type: rnc.nodes.CP
      properties:
        order: 0
        is_default: true
      requirements:
        - virtualbinding: LB
        - virtualLink: CTRL_NetWork

    LB_Port_INTERMEDIA:
      type: rnc.nodes.CP
      properties:
        order: 1
        is_default: false
      requirements:
        - virtualbinding: LB
        - virtualLink: INTERMEDIA_NetWork

    LB_Port_EXTERMEDIA:
      type: rnc.nodes.CP
      properties:
        order: 2
        is_default: false
      requirements:
        - virtualbinding: LB
        - virtualLink: EXTERMEDIA_NetWork

  # definition of the relationship templates of the topology
  relationship_templates:
    Storage_attachesto:
      type: tosca.relationships.AttachesTo
      properties:
      location: /data_location

  # definition of output parameters for the topology template
  outputs:
    private_ip_of_MM:
      description: The private IP address of the MM.
      value: { get_attribute: [ MM_Active_Host, ip_address ] }

    private_ip_of_CM:
      description: The private IP address of the CM.
      value: { get_attribute: [ CM_Active_Host, ip_address ] }

    private_ip_of_DM:
      description: The private IP address of the DM.
      value: { get_attribute: [ DM_Host, ip_address ] }

    private_ip_of_LB:
      description: The private IP address of the LB.
      value: { get_attribute: [ LB_Host, ip_address ] }

  # definition of logical groups of node templates within the topology
  # To be continue about this section
  groups:
    ServerGroupAnitAffinity: #
      description: Logical component grouping for placement
      members: [ MM_Acitve, MM_Passive, CM_Acitve, CM_Passive, LB ]
      policies:
        type: tosca.policy.placement.Antilocate

  #  ServerGroupAffinity: #
  #    members: [ CM, DM ]
  #    policies:
  #      type: tosca.policy.placement.Antilocate

  #  ServerGroupScaling_DM: # added future
  #    members: [ DM, ]# only one, will be error
  #    policies:
  #      - name: MyScaleUpPolicy
  #      - type: tosca.policy.scale.up | tosca.policy.scale.down
  #      - rule: fn.utilizaton [ DM ], greater_than: 80
  #      - trigger: script_dm

  #  ServerGroupScaling_LB: # added future
  #    members: [ LB, ] # only one, will be error
  #    policies:
  #      - name: MyScaleUpPolicy
  #      - type: tosca.policy.scale.up | tosca.policy.scale.down
  #      - rule: fn.utilizaton [ LB ], greater_than: 80
  #      - trigger: script_lb