update parser document
[parser.git] / docs / parser_docs / tosca2heat / examples / Simple_RNC.yaml
1 # Required TOSCA Definitions version string
2 tosca_definitions_version: tosca_simple_yaml_1_0
3
4 metadata:
5   template_name: tosca_simple_profile_for_nfv
6   template_author: opnfv_parser_project
7   template_version: tosca_simple_profile_for_nfv_1_0
8
9 # Optional description of the definitions inside the file.
10 description: >
11   TOSCA simple profile for RNC
12     1, Compute Node MM, CM, DM, LB...
13       1.1 MM: MaintainModule;
14       1.2 CM: Control Module;
15       1.3 DM: Data Module;
16       1.4 LB: LineCard Module
17     2, Network Node VL and CP
18
19 imports:
20   - Simple_RNC_definition.yaml
21
22 # list of YAML alias anchors (or macros)
23 dsl_definitions:
24   compute_props_os_DEF: &compute_props_os_DEF
25     architecture: x86_64
26     type: Linux
27     distribution: Ubuntu
28     version: 14.10
29
30   compute_props_host_MM: &compute_props_host_MM
31     disk_size: 80 GB
32     iops: 300
33     num_cpus: 8
34     mem_size: 8192 MB
35     swap: 512 MB
36
37   compute_props_host_CM: &compute_props_host_CM
38     disk_size: 0 GB
39     num_cpus: 8
40     mem_size: 8192 MB
41
42   compute_props_host_DM: &compute_props_host_DM
43     disk_size: 0 GB
44     num_cpus: 8
45     mem_size: 8192 MB
46
47   compute_props_host_LB: &compute_props_host_LB
48     disk_size: 0 GB
49     num_cpus: 4
50     mem_size: 8192 MB
51
52 # topology template definition of the cloud application or service
53 topology_template:
54   # a description of the topology template
55   description: >
56     simple RNC template
57
58   inputs:
59     mm_storage_size:
60       type: integer
61       default: 40 GB
62       description: mm additional block storage size
63       constraints:
64           - valid_values: [ 10, 20, 40, 80 ]
65
66   substitution_mappings:
67     type: rnc.nodes.VNF
68     properties:
69       vnfmtype: RADIO
70
71   # definition of the node templates of the topology
72   node_templates:
73     MM_Active:
74       type: rnc.nodes.compute.MM
75       properties:
76         activestatus: 1
77       requirements:
78         - host: MM_Active_Host
79         - high_availability: MM_Passive
80       artifacts:
81         #the VM image of MM
82         vm_image: mm.image
83       interfaces:
84         Standard:
85           create:
86             implementation: mm_install.sh
87           configure:
88             implementation: mm_active_configure.sh
89
90     MM_Passive:
91       type: rnc.nodes.compute.MM
92       properties:
93         activestatus: 0
94       requirements:
95         - host: MM_Passive_Host
96         - high_availability: MM_Active
97       artifacts:
98         #the VM image of MM
99         vm_image: mm.image
100       interfaces:
101         Standard:
102           create:
103             implementation: mm_install.sh
104           configure:
105             implementation: mm_passvie_configure.sh
106
107     MM_Active_Host:
108       type: rnc.nodes.compute.MM_Host
109       capabilities:
110         os:
111           properties: *compute_props_os_DEF
112         host:
113           properties: *compute_props_host_MM
114       requirements:
115         - local_storage:
116             node: MM_BlockStorage
117             relationship: Storage_attachesto
118       attributes:
119         ip_address: { get_attribute: [ SELF, private_address ] }
120
121     MM_Passive_Host:
122       type: rnc.nodes.compute.MM_Host
123       copy: MM_Active_Host
124
125     CM_Active:
126       type: rnc.nodes.compute.CM
127       properties:
128         activestatus: 1
129       requirements:
130         - host: CM_Active_Host
131         - high_availability: CM_Passive
132       artifacts:
133         #the VM image of CM
134         vm_image: cm.image
135       interfaces:
136         Standard:
137           create:
138             implementation: cm_install.sh
139           configure:
140             implementation: cm_active_configure.sh
141
142     CM_Passive:
143       type: rnc.nodes.compute.CM
144       properties:
145         activestatus: 0
146       requirements:
147         - host: CM_Passive_Host
148         - high_availability: CM_Active
149       artifacts:
150         #the VM image of CM
151         vm_image: mm.image
152       interfaces:
153         Standard:
154           create:
155             implementation: cm_install.sh
156           configure:
157             implementation: cm_passvie_configure.sh
158
159     CM_Active_Host:
160       type: rnc.nodes.compute.CM_Host
161       capabilities:
162         os:
163           properties: *compute_props_os_DEF
164         host:
165           properties: *compute_props_host_CM
166         scalable:
167           properties:
168             min_instances: 1
169             max_instances: 126
170             default_instances: 1
171       attributes:
172         ip_address: { get_attribute: [ SELF, private_address ] }
173
174     CM_Passive_Host:
175       type: rnc.nodes.compute.MM_Host
176       copy: CM_Active_Host
177
178     DM:
179       type: rnc.nodes.compute.DM
180       requirements:
181         - host: DM_Host
182       artifacts:
183         vm_image: dm.image
184       interfaces:
185         Standard:
186           create:
187             implementation: dm_install.sh
188           configure:
189             implementation: dm_configure.sh
190
191     DM_Host:
192       type: rnc.nodes.compute.DM_Host
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       attributes:
204         ip_address: { get_attribute: [ SELF, private_address ] }
205
206     LB:
207       type: rnc.nodes.compute.LB
208       requirements:
209         - host: LB_Host
210       artifacts:
211         #the VM image of LB
212         vm_image: lb.image
213       interfaces:
214         Standard:
215           create:
216             implementation: lb_install.sh
217           configure:
218             implementation: lb_configure.sh
219
220     LB_Host:
221       type: rnc.nodes.compute.LB_Host
222       capabilities:
223         os:
224           properties: *compute_props_os_DEF
225         host:
226           properties: *compute_props_host_LB
227         scalable:
228           properties:
229             min_instances: 1
230             max_instances: 20
231             default_instances: 1
232       attributes:
233         ip_address: { get_attribute: [ SELF, private_address ] }
234
235     MM_BlockStorage:
236       type: rnc.nodes.BlockStorage
237       properties:
238         size: { get_input: mm_storage_size }
239       interfaces:
240         Configure:
241           post_configure_target:
242             implementation: default_script.sh
243
244     CTRL_NetWork:
245       type: rnc.nodes.VL
246       properties:
247         vendor: "zte"
248         cidr: "128.0.0.0/8"
249         network_name: net1
250         dhcp_enabled: false
251
252     INTERMEDIA_NetWork:
253       type: rnc.nodes.VL
254       properties:
255         vendor: "zte"
256         cidr: "10.0.0.0/8"
257         network_name: net3
258         dhcp_enabled: true
259
260     EXTERMEDIA_NetWork:
261       type: rnc.nodes.VL
262       properties:
263         vendor: "zte"
264         cidr: "172.1.0.0/20"
265         network_name: net2
266         dhcp_enabled: true
267
268     EMS_NetWork:
269       type: rnc.nodes.VL
270       properties:
271         vendor: "zte"
272         cidr: "129.0.0.0/8"
273         network_name: net2
274         dhcp_enabled: true
275
276     MM_Port_EMS:
277       type: rnc.nodes.CP
278       properties:
279         order: 1
280         is_default: true
281       requirements:
282         - virtualbinding: MM_Active
283         - virtualLink: EMS_NetWork
284
285     MM_Port_CTRL:
286       type: rnc.nodes.CP
287       properties:
288         order: 0
289         is_default: true
290       requirements:
291         - virtualbinding: MM_Active
292         - virtualLink: CTRL_NetWork
293
294     MM_Port_EXTERMEDIA:
295       type: rnc.nodes.CP
296       properties:
297         order: 2
298         is_default: true
299       requirements:
300         - virtualbinding: MM_Active
301         - virtualLink: EXTERMEDIA_NetWork
302
303     CM_Port_CTRL:
304       type: rnc.nodes.CP
305       properties:
306         order: 0
307         is_default: true
308       requirements:
309         - virtualbinding: CM_Active
310         - virtualLink: CTRL_NetWork
311
312     CM_Port_INTERMEDIA:
313       type: rnc.nodes.CP
314       properties:
315         order: 1
316         is_default: false
317       requirements:
318         - virtualbinding: CM_Active
319         - virtualLink: INTERMEDIA_NetWork
320
321     DM_Port_CTRL:
322       type: rnc.nodes.CP
323       properties:
324         order: 0
325         is_default: true
326       requirements:
327         - virtualbinding: DM
328         - virtualLink: CTRL_NetWork
329
330     DM_Port_INTERMEDIA:
331       type: rnc.nodes.CP
332       properties:
333         order: 1
334         is_default: false
335       requirements:
336         - virtualbinding: DM
337         - virtualLink: INTERMEDIA_NetWork
338
339     LB_Port_CTRL:
340       type: rnc.nodes.CP
341       properties:
342         order: 0
343         is_default: true
344       requirements:
345         - virtualbinding: LB
346         - virtualLink: CTRL_NetWork
347
348     LB_Port_INTERMEDIA:
349       type: rnc.nodes.CP
350       properties:
351         order: 1
352         is_default: false
353       requirements:
354         - virtualbinding: LB
355         - virtualLink: INTERMEDIA_NetWork
356
357     LB_Port_EXTERMEDIA:
358       type: rnc.nodes.CP
359       properties:
360         order: 2
361         is_default: false
362       requirements:
363         - virtualbinding: LB
364         - virtualLink: EXTERMEDIA_NetWork
365
366   # definition of the relationship templates of the topology
367   relationship_templates:
368     Storage_attachesto:
369       type: tosca.relationships.AttachesTo
370       properties:
371       location: /data_location
372
373   # definition of output parameters for the topology template
374   outputs:
375     private_ip_of_MM:
376       description: The private IP address of the MM.
377       value: { get_attribute: [ MM_Active_Host, ip_address ] }
378
379     private_ip_of_CM:
380       description: The private IP address of the CM.
381       value: { get_attribute: [ CM_Active_Host, ip_address ] }
382
383     private_ip_of_DM:
384       description: The private IP address of the DM.
385       value: { get_attribute: [ DM_Host, ip_address ] }
386
387     private_ip_of_LB:
388       description: The private IP address of the LB.
389       value: { get_attribute: [ LB_Host, ip_address ] }
390
391   # definition of logical groups of node templates within the topology
392   # To be continue about this section
393   groups:
394     ServerGroupAnitAffinity: #
395       description: Logical component grouping for placement
396       members: [ MM_Acitve, MM_Passive, CM_Acitve, CM_Passive, LB ]
397       policies:
398         type: tosca.policy.placement.Antilocate
399
400   #  ServerGroupAffinity: #
401   #    members: [ CM, DM ]
402   #    policies:
403   #      type: tosca.policy.placement.Antilocate
404
405   #  ServerGroupScaling_DM: # added future
406   #    members: [ DM, ]# only one, will be error
407   #    policies:
408   #      - name: MyScaleUpPolicy
409   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
410   #      - rule: fn.utilizaton [ DM ], greater_than: 80
411   #      - trigger: script_dm
412
413   #  ServerGroupScaling_LB: # added future
414   #    members: [ LB, ] # only one, will be error
415   #    policies:
416   #      - name: MyScaleUpPolicy
417   #      - type: tosca.policy.scale.up | tosca.policy.scale.down
418   #      - rule: fn.utilizaton [ LB ], greater_than: 80
419   #      - trigger: script_lb