push addional code
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / test / resources / mock / heat / resources / OS_Nova_Server / inputs / ep-jsa_net.yaml
1 heat_template_version: 2013-05-23
2
3 description: >
4   Version 2.0 02-09-2016 (Authors: John Doe, user PROD)
5
6 parameters:
7       security_group_name:
8         type: comma_delimited_list
9         description: CMAUI1, CMAUI2 server names
10       pcrf_security_group_name:
11         type: comma_delimited_list
12         description: CMAUI1, CMAUI2 server names
13       volume_type:
14         type: string
15         label:  volume type
16         description: volume type Gold
17
18       volume_size:
19         type: number
20         label:  volume size
21         description: my volume size 320GB
22
23       FSB_1_image:
24         type: string
25         label: MME_FSB1
26         description: MME_FSB1_15B-CP04-r5a01
27
28       FSB1_volume_name:
29         type: string
30         label: FSB1_volume
31         description: FSB1_volume_1
32
33       fsb1-name:
34         type: string
35         label: FSB1_name
36         description: FSB1_name
37
38       fsb1-flavor:
39         type: string
40         label: FSB1_flavor
41         description: FSB1_flavor
42
43       fsb1-zone:
44         type: string
45         label: FSB1_zone
46         description: FSB1_zone
47
48       fsb_zone:
49         type: string
50         label: FSB1_zone
51         description: FSB1_zone
52
53       fsb1-Internal1-mac:
54         type: string
55         label: FSB1_internal_mac
56         description: FSB1_internal_mac
57
58       fsb1-Internal2-mac:
59         type: string
60         label: FSB1_internal_mac
61         description: FSB1_internal_mac
62
63       fsb2-Internal1-mac:
64         type: string
65         label: FSB1_internal_mac
66         description: FSB1_internal_mac
67
68       oam_net_id:
69         type: string
70         label: oam_net_id
71         description: oam_net_id
72
73       jsa_net_name:
74         type: string
75         label: jsa_net_name
76         description: jsa_net_name
77
78       jsa_cidr:
79         type: string
80         label: jsa_cidr
81         description: jsa_cidr
82
83       pcrf_cps_net_name:
84         type: string
85         label: pcrf_cps_net_name
86         description: pcrf_cps_net_name
87
88       pcrf_psm_server_name:
89         type: string
90         label: pcrf_psm_server_name
91         description: pcrf_psm_server_name
92
93       pcrf_psm_image_name:
94         type: string
95         label: pcrf_psm_image_name
96         description: pcrf_psm_image_name
97
98       pcrf_psm_flavor_name:
99         type: string
100         label: pcrf_psm_flavor_name
101         description: pcrf_psm_flavor_name
102
103       availabilityzone_name:
104         type: string
105         label: availabilityzone_name
106         description: availabilityzone_name
107
108       pcm_server_name:
109         type: string
110         label: pcm_server_name
111         description: pcm_server_name
112
113       pcm_image_name:
114         type: string
115         label: pcm_image_name
116         description: pcm_image_name
117
118       pcm_flavor_name:
119         type: string
120         label: pcm_flavor_name
121         description: pcm_flavor_name
122
123       Internal1_net_name:
124         type: string
125         label: Internal1_net_name
126         description: Internal1_net_name
127
128       Internal1_forwarding_mode:
129         type: string
130         label: Internal1_forwarding_mode
131         description: Internal1_forwarding_mode
132
133       Internal1_shared:
134         type: string
135         label: Internal1_shared
136         description: Internal1_shared
137
138       Internal1_external:
139         type: string
140         label: Internal1_external
141         description: Internal1_external
142
143       Internal2_name:
144         type: string
145         label: Internal2_name
146         description: Internal2_name
147
148       Internal2_shared:
149         type: string
150         label: Internal2_shared
151         description: Internal2_shared
152
153       Internal2_external:
154         type: string
155         label: Internal2_external
156         description: Internal2_external
157
158       Internal2_forwarding_mode:
159         type: string
160         label: Internal2_forwarding_mode
161         description: Internal2_forwarding_mode
162
163       cps_net_name:
164         type: string
165         label: cps_net_name
166         description: cps_net_name
167
168       oam_net_name:
169         type: string
170         label: oam_net_name
171         description: oam_net_name
172       oam_net_gw:
173         type: string
174         description: prop
175       cps_net_ip:
176         type: string
177         description: prop
178       cps_net_mask:
179         type: string
180         description: prop
181       oam_net_ip:
182         type: string
183         description: prop
184       oam_net_mask:
185         type: string
186         description: prop
187       fsb1-oam-ip:
188         type: string
189         description: prop
190       pcrf_cps_net_ip:
191         type: string
192         description: prop
193       pcrf_vnf_id:
194         type: string
195         description: prop
196       pcm_vol:
197         type: string
198         description: prop
199       pcm_vol_01:
200         type: string
201         description: prop
202       snapshot01:
203         type: string
204         description: prop
205       snapshot02:
206         type: string
207         description: prop
208       VMME_FSB1_boot_volume:
209         type: string
210       network_name:
211         type: string
212         description: prop
213
214
215 resources:
216   FSB1:
217       type: OS::Nova::Server
218       depends_on: script_init
219       properties:
220         name: { get_param: fsb1-name }
221         block_device_mapping: [{device_name: "vda", volume_id : {get_param: VMME_FSB1_boot_volume }, delete_on_termination: "false" }]
222         flavor: { get_param: fsb1-flavor }
223         availability_zone: { get_param: fsb_zone }
224         networks:
225           - port: { get_resource: FSB1_Internal1 }
226             fixed_ip: 10.0.0.0
227             floating_ip: 10.0.0.1
228             network: 100_1000_0011
229             port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10}
230             subnet: 10.0.0.2
231           - port: { get_resource: FSB1_Internal2 }
232           - port: { get_resource: FSB1_OAM }
233         metadata:
234           write_files:
235             - path: /etc/sysconfig/network-scripts/ifcfg-eth0
236               permissions: "0644"
237               content:
238                 str_replace:
239                   template: { get_file: "file:///nimbus-ethernet" }
240                   params:
241                     $dev: eth0
242                     $ip: { get_param: cps_net_ip }
243                     $netmask: { get_param: cps_net_mask }
244             - path: /etc/sysconfig/network-scripts/ifcfg-eth1
245               permissions: "0644"
246               content:
247                 str_replace:
248                   template: { get_file: "file:///nimbus-ethernet-gw" }
249                   params:
250                     $dev: eth1
251                     $ip: { get_param: oam_net_ip }
252                     $netmask: { get_param: oam_net_mask }
253                     $gateway: { get_param: oam_net_gw }
254
255
256   FSB1_Internal1:
257       type: OS::Neutron::Port
258       properties:
259         network_id: { get_resource: Internal1-net }
260         mac_address: { get_param: fsb1-Internal1-mac }
261
262   FSB1_Internal2:
263       type: OS::Neutron::Port
264       properties:
265         network_id: { get_resource: Internal2-net }
266         mac_address: { get_param: fsb1-Internal2-mac }
267
268   FSB1_OAM:
269       type: OS::Neutron::Port
270       properties:
271         network_id: { get_param: oam_net_id }
272         fixed_ips:
273           - ip_address: { get_param: fsb1-oam-ip }
274
275   pcrf_server_init:
276     type: OS::Heat::MultipartMime
277     properties:
278       parts:
279       - config: { get_resource: network}
280       - config: { get_resource: script_init}
281
282   psm01_port_0:
283     type: OS::Neutron::Port
284     properties:
285       network: { get_param: pcrf_cps_net_name }
286       fixed_ips:
287         - ip_address: { get_param: pcrf_cps_net_ip }
288       security_groups: [{ get_param: pcrf_security_group_name }]
289
290   pcrf_server_psm:
291     type: OS::Nova::Server
292     properties:
293       config_drive: "True"
294       name: { get_param: pcrf_psm_server_name }
295       image: { get_param: pcrf_psm_image_name }
296       flavor: { get_param: pcrf_psm_flavor_name }
297       availability_zone: { get_param: availabilityzone_name }
298       networks:
299         - port: { get_resource: psm01_port_0}
300       user_data_format: RAW
301       user_data:
302         get_resource: pcrf_server_init
303       metadata:
304         vnf_id: {get_param: pcrf_vnf_id}
305   server_pcm:
306     type: OS::Nova::Server
307     properties:
308       config_drive: "True"
309       name: { get_param: pcm_server_name }
310       image: { get_param: pcm_image_name }
311       flavor: { get_param: pcm_flavor_name }
312       availability_zone: { get_param: availabilityzone_name }
313       networks:
314         - port: { get_resource: pcm_port_0}
315         - port: { get_resource: pcm_port_1}
316       block_device_mapping:
317         - device_name: vdb
318           volume_id: { get_param: pcm_vol}
319       user_data_format: RAW
320       user_data:
321         get_resource: server_init
322   server_VolumeTest:
323     type: OS::Nova::Server
324     properties:
325       config_drive: "True"
326       name: { get_param: pcm_server_name }
327       image: { get_param: pcm_image_name }
328       flavor: { get_param: pcm_flavor_name }
329       availability_zone: { get_param: availabilityzone_name }
330       block_device_mapping:
331         - device_name: vdb
332         - device_name: vdb
333           volume_id: { get_param: pcm_vol}
334         - device_name: vdb
335           volume_id: { get_param: pcm_vol_01}
336         - device_name: vdb
337           volume_id: { get_resource: pcm_vol_02}
338         - device_name: vdb
339           snapshot_id: { get_param: snapshot01}
340         - snapshot_id: { get_param: snapshot02}
341       user_data_format: RAW
342       user_data:
343         get_resource: server_init
344   server_init:
345     type: OS::Heat::MultipartMime
346     properties:
347       parts:
348       - config: { get_resource: network}
349       - config: { get_resource: script_init}
350   script_init:
351     type: OS::Heat::MultipartMime
352     properties:
353       parts:
354       - config: { get_resource: network}
355
356   network:
357     type: OS::Contrail::VirtualNetwork
358     properties:
359       name: { get_param: Internal1_net_name }
360
361   pcm_vol_02:
362       type: OS::Cinder::Volume
363       properties:
364         size: {get_param: volume_size}
365         volume_type: {get_param: volume_type}
366         name: {get_param: FSB1_volume_name}
367         image: {get_param: FSB_1_image}
368         read_only: 1
369
370   pcm_port_0:
371     type: OS::Neutron::Port
372     properties:
373       network: { get_param: cps_net_name }
374       fixed_ips:
375         - ip_address: { get_param: cps_net_ip }
376       security_groups: [{ get_param: security_group_name }]
377
378   pcm_port_1:
379     type: OS::Neutron::Port
380     properties:
381       network: { get_param: oam_net_name }
382       fixed_ips:
383         - ip_address: { get_param: oam_net_ip }
384       security_groups: [{ get_param: security_group_name }]
385
386   Internal1-net:
387     type: OS::Contrail::VirtualNetwork
388     properties:
389       name: { get_param: Internal1_net_name }
390       forwarding_mode: { get_param: Internal1_forwarding_mode }
391       shared: { get_param: Internal1_shared }
392       external: { get_param: Internal1_external }
393 #      route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
394
395   Internal2-net:
396     type: OS::Contrail::VirtualNetwork
397     properties:
398       name: { get_param: Internal2_name }
399       forwarding_mode: { get_param: Internal2_forwarding_mode }
400       shared: { get_param: Internal2_shared }
401       external: { get_param: Internal2_external }
402 #      route_targets: { "Fn::Split" : [ ",", Ref: route_targets ] }
403
404   FSB2:
405       type: OS::Nova::Server
406       properties:
407         name: { get_param: fsb1-name }
408         flavor: { get_param: fsb1-flavor }
409         availability_zone: { get_param: fsb_zone }
410         networks:
411           - network: {get_param: network_name}