[VVP] Misc tweaks and fixes to preload generation
[vvp/validation-scripts.git] / ice_validator / app_tests / preload_tests / sample_heat / base.yaml
1 heat_template_version: 2015-04-30
2
3 description: Base Module of Sample VNF
4
5 parameters:
6
7   # ONAP Assigned Parameters
8   workload_context:
9     type: string
10     description: Unique ID for this VNF instance
11
12   environment_context:
13     type: string
14     description: Unique ID for this VNF instance
15
16   vnf_id:
17     type: string
18     description: Unique ID for this VNF instance
19
20   vf_module_id:
21     type: string
22     description: Unique ID for this VNF module instance
23
24   vf_module_index:
25     type: number
26     description: Index of this VF Module
27
28   vnf_name:
29     type: string
30     description: Unique name for this VNF instance
31
32
33   # Availability Zones
34   availability_zone_0:
35     type: string
36     description: Primary Availability Zone
37
38   availability_zone_1:
39     type: string
40     description: Secondary Availability Zone
41
42
43   # External Networks
44   oam_net_id:
45     type: string
46     description: Operations, Administration, and Management Network
47
48   oam_subnet_id:
49     type: string
50     description: Subnet for OAM Network
51
52   ha_net_id:
53     type: string
54     description:  High Availability Network
55   
56   ctrl_net_id:
57     type: string
58     description: Control Plane network
59
60   ctrl_subnet_id:
61     type: string
62     description: Subnet for High Availability Network
63
64
65   # Server Inputs: Database
66   db_name_0:
67     type: string
68     description: Primary DB Server Name
69
70   db_name_1:
71     type: string
72     description: Secondary DB 
73
74   db_image_name:
75     type: string
76     description: Database VM Image Name
77
78   db_flavor_name:
79     type: string
80     description: Database VM Flavor Name
81
82   db_ha_floating_v6_ip:
83     type: string
84     description: Database Floating IPv6 Address for HA
85   
86   db_ha_floating_ip:
87     type: string
88     description: Database Floating IPv4 Address for HA
89
90   db_oam_ip_0:
91       type: string
92       description: Fixed IPv4 Address for OAM
93
94   db_oam_ip_1:
95       type: string
96       description: Fixed IPv4 Address for OAM
97
98   db_vol0_id:
99     type: string
100     description: Volume ID for DB in AZ 0
101
102   db_vol1_id:
103     type: string
104     description: Volume ID for DB in AZ 1
105
106
107   # Server Inputs: Loadbalancer
108   lb_name_0:
109     type: string
110     description: Load Balancer Name
111
112   lb_image_name:
113     type: string
114     description: Loadbalancer VM Image
115
116   lb_flavor_name:
117     type: string
118     description: Loadbalancer VM Flavor
119
120   lb_ha_floating_ip:
121     type: string
122     description: Floating HA IP for LB
123
124
125   lb_ha_floating_v6_ip:
126     type: string
127     description: Floating HA IP for LB
128
129
130   # Server Inputs: Webservice Controller Plane Interface (mgmt)
131   mgmt_name_0:
132     type: string
133     description: List of Management VM Names
134
135   mgmt_image_name:
136     type: string
137     description: Management VM Image
138
139   mgmt_flavor_name:
140     type: string
141     description: Management VM Flavor
142
143   mgmt_ctrl_ip_0:
144     type: string
145     description: IP to web service for control plane
146
147   mgmt_ctrl_v6_ip_0:
148     type: string
149     description: IP to web service for control plane
150
151
152   # Server Inputs: Services
153   svc_names:
154     type: comma_delimited_list
155     description: Service VM Names
156
157   svc_image_name:
158     type: string
159     description: Service VM Image
160
161   svc_flavor_name:
162     type: string
163     description: Service VM Flavor
164
165   svc_count:
166     type: number
167     description: Number of instances of Service to create
168
169 resources:
170
171   int_private_network:
172     type: OS::Neutron::Net
173
174   int_private_subnet:
175       type: OS::Neutron::Subnet
176       properties:
177           name:
178             str_replace:
179               template: $VNF_NAME-private_subnet
180               params:
181                 $VNF_NAME: { get_param: vnf_name }
182           network: { get_resource: int_private_network }
183
184   db_server_0:
185     type: OS::Nova::Server
186     properties:
187       image: { get_param: db_image_name }
188       flavor: { get_param: db_flavor_name }
189       name: { get_param: db_name_0 }
190       metadata:
191         vnf_id: { get_param: vnf_id }
192         vf_module_id: { get_param: vf_module_id }
193         vf_module_index: { get_param: vf_module_index }
194         vnf_name: { get_param: vnf_name }
195         workload_context: { get_param: workload_context }
196         environment_context: { get_param: environment_context }
197       networks:
198         - port: { get_resource: db_0_int_private_port_0 }
199         - port: { get_resource: db_0_ha_port_0 }
200         - port: { get_resource: db_0_oam_port_0 }
201       user_data: { get_file: user.data }
202       availability_zone: { get_param: availability_zone_0 }
203
204   db_server_1:
205     type: OS::Nova::Server
206     properties:
207       image: { get_param: db_image_name }
208       flavor: { get_param: db_flavor_name }
209       name: { get_param: db_name_1 }
210       metadata:
211         vnf_id: { get_param: vnf_id}
212         vf_module_id: { get_param: vf_module_id }
213         vnf_name: { get_param: vnf_name }
214         workload_context: { get_param: workload_context }
215         environment_context: { get_param: environment_context }
216       networks:
217         - port: {get_resource: db_1_int_private_port_0}
218         - port: {get_resource: db_1_ha_port_0}
219         - port: { get_resource: db_1_oam_port_0 }
220       availability_zone: { get_param: availability_zone_1 }
221
222   db_0_oam_port_0:
223     type: OS::Neutron::Port
224     properties:
225       network: { get_param: oam_net_id }
226       fixed_ips: 
227         - subnet: { get_param: oam_subnet_id }
228           ip_address: { get_param: db_oam_ip_0 }
229
230   db_0_ha_port_0:
231     type: OS::Neutron::Port
232     properties:
233       network: { get_param: ha_net_id }
234       allowed_address_pairs:
235         - ip_address: {get_param: db_ha_floating_ip }
236         - ip_address: {get_param: db_ha_floating_v6_ip }
237
238   db_0_int_private_port_0:
239     type: OS::Neutron::Port
240     properties:
241       network: { get_resource: int_private_network }
242       fixed_ips: 
243         - subnet: { get_resource: int_private_subnet }
244
245   db_1_oam_port_0:
246     type: OS::Neutron::Port
247     properties:
248       network: { get_param: oam_net_id }
249       fixed_ips: 
250         - subnet: { get_param: oam_subnet_id }
251           ip_address: { get_param: db_oam_ip_1 }
252
253   db_1_ha_port_0:
254     type: OS::Neutron::Port
255     properties:
256       network: { get_param: ha_net_id }
257       allowed_address_pairs:
258         - ip_address: {get_param: db_ha_floating_ip }
259         - ip_address: {get_param: db_ha_floating_v6_ip }
260
261   db_1_int_private_port_0:
262     type: OS::Neutron::Port
263     properties:
264       network: { get_resource: int_private_network }
265       fixed_ips: 
266         - subnet: { get_resource: int_private_subnet }
267
268
269   db_volume_attachment_0:
270     type: OS::Cinder::VolumeAttachment
271     properties:
272       volume_id: { get_param: db_vol0_id }
273       instance_uuid: { get_resource: db_server_0 }
274
275   db_volume_attachment_1:
276     type: OS::Cinder::VolumeAttachment
277     properties:
278       volume_id: { get_param: db_vol1_id }
279       instance_uuid: { get_resource: db_server_1 }
280
281   mgmt_server_0:
282     type: OS::Nova::Server
283     properties:
284       image: { get_param: mgmt_image_name }
285       flavor: { get_param: mgmt_flavor_name }
286       name: { get_param: mgmt_name_0 }
287       metadata:
288         vnf_id: { get_param: vnf_id }
289         vf_module_id: { get_param: vf_module_id }
290         vf_module_index: { get_param: vf_module_index }
291         vnf_name: { get_param: vnf_name }
292         workload_context: { get_param: workload_context }
293         environment_context: { get_param: environment_context }
294       networks:
295         - port: { get_resource: mgmt_0_int_private_port_0 }
296         - port: { get_resource: mgmt_0_ctrl_port_0 }
297       user_data: { get_file: user.data }
298       availability_zone: { get_param: availability_zone_0 }
299
300   mgmt_0_int_private_port_0:
301     type: OS::Neutron::Port
302     properties:
303       network: { get_resource: int_private_network }
304       fixed_ips: 
305         - subnet: { get_resource: int_private_subnet }
306
307   mgmt_0_ctrl_port_0:
308     type: OS::Neutron::Port
309     properties:
310       network: { get_param: ctrl_net_id }
311       fixed_ips:
312         - subnet: { get_param: ctrl_subnet_id }
313         - ip_address: { get_param: mgmt_ctrl_ip_0 }
314         - ip_address: { get_param: mgmt_ctrl_v6_ip_0}
315           
316   lb_server_0:
317     type: OS::Nova::Server
318     properties:
319       image: { get_param: lb_image_name }
320       flavor: { get_param: lb_flavor_name }
321       name: { get_param: lb_name_0 }
322       metadata:
323         vnf_id: { get_param: vnf_id }
324         vf_module_id: { get_param: vf_module_id }
325         vf_module_index: { get_param: vf_module_index }
326         vnf_name: { get_param: vnf_name }
327         workload_context: { get_param: workload_context }
328         environment_context: { get_param: environment_context }
329       networks:
330         - port: { get_resource: lb_0_int_private_port_0 }
331         - port: { get_resource: lb_0_ha_port_0 }
332       user_data: { get_file: user.data }
333       availability_zone: { get_param: availability_zone_0 }
334
335   lb_0_ha_port_0:
336     type: OS::Neutron::Port
337     properties:
338       network: { get_param: ha_net_id }
339       allowed_address_pairs:
340         - ip_address: {get_param: lb_ha_floating_ip }
341         - ip_address: {get_param: lb_ha_floating_v6_ip }
342
343   lb_0_int_private_port_0:
344     type: OS::Neutron::Port
345     properties:
346       network: { get_resource: int_private_network }
347       fixed_ips: 
348         - subnet: { get_resource: int_private_subnet }
349   
350   svc_resource_group_0:
351     type: OS::Heat::ResourceGroup
352     properties:
353       count: { get_param: svc_count }
354       resource_def:
355         type: nested_svc.yaml
356         properties:
357           workload_context: {get_param: workload_context}
358           environment_context: {get_param: environment_context}
359           vnf_id: {get_param: vnf_id}
360           vf_module_id: {get_param: vf_module_id}
361           vnf_name: {get_param: vnf_name}         
362           availability_zone_0: {get_param: availability_zone_0}
363           svc_names: {get_param: svc_names}
364           svc_image_name: {get_param: svc_image_name}
365           svc_flavor_name: {get_param: svc_flavor_name}
366           index: "%index%"
367           int_private_net_id: {get_resource: int_private_network}
368           int_private_subnet_id: {get_resource: int_private_subnet}
369
370 outputs:
371
372   int_private_subnet_id:
373     value: { get_resource: int_private_subnet }
374
375   int_private_net_id:
376     value: { get_resource: int_private_network }