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