Remove the cyclic dependencies in vRNC definition
[parser.git] / tosca2heat / tosca-parser / toscaparser / extensions / nfv / tests / data / vRNC / Definitions / vRNC.yaml
1 ##    Licensed under the Apache License, Version 2.0 (the "License"); you may
2 ##    not use this file except in compliance with the License. You may obtain
3 ##    a copy of the License at
4 ##
5 ##         http://www.apache.org/licenses/LICENSE-2.0
6 ##
7 ##    Unless required by applicable law or agreed to in writing, software
8 ##    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 ##    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 ##    License for the specific language governing permissions and limitations
11 ##    under the License.
12
13 tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
14
15 metadata:
16   template_name: tosca_simple_profile_for_nfv_vRNC
17   template_author: opnfv_parser_project_from_zte
18   template_version: tosca_simple_profile_for_nfv_1_0
19
20 # Optional description of the definitions inside the file.
21 description: >
22   TOSCA simple profile for RNC
23     1. Compute Node MM, CM, DM, LB...
24       1.1 MM: MaintainModule;
25       1.2 CM: Control Module;
26       1.3 DM: Data Module;
27       1.4 LB: LineCard Module
28     2. Network Node VL and CP
29
30 imports:
31   - rnc_definition.yaml
32
33 # list of YAML alias anchors (or macros)
34 dsl_definitions:
35   compute_props_os_DEF: &compute_props_os_DEF
36     architecture: x86_64
37     type: Linux
38     distribution: Cirros
39     version: 0.3.2
40
41   compute_props_host_MM: &compute_props_host_MM
42     disk_size: 1 GB
43     num_cpus: 2
44     mem_size: 64 MB
45
46   compute_props_host_CM: &compute_props_host_CM
47     disk_size: 0 GB
48     num_cpus: 2
49     mem_size: 64 MB
50
51   compute_props_host_DM: &compute_props_host_DM
52     disk_size: 0 GB
53     num_cpus: 2
54     mem_size: 64 MB
55
56   compute_props_host_LB: &compute_props_host_LB
57     disk_size: 0 GB
58     num_cpus: 2
59     mem_size: 64 MB
60
61 # topology template definition of the cloud application or service
62 topology_template:
63   # a description of the topology template
64   description: >
65     simple RNC template
66
67   inputs:
68     mm_storage_size:
69       type: integer
70       default: 1
71       description: mm additional block storage size
72       constraints:
73         - in_range: [ 1, 200 ]
74     id:
75       type: string
76       description: ID of this VNF
77       default: UMTS
78     vendor:
79       type: string
80       description: name of the vendor who generate this VNF
81       default: ZTE
82     version:
83       type: version
84       description: version of the software for this VNF
85       default: 1.0
86
87   substitution_mappings:
88     node_type: rnc.nodes.VNF
89     requirements:
90       virtualLink_VNFM: [ MM_Port_CTRL, virtualLink ]
91       virtualLink_EMS: [ MM_Port_EMS, virtualLink ]
92       virtualLink_TRAFFIC: [ LB_Port_EXTERMEDIA, virtualLink ]
93
94   # definition of the node templates of the topology
95   node_templates:
96     MM_Active:
97       type: tosca.nodes.SoftwareComponent
98       properties:
99         component_version: 1.0
100       requirements:
101         - host: MM_Active_Host
102       interfaces:
103         Standard:
104           create:
105             implementation: mm_install.sh
106           configure:
107             implementation: mm_active_configure.sh
108
109     MM_Active_Host:
110       type: rnc.nodes.compute.MM
111       properties:
112         activestatus: 1
113         id: MM_Active
114       capabilities:
115         os:
116           properties: *compute_props_os_DEF
117         host:
118           properties: *compute_props_host_MM
119       requirements:
120         - local_storage:
121             node: MM_BlockStorage
122             relationship: Storage_attachesto
123       artifacts:
124         #the VM image of MM
125         vm_image: mm.image
126
127     MM_Passive:
128       type: tosca.nodes.SoftwareComponent
129       properties:
130         component_version: 1.0
131       requirements:
132         - host: MM_Passive_Host
133       interfaces:
134         Standard:
135           create:
136             implementation: mm_install.sh
137           configure:
138             implementation: mm_passvie_configure.sh
139
140     MM_Passive_Host:
141       type: rnc.nodes.compute.MM
142       properties:
143         activestatus: 0
144         id: MM_Passive
145       capabilities:
146         os:
147           properties: *compute_props_os_DEF
148         host:
149           properties: *compute_props_host_MM
150       requirements:
151         - local_storage:
152             node: MM_BlockStorage
153             relationship: Storage_attachesto
154         - high_availability: MM_Active
155       artifacts:
156         #the VM image of MM
157         vm_image: mm.image
158
159     CM_Active:
160       type: tosca.nodes.SoftwareComponent
161       properties:
162         component_version: 1.0
163       requirements:
164         - host: CM_Active_Host
165       interfaces:
166         Standard:
167           create:
168             implementation: cm_install.sh
169           configure:
170             implementation: cm_active_configure.sh
171
172     CM_Active_Host:
173       type: rnc.nodes.compute.CM
174       properties:
175         activestatus: 1
176       capabilities:
177         os:
178           properties: *compute_props_os_DEF
179         host:
180           properties: *compute_props_host_CM
181         scalable:
182           properties:
183             min_instances: 1
184             max_instances: 12
185             default_instances: 1
186       artifacts:
187         #the VM image of CM
188         vm_image: cm.image
189
190     CM_Passive:
191       type: tosca.nodes.SoftwareComponent
192       properties:
193         component_version: 1.0
194       requirements:
195         - host: CM_Passive_Host
196       interfaces:
197         Standard:
198           create:
199             implementation: cm_install.sh
200           configure:
201             implementation: cm_passvie_configure.sh
202
203     CM_Passive_Host:
204       type: rnc.nodes.compute.CM
205       properties:
206         activestatus: 0
207       capabilities:
208         os:
209           properties: *compute_props_os_DEF
210         host:
211           properties: *compute_props_host_CM
212         scalable:
213           properties:
214             min_instances: 1
215             max_instances: 12
216             default_instances: 1
217       requirements:
218         - high_availability: CM_Active
219       artifacts:
220         #the VM image of CM
221         vm_image: mm.image
222
223     DM:
224       type: tosca.nodes.SoftwareComponent
225       properties:
226         component_version: 1.0
227       requirements:
228         - host: DM_Host
229       interfaces:
230         Standard:
231           create:
232             implementation: dm_install.sh
233           configure:
234             implementation: dm_configure.sh
235
236     DM_Host:
237       type: rnc.nodes.compute.DM
238       capabilities:
239         os:
240           properties: *compute_props_os_DEF
241         host:
242           properties: *compute_props_host_DM
243         scalable:
244           properties:
245             min_instances: 1
246             max_instances: 12
247             default_instances: 1
248       artifacts:
249         vm_image: dm.image
250
251     LB:
252       type: tosca.nodes.SoftwareComponent
253       properties:
254         component_version: 1.0
255       requirements:
256         - host: LB_Host
257       interfaces:
258         Standard:
259           create:
260             implementation: lb_install.sh
261           configure:
262             implementation: lb_configure.sh
263
264     LB_Host:
265       type: rnc.nodes.compute.LB
266       capabilities:
267         os:
268           properties: *compute_props_os_DEF
269         host:
270           properties: *compute_props_host_LB
271         scalable:
272           properties:
273             min_instances: 1
274             max_instances: 2
275             default_instances: 1
276       artifacts:
277         #the VM image of LB
278         vm_image: lb.image
279
280     MM_BlockStorage:
281       type: rnc.nodes.BlockStorage
282       properties:
283         size: { get_input: mm_storage_size }
284       interfaces:
285         Configure:
286           post_configure_target:
287             implementation: default_script.sh
288
289     CTRL_Net:
290       type: rnc.nodes.VL
291       properties:
292         vendor: ZTE
293         cidr: "128.0.0.0/8"
294         network_name: Ctrl_Net
295         network_type: vlan
296         segmentation_id: 110
297         dhcp_enabled: false
298
299     INTERMEDIA_Net:
300       type: rnc.nodes.VL
301       properties:
302         vendor: ZTE
303         cidr: 10.0.0.0/8
304         start_ip: 10.1.0.1
305         end_ip: 10.1.2.254
306         network_name: InterMedia_Net
307         network_type: vlan
308         segmentation_id: 111
309         dhcp_enabled: false
310
311     EXTERMEDIA_Net:
312       type: rnc.nodes.VL
313       properties:
314         vendor: ZTE
315         cidr: 172.1.0.0/16
316         start_ip: 172.1.0.2
317         end_ip: 172.1.2.254
318         gateway_ip: 172.1.0.1
319         network_name: ExterMdedia_Net
320         network_type: vlan
321         segmentation_id: 100
322         dhcp_enabled: false
323
324     EMS_Net:
325       type: rnc.nodes.VL
326       properties:
327         vendor: ZTE
328         cidr: 129.0.0.0/24
329         start_ip: 129.0.0.2
330         end_ip: 129.0.0.64
331         gateway_ip: 129.0.0.1
332         network_name: Ems_Net
333         network_type: vlan
334         segmentation_id: 101
335         dhcp_enabled: false
336
337     MM_Active_Port_EMS:
338       type: rnc.nodes.CP.MM
339       properties:
340         order: 0
341         is_default: true
342       requirements:
343         - virtualBinding: MM_Active_Host
344         - virtualLink: EMS_Net
345
346     MM_Active_Port_EXTERMEDIA:
347       type: rnc.nodes.CP.MM
348       properties:
349         order: 1
350         is_default: true
351       requirements:
352         - virtualBinding: MM_Active_Host
353         - virtualLink: EMS_Net
354
355     MM_Active_Port_CTRL:
356       type: rnc.nodes.CP.MM
357       properties:
358         order: 2
359         is_default: false
360       requirements:
361         - virtualBinding: MM_Active_Host
362         - virtualLink: CTRL_Net
363
364     MM_Active_Port_INTERMEDIA:
365       type: rnc.nodes.CP.MM
366       properties:
367         order: 3
368         is_default: false
369       requirements:
370         - virtualBinding: MM_Active_Host
371         - virtualLink: EXTERMEDIA_Net
372
373     MM_Passive_Port_EMS:
374       type: rnc.nodes.CP.MM
375       properties:
376         order: 0
377         is_default: true
378       requirements:
379         - virtualBinding: MM_Passive_Host
380         - virtualLink: EMS_Net
381
382     MM_Passive_Port_EXTERMEDIA:
383       type: rnc.nodes.CP.MM
384       properties:
385         order: 1
386         is_default: true
387       requirements:
388         - virtualBinding: MM_Passive_Host
389         - virtualLink: EMS_Net
390
391     MM_Passive_Port_CTRL:
392       type: rnc.nodes.CP.MM
393       properties:
394         order: 2
395         is_default: false
396       requirements:
397         - virtualBinding: MM_Passive_Host
398         - virtualLink: CTRL_Net
399
400     MM_Passive_Port_INTERMEDIA:
401       type: rnc.nodes.CP.MM
402       properties:
403         order: 3
404         is_default: false
405       requirements:
406         - virtualBinding: MM_Passive_Host
407         - virtualLink: EXTERMEDIA_Net
408
409     CM_Active_Port_CTRL:
410       type: rnc.nodes.CP.CM
411       properties:
412         order: 0
413         is_default: true
414       requirements:
415         - virtualBinding: CM_Active_Host
416         - virtualLink: CTRL_Net
417
418     CM_Active_Port_INTERMEDIA:
419       type: rnc.nodes.CP.CM
420       properties:
421         order: 1
422         is_default: false
423       requirements:
424         - virtualBinding: CM_Active_Host
425         - virtualLink: INTERMEDIA_Net
426
427     CM_Passive_Port_CTRL:
428       type: rnc.nodes.CP.CM
429       properties:
430         order: 0
431         is_default: true
432       requirements:
433         - virtualBinding: CM_Passive_Host
434         - virtualLink: CTRL_Net
435
436     CM_Passive_Port_INTERMEDIA:
437       type: rnc.nodes.CP.CM
438       properties:
439         order: 1
440         is_default: false
441       requirements:
442         - virtualBinding: CM_Passive_Host
443         - virtualLink: INTERMEDIA_Net
444
445     DM_Port_CTRL:
446       type: rnc.nodes.CP.DM
447       properties:
448         order: 0
449         is_default: true
450       requirements:
451         - virtualBinding: DM_Host
452         - virtualLink: CTRL_Net
453
454     DM_Port_INTERMEDIA:
455       type: rnc.nodes.CP.DM
456       properties:
457         order: 1
458         is_default: false
459       requirements:
460         - virtualBinding: DM_Host
461         - virtualLink: INTERMEDIA_Net
462
463     LB_Port_CTRL:
464       type: rnc.nodes.CP.LB
465       properties:
466         order: 0
467         is_default: true
468       requirements:
469         - virtualBinding: LB_Host
470         - virtualLink: CTRL_Net
471
472     LB_Port_INTERMEDIA:
473       type: rnc.nodes.CP.LB
474       properties:
475         order: 1
476         is_default: false
477       requirements:
478         - virtualBinding: LB_Host
479         - virtualLink: INTERMEDIA_Net
480
481     LB_Port_EXTERMEDIA:
482       type: rnc.nodes.CP.LB
483       properties:
484         order: 2
485         is_default: false
486       requirements:
487         - virtualBinding: LB_Host
488         - virtualLink: EXTERMEDIA_Net
489
490   # definition of the relationship templates of the topology
491   relationship_templates:
492     Storage_attachesto:
493       type: tosca.relationships.AttachesTo
494       properties:
495         location: /data_location
496
497   # definition of output parameters for the topology template
498   outputs:
499     private_ip_of_MM:
500       description: The private IP address of the MM.
501       value: { get_attribute: [ MM_Active_Host, private_address ] }
502
503     private_ip_of_CM:
504       description: The private IP address of the CM.
505       value: { get_attribute: [ CM_Active_Host, private_address ] }
506
507     private_ip_of_DM:
508       description: The private IP address of the DM.
509       value: { get_attribute: [ DM_Host, private_address ] }
510
511     private_ip_of_LB:
512       description: The private IP address of the LB.
513       value: { get_attribute: [ LB_Host, private_address ] }
514
515   # definition of logical groups of node templates within the topology
516   # To be continue about this section
517   groups:
518     AnitAffinityServerGroup:
519       type: tosca.groups.Root
520       description: >
521          Logical component grouping for anti affinity placement,
522          MM_Acitve, MM_Passive, CM_Acitve, CM_Passive, LB must host
523          on different host to reduce the impact to each other.
524       members: [ MM_Active, MM_Passive, CM_Active, CM_Passive, LB ]
525
526     AffinityServerGroup:
527       type: tosca.groups.Root
528       description: >
529         Logical component grouping for affinity placement,
530         CM and DM will be host on the same host to get high performence
531       members: [ CM_Active, DM ]
532
533   policies:
534     - AnitAffinityPolicy:
535         type: tosca.policies.Placement.Antilocate
536         description: Apply anti-locate placement policy to group
537         targets: [ AnitAffinityServerGroup ]
538
539     - AffinityPolicy:
540         type: tosca.policies.Placement.Colocate
541         description: Apply anti-locate placement policy to group
542         targets: [ AffinityServerGroup ]
543
544   #  ServerGroupScaling_DM: # added future
545   #    members: [ DM, ]# only one, will be error
546   #    policies:
547   #      - name: MyScaleUpPolicy
548   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
549   #      - rule: fn.utilizaton [ DM ], greater_than: 80
550   #      - trigger: script_dm
551
552   #  ServerGroupScaling_LB: # added future
553   #    members: [ LB, ] # only one, will be error
554   #    policies:
555   #      - name: MyScaleUpPolicy
556   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
557   #      - rule: fn.utilizaton [ LB ], greater_than: 80
558   #      - trigger: script_lb