1 # Heat template which intstantiates a 1+1 HA Perimeta instance with 4 or 5
4 # This is designed to be included in a higher level template.
6 # This template puts the Perimeta configuration in place using userdata
7 # injected via OpenStack's ConfigDrive mechanism.
9 # Host anti-affinity is achieved using different availability zones for
10 # the Perimeta instance or server group anti-affinity if they are in the
11 # same availability zone.
13 # Template requires Juno or above and has been tested on Kilo.
15 heat_template_version: 2014-10-16
18 HOT template to instantiate a Perimeta 1+1 HA instance with 4vNICs as part of a nested template
23 description: VNF ID of this deployment
26 description: Role of these VMs
29 description: Unique ID for this VF Module instance
31 type: comma_delimited_list
32 description: List of system names of Perimeta instances. Name of a specific instance is indexed by perimeta_instance_index
34 type: comma_delimited_list
35 description: List of names of Perimeta VM A instances, indexed by perimeta_instance_index
37 type: comma_delimited_list
38 description: List of names of Perimeta VM A instances, indexed by perimeta_instance_index
39 perimeta_instance_index:
41 description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances.
44 description: Glance image for Perimeta instance
46 - custom_constraint: glance.image
49 description: Flavor to use for creating VM instances
51 - custom_constraint: nova.flavor
54 description: Keypair to use for accessing this Perimeta instance
56 - custom_constraint: nova.keypair
58 # Can be commented out along with references if always using a single availability zone
60 description: Availability zone for A instances.
62 # Can be commented out along with references if always using a single availability zone
64 description: Availability zone for B instances. May be the same as A instance.
67 description: Management network id
69 - custom_constraint: neutron.network
72 description: Prefix length of management network
73 mgmt_net_default_gateway:
75 description: IP address of management default gateway
77 type: comma_delimited_list
78 description: List of management virtual IP addresses for all instances.
80 type: comma_delimited_list
81 description: List of fixed IP addresses to use as management IPs of A instances.
83 type: comma_delimited_list
84 description: List of fixed IP addresses to use as management IPs of B instances.
86 type: comma_delimited_list
87 description: List of security groups to add on management interfaces.
90 description: HA network id
92 - custom_constraint: neutron.network
96 - range: { min: 0, max: 32 }
97 description: ha_network_plen must be between 0 and 32
99 type: comma_delimited_list
100 description: List of fixed IP addresses to use as HA IPs of A instances.
102 type: comma_delimited_list
103 description: List of fixed IP addresses to use as HA IPs of B instances.
105 type: comma_delimited_list
106 description: List of security groups to add on HA interfaces.
109 description: Service network 1 network UUID
111 - custom_constraint: neutron.network
113 type: comma_delimited_list
114 description: List of service network 1 virtual IP addresses for all instances.
116 type: comma_delimited_list
117 description: List of fixed IP addresses to use as trusted fixed IPs of A instances.
119 type: comma_delimited_list
120 description: List of fixed IP addresses to use as trusted fixed IPs of B instances.
122 type: comma_delimited_list
123 description: List of security groups to add on trusted interfaces.
126 description: Service network 2 network UUID
128 - custom_constraint: neutron.network
130 type: comma_delimited_list
131 description: List of service network 2 virtual IP addresses for all instances.
133 type: comma_delimited_list
134 description: List of service network 2 alternate virtual IP addresses for all instances.
136 type: comma_delimited_list
137 description: List of fixed IP addresses to use as untrusted fixed IPs of A instances.
139 type: comma_delimited_list
140 description: List of fixed IP addresses to use as untrusted alternate fixed IPs of A instances.
142 type: comma_delimited_list
143 description: List of fixed IP addresses to use as untrusted fixed IPs of B instances.
145 type: comma_delimited_list
146 description: List of fixed IP addresses to use as untrusted alternate fixed IPs of B instances.
147 untrusted_sec_groups:
148 type: comma_delimited_list
149 description: List of security groups to add on untrusted interfaces.
152 description: Number of VLANs to connect to on the untrusted/access network
154 type: comma_delimited_list
155 description: List of VLAN IDs to use on the untrusted/access network
156 untrusted_vlan_networks:
157 type: comma_delimited_list
158 description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list.
161 description: Service network 3 network UUID
163 type: comma_delimited_list
164 description: List of service network 3 virtual IP addresses for all instances.
166 type: comma_delimited_list
167 description: List of fixed IP addresses to use as serv3 fixed IPs of A instances.
169 type: comma_delimited_list
170 description: List of fixed IP addresses to use as serv3 fixed IPs of B instances.
172 type: comma_delimited_list
173 description: List of security groups to add on serv3 interfaces.
176 description: Service network unused port network UUID
177 perimeta_param_server_group:
179 description: Server group to use for these VMs - ignored
182 description: Orchestration template configuration for instance.
186 # Perimeta management ports
187 perimeta_a_mgmt_0_port:
188 type: OS::Neutron::Port
192 template: $VM_mgmt_port
194 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
195 network_id: { get_param: mgmt_net_id }
197 - ip_address: { get_param: [ mgmt_a_ips, { get_param: perimeta_instance_index } ] }
198 security_groups: { get_param: mgmt_sec_groups }
199 allowed_address_pairs:
200 - ip_address: { get_param: [ mgmt_vips, { get_param: perimeta_instance_index } ] }
202 perimeta_b_mgmt_0_port:
203 type: OS::Neutron::Port
207 template: $VM_mgmt_port
209 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
210 network_id: { get_param: mgmt_net_id }
212 - ip_address: { get_param: [ mgmt_b_ips, { get_param: perimeta_instance_index } ] }
213 security_groups: { get_param: mgmt_sec_groups }
214 allowed_address_pairs:
215 - ip_address: { get_param: [ mgmt_vips, { get_param: perimeta_instance_index } ] }
218 perimeta_a_ha_0_port:
219 type: OS::Neutron::Port
223 template: $VM_ha_port
225 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
226 network_id: { get_param: ha_net_id }
228 - ip_address: { get_param: [ ha_a_ips, { get_param: perimeta_instance_index } ] }
229 security_groups: { get_param: ha_sec_groups }
231 perimeta_b_ha_0_port:
232 type: OS::Neutron::Port
236 template: $VM_ha_port
238 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
239 network_id: { get_param: ha_net_id }
241 - ip_address: { get_param: [ ha_b_ips, { get_param: perimeta_instance_index } ] }
242 security_groups: { get_param: ha_sec_groups }
244 # Perimeta core/trusted service network ports
246 # Dual stack core network - if only IPv4 required, comment out second entry
247 # in fixed_ips and allowed_addrsess_pairs parameters.
248 perimeta_a_trusted_0_port:
249 type: OS::Neutron::Port
253 template: $VM_trusted_port
255 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
256 network_id: { get_param: trusted_net_id }
258 - ip_address: { get_param: [ trusted_a_ips, { get_param: perimeta_instance_index } ] }
259 security_groups: { get_param: trusted_sec_groups }
260 allowed_address_pairs:
261 - ip_address: { get_param: [ trusted_vips, { get_param: perimeta_instance_index } ] }
263 perimeta_b_trusted_0_port:
264 type: OS::Neutron::Port
268 template: $VM_trusted_port
270 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
271 network_id: { get_param: trusted_net_id }
273 - ip_address: { get_param: [ trusted_b_ips, { get_param: perimeta_instance_index } ] }
274 security_groups: { get_param: trusted_sec_groups }
275 allowed_address_pairs:
276 - ip_address: { get_param: [ trusted_vips, { get_param: perimeta_instance_index } ] }
278 # Perimeta access/untrusted service network ports
280 # Dual stack access network - if only IPv4 required, comment out second entry
281 # in fixed_ips and allowed_addrsess_pairs parameters.
282 perimeta_a_untrusted_0_port:
283 type: OS::Neutron::Port
287 template: $VM_untrusted_port
289 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
290 network_id: { get_param: untrusted_net_id }
292 - ip_address: { get_param: [ untrusted_a_ips, { get_param: perimeta_instance_index } ] }
293 - ip_address: { get_param: [ untrusted_a_v6_ips, { get_param: perimeta_instance_index } ] }
294 security_groups: { get_param: untrusted_sec_groups }
295 allowed_address_pairs:
296 - ip_address: { get_param: [ untrusted_vips, { get_param: perimeta_instance_index } ] }
297 - ip_address: { get_param: [ untrusted_v6_vips, { get_param: perimeta_instance_index } ] }
299 # Contrail VLAN subinterfaces
300 perimeta_a_untrusted_0_vlan_ports:
301 type: OS::Heat::ResourceGroup
303 count: { get_param: untrusted_num_vlans }
305 type: vlan_subinterface_dual.yaml
307 subinterface_instance_index: "%index%"
308 subinterface_name_prefix:
310 template: $VM_untrusted_port_vlan_
312 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
313 parent_interface: { get_resource: perimeta_a_untrusted_0_port }
314 mac_address: { get_attr: [ perimeta_a_untrusted_0_port, mac_address ] }
315 ip_address: { get_param: [ untrusted_a_ips, { get_param: perimeta_instance_index } ] }
316 ipv6_address: { get_param: [ untrusted_a_v6_ips, { get_param: perimeta_instance_index } ] }
317 virtual_ip_address: { get_param: [ untrusted_vips, { get_param: perimeta_instance_index } ] }
318 virtual_ipv6_address: { get_param: [ untrusted_v6_vips, { get_param: perimeta_instance_index } ] }
319 vlan_ids: { get_param: untrusted_vlan_ids }
320 vlan_networks: { get_param: untrusted_vlan_networks }
322 perimeta_b_untrusted_0_port:
323 type: OS::Neutron::Port
327 template: $VM_untrusted_port
329 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
330 network_id: { get_param: untrusted_net_id }
332 - ip_address: { get_param: [ untrusted_b_ips, { get_param: perimeta_instance_index } ] }
333 - ip_address: { get_param: [ untrusted_b_v6_ips, { get_param: perimeta_instance_index } ] }
334 security_groups: { get_param: untrusted_sec_groups }
335 allowed_address_pairs:
336 - ip_address: { get_param: [ untrusted_vips, { get_param: perimeta_instance_index } ] }
337 - ip_address: { get_param: [ untrusted_v6_vips, { get_param: perimeta_instance_index } ] }
339 # Contrail VLAN subinterfaces
340 perimeta_b_untrusted_0_vlan_ports:
341 type: OS::Heat::ResourceGroup
343 count: { get_param: untrusted_num_vlans }
345 type: vlan_subinterface_dual.yaml
347 subinterface_instance_index: "%index%"
348 subinterface_name_prefix:
350 template: $VM_untrusted_port_vlan_
352 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
353 parent_interface: { get_resource: perimeta_b_untrusted_0_port }
354 mac_address: { get_attr: [ perimeta_b_untrusted_0_port, mac_address ] }
355 ip_address: { get_param: [ untrusted_b_ips, { get_param: perimeta_instance_index } ] }
356 ipv6_address: { get_param: [ untrusted_b_v6_ips, { get_param: perimeta_instance_index } ] }
357 virtual_ip_address: { get_param: [ untrusted_vips, { get_param: perimeta_instance_index } ] }
358 virtual_ipv6_address: { get_param: [ untrusted_v6_vips, { get_param: perimeta_instance_index } ] }
359 vlan_ids: { get_param: untrusted_vlan_ids }
360 vlan_networks: { get_param: untrusted_vlan_networks }
362 # Perimeta Rf service network ports (SSC only)
364 # Dual stack access network - if only IPv4 required, comment out second entry
365 # in fixed_ips and allowed_addrsess_pairs parameters.
366 perimeta_a_serv3_0_port:
367 type: OS::Neutron::Port
371 template: $VM_serv3_port
373 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
374 network_id: { get_param: serv3_net_id }
376 - ip_address: { get_param: [ serv3_a_ips, { get_param: perimeta_instance_index } ] }
377 security_groups: { get_param: serv3_sec_groups }
378 allowed_address_pairs:
379 - ip_address: { get_param: [ serv3_vips, { get_param: perimeta_instance_index } ] }
381 perimeta_b_serv3_0_port:
382 type: OS::Neutron::Port
386 template: $VM_serv3_port
388 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
389 network_id: { get_param: serv3_net_id }
391 - ip_address: { get_param: [ serv3_b_ips, { get_param: perimeta_instance_index } ] }
392 security_groups: { get_param: serv3_sec_groups }
393 allowed_address_pairs:
394 - ip_address: { get_param: [ serv3_vips, { get_param: perimeta_instance_index } ] }
396 perimeta_a_unused_0_port:
397 type: OS::Neutron::Port
401 template: $VM_unused_port
403 $VM: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
404 network: { get_param: unused_net_id }
406 perimeta_b_unused_0_port:
407 type: OS::Neutron::Port
411 template: $VM_unused_port
413 $VM: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
414 network: { get_param: unused_net_id }
416 # Add any additional service ports here.
418 # Only supported in Juno and beyond - used to enforce host anti-affinity
419 # Can be commented out along with references to it if always using
420 # different availability zones.
421 perimeta_server_group:
422 type: OS::Nova::ServerGroup
426 template: $SYSTEM_server_group
428 $SYSTEM: { get_param: [ system_names, { get_param: perimeta_instance_index } ] }
429 policies: ['anti-affinity']
432 type: OS::Nova::Server
433 depends_on: perimeta_b_server_0
435 name: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
436 image: { get_param: perimeta_image_name }
437 flavor: { get_param: perimeta_flavor_name }
438 key_name: { get_param: perimeta_keypair }
439 scheduler_hints: { group: { get_resource: perimeta_server_group } }
441 'vnf_id': { get_param: vnf_id }
446 $ROLE: { get_param: vm_role }
447 'vf_module_id': { get_param: vf_module_id }
449 '/opt/MetaSwitch/init/custom.ini': { get_file: custom.ini }
452 - port: { get_resource: perimeta_a_mgmt_0_port }
453 - port: { get_resource: perimeta_a_ha_0_port }
454 - port: { get_resource: perimeta_a_trusted_0_port }
455 - port: { get_resource: perimeta_a_untrusted_0_port }
456 - port: { get_resource: perimeta_a_serv3_0_port }
457 - port: { get_resource: perimeta_a_unused_0_port }
458 availability_zone: { get_param: availability_zone_0 }
460 user_data_format: RAW
463 template: { get_param: perimeta_config }
465 $MGMT_MACADDR: { get_attr: [perimeta_a_mgmt_0_port, mac_address] }
466 $HA_MACADDR: { get_attr: [perimeta_a_ha_0_port, mac_address] }
467 $TRUSTED_MACADDR: { get_attr: [perimeta_a_trusted_0_port, mac_address] }
468 $UNTRUSTED_MACADDR: { get_attr: [perimeta_a_untrusted_0_port, mac_address] }
469 $SERV3_MACADDR: { get_attr: [perimeta_a_serv3_0_port, mac_address] }
470 $SERV4_MACADDR: { get_attr: [perimeta_a_unused_0_port, mac_address] }
471 $LOCAL_HA_IP_ADDR: { get_param: [ ha_a_ips, { get_param: perimeta_instance_index } ] }
472 $REMOTE_HA_IP_ADDR: { get_param: [ ha_b_ips, { get_param: perimeta_instance_index } ] }
473 $HA_NETWORK_PLEN: { get_param: ha_network_plen }
474 $LOCAL_MGMT_IP_ADDR: { get_param: [ mgmt_a_ips, { get_param: perimeta_instance_index } ] }
475 $REMOTE_MGMT_IP_ADDR: { get_param: [ mgmt_b_ips, { get_param: perimeta_instance_index } ] }
476 $MGMT_NETWORK_PLEN: { get_param: mgmt_net_plen }
477 $MGMT_NETWORK_DEFAULT_GATEWAY: { get_param: mgmt_net_default_gateway }
478 $VIRT_MGMT_IP_ADDR: { get_param: [ mgmt_vips, { get_param: perimeta_instance_index } ] }
479 $VIRT_TRUSTED_IP_ADDR: { get_param: [ trusted_vips, { get_param: perimeta_instance_index } ] }
480 $LOCAL_TRUSTED_IP_ADDR: { get_param: [ trusted_a_ips, { get_param: perimeta_instance_index } ] }
481 $REMOTE_TRUSTED_IP_ADDR: { get_param: [ trusted_b_ips, { get_param: perimeta_instance_index } ] }
482 $VIRT_UNTRUSTED_IP_ADDR: { get_param: [ untrusted_vips, { get_param: perimeta_instance_index } ] }
483 $VIRT_UNTRUSTED_ALT_IP_ADDR: { get_param: [ untrusted_v6_vips, { get_param: perimeta_instance_index } ] }
484 $LOCAL_UNTRUSTED_IP_ADDR: { get_param: [ untrusted_a_ips, { get_param: perimeta_instance_index } ] }
485 $LOCAL_UNTRUSTED_ALT_IP_ADDR: { get_param: [ untrusted_a_v6_ips, { get_param: perimeta_instance_index } ] }
486 $REMOTE_UNTRUSTED_IP_ADDR: { get_param: [ untrusted_b_ips, { get_param: perimeta_instance_index } ] }
487 $REMOTE_UNTRUSTED_ALT_IP_ADDR: { get_param: [ untrusted_b_v6_ips, { get_param: perimeta_instance_index } ] }
488 $VIRT_SERV3_IP_ADDR: { get_param: [ serv3_vips, { get_param: perimeta_instance_index } ] }
489 $LOCAL_SERV3_IP_ADDR: { get_param: [ serv3_a_ips, { get_param: perimeta_instance_index } ] }
490 $REMOTE_SERV3_IP_ADDR: { get_param: [ serv3_b_ips, { get_param: perimeta_instance_index } ] }
491 $VM_NAME_A: { get_param: [ vm_a_names, { get_param: perimeta_instance_index } ] }
492 $VM_NAME_B: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
493 $SYSTEM_NAME: { get_param: [ system_names, { get_param: perimeta_instance_index } ] }
496 type: OS::Nova::Server
498 name: { get_param: [ vm_b_names, { get_param: perimeta_instance_index } ] }
499 image: { get_param: perimeta_image_name }
500 flavor: { get_param: perimeta_flavor_name }
501 key_name: { get_param: perimeta_keypair }
502 scheduler_hints: { group: { get_resource: perimeta_server_group } }
504 'vnf_id': { get_param: vnf_id }
509 $ROLE: { get_param: vm_role }
510 'vf_module_id': { get_param: vf_module_id }
512 - port: { get_resource: perimeta_b_mgmt_0_port }
513 - port: { get_resource: perimeta_b_ha_0_port }
514 - port: { get_resource: perimeta_b_trusted_0_port }
515 - port: { get_resource: perimeta_b_untrusted_0_port }
516 - port: { get_resource: perimeta_b_serv3_0_port }
517 - port: { get_resource: perimeta_b_unused_0_port }
518 availability_zone: { get_param: availability_zone_1 }
520 user_data_format: RAW
526 "IBG1mgmt": {"mac": "$MGMT_MACADDR"},
527 "IPG1": {"mac": "$HA_MACADDR"},
528 "RPG1": {"mac": "$TRUSTED_MACADDR"},
529 "RPG2": {"mac": "$UNTRUSTED_MACADDR"},
530 "RPG3": {"mac": "$SERV3_MACADDR"},
531 "RPG4": {"mac": "$SERV4_MACADDR"}
533 "ip_ha_local": "$LOCAL_HA_IP_ADDR",
534 "ip_ha_remote": "$REMOTE_HA_IP_ADDR",
535 "ip_ha_plen": "$HA_NETWORK_PLEN"
536 //"ip_mgmt_local": "$LOCAL_MGMT_IP_ADDR",
537 //"ip_mgmt_remote": "$REMOTE_MGMT_IP_ADDR",
538 //"ip_mgmt_plen": "$MGMT_NETWORK_PLEN",
539 //"ip_mgmt_gway": "$MGMT_NETWORK_DEFAULT_GATEWAY"
543 $MGMT_MACADDR: { get_attr: [perimeta_b_mgmt_0_port, mac_address] }
544 $HA_MACADDR: { get_attr: [perimeta_b_ha_0_port, mac_address] }
545 $TRUSTED_MACADDR: { get_attr: [perimeta_b_trusted_0_port, mac_address] }
546 $UNTRUSTED_MACADDR: { get_attr: [perimeta_b_untrusted_0_port, mac_address] }
547 $SERV3_MACADDR: { get_attr: [perimeta_b_serv3_0_port, mac_address] }
548 $SERV4_MACADDR: { get_attr: [perimeta_b_unused_0_port, mac_address] }
549 $LOCAL_HA_IP_ADDR: { get_param: [ ha_b_ips, { get_param: perimeta_instance_index } ] }
550 $REMOTE_HA_IP_ADDR: { get_param: [ ha_a_ips, { get_param: perimeta_instance_index } ] }
551 $HA_NETWORK_PLEN: { get_param: ha_network_plen }
552 $LOCAL_MGMT_IP_ADDR: { get_param: [ mgmt_b_ips, { get_param: perimeta_instance_index } ] }
553 $REMOTE_MGMT_IP_ADDR: { get_param: [ mgmt_a_ips, { get_param: perimeta_instance_index } ] }
554 $MGMT_NETWORK_PLEN: { get_param: mgmt_net_plen }
555 $MGMT_NETWORK_DEFAULT_GATEWAY: { get_param: mgmt_net_default_gateway }
560 description: Server group used for these VMs
561 value: { get_resource: perimeta_server_group }