Merge "The artifacttype's parent_type definition is 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: Ubuntu
39     version: 14.10
40
41   compute_props_host_MM: &compute_props_host_MM
42     disk_size: 20 GB
43     num_cpus: 2
44     mem_size: 1024 MB
45
46   compute_props_host_CM: &compute_props_host_CM
47     disk_size: 0 GB
48     num_cpus: 2
49     mem_size: 1024 MB
50
51   compute_props_host_DM: &compute_props_host_DM
52     disk_size: 0 GB
53     num_cpus: 2
54     mem_size: 1024 MB
55
56   compute_props_host_LB: &compute_props_host_LB
57     disk_size: 0 GB
58     num_cpus: 2
59     mem_size: 1024 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: 20 GB
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: rnc.nodes.compute.MM
88       properties:
89         activestatus: 1
90         id: MM_Active
91       capabilities:
92         os:
93           properties: *compute_props_os_DEF
94         host:
95           properties: *compute_props_host_MM
96       requirements:
97         - local_storage:
98             node: MM_BlockStorage
99             relationship: Storage_attachesto
100         - high_availability: MM_Passive
101       artifacts:
102         #the VM image of MM
103         vm_image: mm.image
104       interfaces:
105         Standard:
106           create:
107             implementation: mm_install.sh
108           configure:
109             implementation: mm_active_configure.sh
110
111     MM_Passive:
112       type: rnc.nodes.compute.MM
113       properties:
114         activestatus: 0
115         id: MM_Passive
116       capabilities:
117         os:
118           properties: *compute_props_os_DEF
119         host:
120           properties: *compute_props_host_MM
121       requirements:
122         - local_storage:
123             node: MM_BlockStorage
124             relationship: Storage_attachesto
125         - high_availability: MM_Active
126       artifacts:
127         #the VM image of MM
128         vm_image: mm.image
129       interfaces:
130         Standard:
131           create:
132             implementation: mm_install.sh
133           configure:
134             implementation: mm_passvie_configure.sh
135
136     CM_Active:
137       type: rnc.nodes.compute.CM
138       properties:
139         activestatus: 1
140       capabilities:
141         os:
142           properties: *compute_props_os_DEF
143         host:
144           properties: *compute_props_host_CM
145         scalable:
146           properties:
147             min_instances: 1
148             max_instances: 126
149             default_instances: 1
150       requirements:
151         - high_availability: CM_Passive
152       artifacts:
153         #the VM image of CM
154         vm_image: cm.image
155       interfaces:
156         Standard:
157           create:
158             implementation: cm_install.sh
159           configure:
160             implementation: cm_active_configure.sh
161
162     CM_Passive:
163       type: rnc.nodes.compute.CM
164       properties:
165         activestatus: 0
166       capabilities:
167         os:
168           properties: *compute_props_os_DEF
169         host:
170           properties: *compute_props_host_CM
171         scalable:
172           properties:
173             min_instances: 1
174             max_instances: 126
175             default_instances: 1
176       requirements:
177         - high_availability: CM_Active
178       artifacts:
179         #the VM image of CM
180         vm_image: mm.image
181       interfaces:
182         Standard:
183           create:
184             implementation: cm_install.sh
185           configure:
186             implementation: cm_passvie_configure.sh
187
188     DM:
189       type: rnc.nodes.compute.DM
190       capabilities:
191         os:
192           properties: *compute_props_os_DEF
193         host:
194           properties: *compute_props_host_DM
195         scalable:
196           properties:
197             min_instances: 1
198             max_instances: 120
199             default_instances: 1
200       artifacts:
201         vm_image: dm.image
202       interfaces:
203         Standard:
204           create:
205             implementation: dm_install.sh
206           configure:
207             implementation: dm_configure.sh
208
209     LB:
210       type: rnc.nodes.compute.LB
211       capabilities:
212         os:
213           properties: *compute_props_os_DEF
214         host:
215           properties: *compute_props_host_LB
216         scalable:
217           properties:
218             min_instances: 1
219             max_instances: 20
220             default_instances: 1
221       artifacts:
222         #the VM image of LB
223         vm_image: lb.image
224       interfaces:
225         Standard:
226           create:
227             implementation: lb_install.sh
228           configure:
229             implementation: lb_configure.sh
230
231     MM_BlockStorage:
232       type: rnc.nodes.BlockStorage
233       properties:
234         size: { get_input: mm_storage_size }
235       interfaces:
236         Configure:
237           post_configure_target:
238             implementation: default_script.sh
239
240     CTRL_Net:
241       type: rnc.nodes.VL
242       properties:
243         vendor: ZTE
244         cidr: "128.0.0.0/8"
245         network_name: Ctrl_Net
246         network_type: vlan
247         segmentation_id: 110
248         dhcp_enabled: false
249
250     INTERMEDIA_Net:
251       type: rnc.nodes.VL
252       properties:
253         vendor: ZTE
254         cidr: 10.0.0.0/8
255         start_ip: 10.1.0.1
256         end_ip: 10.1.2.254
257         network_name: InterMedia_Net
258         network_type: vlan
259         segmentation_id: 111
260         dhcp_enabled: false
261
262     EXTERMEDIA_Net:
263       type: rnc.nodes.VL
264       properties:
265         vendor: ZTE
266         cidr: 172.1.0.0/16
267         start_ip: 172.1.0.2
268         end_ip: 172.1.2.254
269         gateway_ip: 172.1.0.1
270         network_name: ExterMdedia_Net
271         network_type: vlan
272         segmentation_id: 100
273         dhcp_enabled: false
274
275     EMS_Net:
276       type: rnc.nodes.VL
277       properties:
278         vendor: ZTE
279         cidr: 129.0.0.0/24
280         start_ip: 129.0.0.2
281         end_ip: 129.0.0.64
282         gateway_ip: 129.0.0.1
283         network_name: Ems_Net
284         network_type: vlan
285         segmentation_id: 101
286         dhcp_enabled: false
287
288     MM_Port_EMS:
289       type: rnc.nodes.CP.MM
290       properties:
291         order: 0
292         is_default: true
293       requirements:
294         - virtualBinding: MM_Active
295         - virtualLink: EMS_Net
296
297     MM_Port_EMS:
298       type: rnc.nodes.CP.MM
299       properties:
300         order: 0
301         is_default: true
302       requirements:
303         - virtualBinding: MM_Active
304         - virtualLink: EMS_Net
305
306     MM_Port_CTRL:
307       type: rnc.nodes.CP.MM
308       properties:
309         order: 1
310         is_default: false
311       requirements:
312         - virtualBinding: MM_Active
313         - virtualLink: CTRL_Net
314
315     MM_Port_EXTERMEDIA:
316       type: rnc.nodes.CP.MM
317       properties:
318         order: 2
319         is_default: false
320       requirements:
321         - virtualBinding: MM_Active
322         - virtualLink: EXTERMEDIA_Net
323
324     CM_Port_CTRL:
325       type: rnc.nodes.CP.CM
326       properties:
327         order: 0
328         is_default: true
329       requirements:
330         - virtualBinding: CM_Active
331         - virtualLink: CTRL_Net
332
333     CM_Port_INTERMEDIA:
334       type: rnc.nodes.CP.CM
335       properties:
336         order: 1
337         is_default: false
338       requirements:
339         - virtualBinding: CM_Active
340         - virtualLink: INTERMEDIA_Net
341
342     DM_Port_CTRL:
343       type: rnc.nodes.CP.DM
344       properties:
345         order: 0
346         is_default: true
347       requirements:
348         - virtualBinding: DM
349         - virtualLink: CTRL_Net
350
351     DM_Port_INTERMEDIA:
352       type: rnc.nodes.CP.DM
353       properties:
354         order: 1
355         is_default: false
356       requirements:
357         - virtualBinding: DM
358         - virtualLink: INTERMEDIA_Net
359
360     LB_Port_CTRL:
361       type: rnc.nodes.CP.LB
362       properties:
363         order: 0
364         is_default: true
365       requirements:
366         - virtualBinding: LB
367         - virtualLink: CTRL_Net
368
369     LB_Port_INTERMEDIA:
370       type: rnc.nodes.CP.LB
371       properties:
372         order: 1
373         is_default: false
374       requirements:
375         - virtualBinding: LB
376         - virtualLink: INTERMEDIA_Net
377
378     LB_Port_EXTERMEDIA:
379       type: rnc.nodes.CP.LB
380       properties:
381         order: 2
382         is_default: false
383       requirements:
384         - virtualBinding: LB
385         - virtualLink: EXTERMEDIA_Net
386
387   # definition of the relationship templates of the topology
388   relationship_templates:
389     Storage_attachesto:
390       type: tosca.relationships.AttachesTo
391       properties:
392         location: /data_location
393
394   # definition of output parameters for the topology template
395   outputs:
396     private_ip_of_MM:
397       description: The private IP address of the MM.
398       value: { get_attribute: [ MM_Active, private_address ] }
399
400     private_ip_of_CM:
401       description: The private IP address of the CM.
402       value: { get_attribute: [ CM_Active, private_address ] }
403
404     private_ip_of_DM:
405       description: The private IP address of the DM.
406       value: { get_attribute: [ DM, private_address ] }
407
408     private_ip_of_LB:
409       description: The private IP address of the LB.
410       value: { get_attribute: [ LB, private_address ] }
411
412   # definition of logical groups of node templates within the topology
413   # To be continue about this section
414   groups:
415     AnitAffinityServerGroup:
416       type: tosca.groups.Root
417       description: >
418          Logical component grouping for anti affinity placement,
419          MM_Acitve, MM_Passive, CM_Acitve, CM_Passive, LB must host
420          on different host to reduce the impact to each other.
421       members: [ MM_Active, MM_Passive, CM_Active, CM_Passive, LB ]
422
423     AffinityServerGroup:
424       type: tosca.groups.Root
425       description: >
426         Logical component grouping for affinity placement,
427         CM and DM will be host on the same host to get high performence
428       members: [ CM_Active, DM ]
429
430   policies:
431     - AnitAffinityPolicy:
432         type: tosca.policies.Placement.Antilocate
433         description: Apply anti-locate placement policy to group
434         targets: [ AnitAffinityServerGroup ]
435
436     - AffinityPolicy:
437         type: tosca.policies.Placement.Colocate
438         description: Apply anti-locate placement policy to group
439         targets: [ AffinityServerGroup ]
440
441   #  ServerGroupScaling_DM: # added future
442   #    members: [ DM, ]# only one, will be error
443   #    policies:
444   #      - name: MyScaleUpPolicy
445   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
446   #      - rule: fn.utilizaton [ DM ], greater_than: 80
447   #      - trigger: script_dm
448
449   #  ServerGroupScaling_LB: # added future
450   #    members: [ LB, ] # only one, will be error
451   #    policies:
452   #      - name: MyScaleUpPolicy
453   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
454   #      - rule: fn.utilizaton [ LB ], greater_than: 80
455   #      - trigger: script_lb