Merge "fix import and vRNC Ctrl_net definition error"
[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
75   substitution_mappings:
76     node_type: rnc.nodes.VNF
77     properties:
78       vnfmtype: UMTS
79     requirements:
80       virtualLink_VNFM: [ MM_Port_CTRL, virtualLink ]
81       virtualLink_EMS: [ MM_Port_EMS, virtualLink ]
82       virtualLink_TRAFFIC: [ LB_Port_EXTERMEDIA, virtualLink ]
83
84   # definition of the node templates of the topology
85   node_templates:
86     MM_Active:
87       type: tosca.nodes.SoftwareComponent
88       properties:
89         component_version: 1.0
90       requirements:
91         - host: MM_Active_Host
92       interfaces:
93         Standard:
94           create:
95             implementation: mm_install.sh
96           configure:
97             implementation: mm_active_configure.sh
98
99     MM_Active_Host:
100       type: rnc.nodes.compute.MM
101       properties:
102         activestatus: 1
103         id: MM_Active
104       capabilities:
105         os:
106           properties: *compute_props_os_DEF
107         host:
108           properties: *compute_props_host_MM
109       requirements:
110         - local_storage:
111             node: MM_BlockStorage
112             relationship: Storage_attachesto
113         - high_availability: MM_Passive
114       artifacts:
115         #the VM image of MM
116         vm_image: mm.image
117
118     MM_Passive:
119       type: tosca.nodes.SoftwareComponent
120       properties:
121         component_version: 1.0
122       requirements:
123         - host: MM_Passive_Host
124       interfaces:
125         Standard:
126           create:
127             implementation: mm_install.sh
128           configure:
129             implementation: mm_passvie_configure.sh
130
131     MM_Passive_Host:
132       type: rnc.nodes.compute.MM
133       properties:
134         activestatus: 0
135         id: MM_Passive
136       capabilities:
137         os:
138           properties: *compute_props_os_DEF
139         host:
140           properties: *compute_props_host_MM
141       requirements:
142         - local_storage:
143             node: MM_BlockStorage
144             relationship: Storage_attachesto
145         - high_availability: MM_Active
146       artifacts:
147         #the VM image of MM
148         vm_image: mm.image
149
150     CM_Active:
151       type: tosca.nodes.SoftwareComponent
152       properties:
153         component_version: 1.0
154       requirements:
155         - host: CM_Active_Host
156       interfaces:
157         Standard:
158           create:
159             implementation: cm_install.sh
160           configure:
161             implementation: cm_active_configure.sh
162
163     CM_Active_Host:
164       type: rnc.nodes.compute.CM
165       properties:
166         activestatus: 1
167       capabilities:
168         os:
169           properties: *compute_props_os_DEF
170         host:
171           properties: *compute_props_host_CM
172         scalable:
173           properties:
174             min_instances: 1
175             max_instances: 12
176             default_instances: 1
177       requirements:
178         - high_availability: CM_Passive
179       artifacts:
180         #the VM image of CM
181         vm_image: cm.image
182
183     CM_Passive:
184       type: tosca.nodes.SoftwareComponent
185       properties:
186         component_version: 1.0
187       requirements:
188         - host: CM_Passive_Host
189       interfaces:
190         Standard:
191           create:
192             implementation: cm_install.sh
193           configure:
194             implementation: cm_passvie_configure.sh
195
196     CM_Passive_Host:
197       type: rnc.nodes.compute.CM
198       properties:
199         activestatus: 0
200       capabilities:
201         os:
202           properties: *compute_props_os_DEF
203         host:
204           properties: *compute_props_host_CM
205         scalable:
206           properties:
207             min_instances: 1
208             max_instances: 12
209             default_instances: 1
210       requirements:
211         - high_availability: CM_Active
212       artifacts:
213         #the VM image of CM
214         vm_image: mm.image
215
216     DM:
217       type: tosca.nodes.SoftwareComponent
218       properties:
219         component_version: 1.0
220       requirements:
221         - host: DM_Host
222       interfaces:
223         Standard:
224           create:
225             implementation: dm_install.sh
226           configure:
227             implementation: dm_configure.sh
228
229     DM_Host:
230       type: rnc.nodes.compute.DM
231       capabilities:
232         os:
233           properties: *compute_props_os_DEF
234         host:
235           properties: *compute_props_host_DM
236         scalable:
237           properties:
238             min_instances: 1
239             max_instances: 12
240             default_instances: 1
241       artifacts:
242         vm_image: dm.image
243
244     LB:
245       type: tosca.nodes.SoftwareComponent
246       properties:
247         component_version: 1.0
248       requirements:
249         - host: LB_Host
250       interfaces:
251         Standard:
252           create:
253             implementation: lb_install.sh
254           configure:
255             implementation: lb_configure.sh
256
257     LB_Host:
258       type: rnc.nodes.compute.LB
259       capabilities:
260         os:
261           properties: *compute_props_os_DEF
262         host:
263           properties: *compute_props_host_LB
264         scalable:
265           properties:
266             min_instances: 1
267             max_instances: 2
268             default_instances: 1
269       artifacts:
270         #the VM image of LB
271         vm_image: lb.image
272
273     MM_BlockStorage:
274       type: rnc.nodes.BlockStorage
275       properties:
276         size: { get_input: mm_storage_size }
277       interfaces:
278         Configure:
279           post_configure_target:
280             implementation: default_script.sh
281
282     CTRL_Net:
283       type: rnc.nodes.VL
284       properties:
285         vendor: ZTE
286         cidr: "128.0.0.0/8"
287         network_name: Ctrl_Net
288         network_type: vlan
289         segmentation_id: 110
290         dhcp_enabled: false
291
292     INTERMEDIA_Net:
293       type: rnc.nodes.VL
294       properties:
295         vendor: ZTE
296         cidr: 10.0.0.0/8
297         start_ip: 10.1.0.1
298         end_ip: 10.1.2.254
299         network_name: InterMedia_Net
300         network_type: vlan
301         segmentation_id: 111
302         dhcp_enabled: false
303
304     EXTERMEDIA_Net:
305       type: rnc.nodes.VL
306       properties:
307         vendor: ZTE
308         cidr: 172.1.0.0/16
309         start_ip: 172.1.0.2
310         end_ip: 172.1.2.254
311         gateway_ip: 172.1.0.1
312         network_name: ExterMdedia_Net
313         network_type: vlan
314         segmentation_id: 100
315         dhcp_enabled: false
316
317     EMS_Net:
318       type: rnc.nodes.VL
319       properties:
320         vendor: ZTE
321         cidr: 129.0.0.0/24
322         start_ip: 129.0.0.2
323         end_ip: 129.0.0.64
324         gateway_ip: 129.0.0.1
325         network_name: Ems_Net
326         network_type: vlan
327         segmentation_id: 101
328         dhcp_enabled: false
329
330     MM_Active_Port_EMS:
331       type: rnc.nodes.CP.MM
332       properties:
333         order: 0
334         is_default: true
335       requirements:
336         - virtualBinding: MM_Active_Host
337         - virtualLink: EMS_Net
338
339     MM_Active_Port_EXTERMEDIA:
340       type: rnc.nodes.CP.MM
341       properties:
342         order: 1
343         is_default: true
344       requirements:
345         - virtualBinding: MM_Active_Host
346         - virtualLink: EMS_Net
347
348     MM_Active_Port_CTRL:
349       type: rnc.nodes.CP.MM
350       properties:
351         order: 2
352         is_default: false
353       requirements:
354         - virtualBinding: MM_Active_Host
355         - virtualLink: CTRL_Net
356
357     MM_Active_Port_INTERMEDIA:
358       type: rnc.nodes.CP.MM
359       properties:
360         order: 3
361         is_default: false
362       requirements:
363         - virtualBinding: MM_Active_Host
364         - virtualLink: EXTERMEDIA_Net
365
366     MM_Passive_Port_EMS:
367       type: rnc.nodes.CP.MM
368       properties:
369         order: 0
370         is_default: true
371       requirements:
372         - virtualBinding: MM_Passive_Host
373         - virtualLink: EMS_Net
374
375     MM_Passive_Port_EXTERMEDIA:
376       type: rnc.nodes.CP.MM
377       properties:
378         order: 1
379         is_default: true
380       requirements:
381         - virtualBinding: MM_Passive_Host
382         - virtualLink: EMS_Net
383
384     MM_Passive_Port_CTRL:
385       type: rnc.nodes.CP.MM
386       properties:
387         order: 2
388         is_default: false
389       requirements:
390         - virtualBinding: MM_Passive_Host
391         - virtualLink: CTRL_Net
392
393     MM_Passive_Port_INTERMEDIA:
394       type: rnc.nodes.CP.MM
395       properties:
396         order: 3
397         is_default: false
398       requirements:
399         - virtualBinding: MM_Passive_Host
400         - virtualLink: EXTERMEDIA_Net
401
402     CM_Active_Port_CTRL:
403       type: rnc.nodes.CP.CM
404       properties:
405         order: 0
406         is_default: true
407       requirements:
408         - virtualBinding: CM_Active_Host
409         - virtualLink: CTRL_Net
410
411     CM_Active_Port_INTERMEDIA:
412       type: rnc.nodes.CP.CM
413       properties:
414         order: 1
415         is_default: false
416       requirements:
417         - virtualBinding: CM_Active_Host
418         - virtualLink: INTERMEDIA_Net
419
420     CM_Passive_Port_CTRL:
421       type: rnc.nodes.CP.CM
422       properties:
423         order: 0
424         is_default: true
425       requirements:
426         - virtualBinding: CM_Passive_Host
427         - virtualLink: CTRL_Net
428
429     CM_Passive_Port_INTERMEDIA:
430       type: rnc.nodes.CP.CM
431       properties:
432         order: 1
433         is_default: false
434       requirements:
435         - virtualBinding: CM_Passive_Host
436         - virtualLink: INTERMEDIA_Net
437
438     DM_Port_CTRL:
439       type: rnc.nodes.CP.DM
440       properties:
441         order: 0
442         is_default: true
443       requirements:
444         - virtualBinding: DM_Host
445         - virtualLink: CTRL_Net
446
447     DM_Port_INTERMEDIA:
448       type: rnc.nodes.CP.DM
449       properties:
450         order: 1
451         is_default: false
452       requirements:
453         - virtualBinding: DM_Host
454         - virtualLink: INTERMEDIA_Net
455
456     LB_Port_CTRL:
457       type: rnc.nodes.CP.LB
458       properties:
459         order: 0
460         is_default: true
461       requirements:
462         - virtualBinding: LB_Host
463         - virtualLink: CTRL_Net
464
465     LB_Port_INTERMEDIA:
466       type: rnc.nodes.CP.LB
467       properties:
468         order: 1
469         is_default: false
470       requirements:
471         - virtualBinding: LB_Host
472         - virtualLink: INTERMEDIA_Net
473
474     LB_Port_EXTERMEDIA:
475       type: rnc.nodes.CP.LB
476       properties:
477         order: 2
478         is_default: false
479       requirements:
480         - virtualBinding: LB_Host
481         - virtualLink: EXTERMEDIA_Net
482
483   # definition of the relationship templates of the topology
484   relationship_templates:
485     Storage_attachesto:
486       type: tosca.relationships.AttachesTo
487       properties:
488         location: /data_location
489
490   # definition of output parameters for the topology template
491   outputs:
492     private_ip_of_MM:
493       description: The private IP address of the MM.
494       value: { get_attribute: [ MM_Active_Host, private_address ] }
495
496     private_ip_of_CM:
497       description: The private IP address of the CM.
498       value: { get_attribute: [ CM_Active_Host, private_address ] }
499
500     private_ip_of_DM:
501       description: The private IP address of the DM.
502       value: { get_attribute: [ DM_Host, private_address ] }
503
504     private_ip_of_LB:
505       description: The private IP address of the LB.
506       value: { get_attribute: [ LB_Host, private_address ] }
507
508   # definition of logical groups of node templates within the topology
509   # To be continue about this section
510   groups:
511     AnitAffinityServerGroup:
512       type: tosca.groups.Root
513       description: >
514          Logical component grouping for anti affinity placement,
515          MM_Acitve, MM_Passive, CM_Acitve, CM_Passive, LB must host
516          on different host to reduce the impact to each other.
517       members: [ MM_Active, MM_Passive, CM_Active, CM_Passive, LB ]
518
519     AffinityServerGroup:
520       type: tosca.groups.Root
521       description: >
522         Logical component grouping for affinity placement,
523         CM and DM will be host on the same host to get high performence
524       members: [ CM_Active, DM ]
525
526   policies:
527     - AnitAffinityPolicy:
528         type: tosca.policies.Placement.Antilocate
529         description: Apply anti-locate placement policy to group
530         targets: [ AnitAffinityServerGroup ]
531
532     - AffinityPolicy:
533         type: tosca.policies.Placement.Colocate
534         description: Apply anti-locate placement policy to group
535         targets: [ AffinityServerGroup ]
536
537   #  ServerGroupScaling_DM: # added future
538   #    members: [ DM, ]# only one, will be error
539   #    policies:
540   #      - name: MyScaleUpPolicy
541   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
542   #      - rule: fn.utilizaton [ DM ], greater_than: 80
543   #      - trigger: script_dm
544
545   #  ServerGroupScaling_LB: # added future
546   #    members: [ LB, ] # only one, will be error
547   #    policies:
548   #      - name: MyScaleUpPolicy
549   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
550   #      - rule: fn.utilizaton [ LB ], greater_than: 80
551   #      - trigger: script_lb