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