[akraino] Add IEC K8-calico scenarios
[fuel.git] / mcp / reclass / classes / cluster / mcp-common-ha / openstack_compute_pdf.yml.j2
1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
9 {%- import 'net_map.j2' as nm with context %}
10 {%- import 'net_macros.j2' as ma with context %}
11 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
12 {%- set nics = { nm.cmp001.nic_mgmt: True } %}
13 {%- set vlans = { nm.vlan_mgmt: nm.cmp001.nic_mgmt } %}
14 ---
15 parameters:
16   _param:
17     # Should later be determined via PDF/IDF, AArch64 has ESP on /dev/sda1
18 {%- if nm.cmp001.idx < conf.nodes | length %}
19 {%- if conf.nodes[nm.cmp001.idx].node.type == 'virtual' %}
20     ~cinder_lvm_devices: ['/dev/vdb']
21 {%- elif conf.nodes[nm.cmp001.idx].node.arch == 'aarch64' or
22          conf.nodes[nm.cmp001.idx].disks.0.disk_capacity | storage_size_num | float > 2000000000000 %}
23     ~cinder_lvm_devices: ['/dev/sda2']
24 {%- else %}
25     ~cinder_lvm_devices: ['/dev/sda1']
26 {%- endif %}
27 {%- endif %}
28   linux:
29     network:
30       bridge: openvswitch
31       interface:
32         # PXE/admin is always untagged on computes
33         pxe_admin_int:
34           enabled: true
35           name: ${_param:pxe_admin_interface}
36           proto: static
37           type: eth
38           address: ${_param:pxe_admin_address}
39           netmask: ${_param:opnfv_net_admin_mask}
40           mtu: ${_param:interface_mtu}
41           noifupdown: true
42
43 {#- prevent duplicates for tagged mgmt on the same physical interface as PXE/admin #}
44 {%- if nm.cmp001.nic_admin in nics %}
45   {%- do nics.pop(nm.cmp001.nic_admin) %}
46 {%- endif %}
47 {%- if ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) in nics %}
48   {%- do nics.pop(nm.cmp001.nic_public) %}
49 {%- endif %}
50
51 {{ ma.linux_network_interfaces_nic(nics) }}
52
53 {{ ma.linux_network_interfaces_vlan(vlans) }}
54
55         br-ctl:
56           enabled: true
57           type: bridge
58           proto: static
59           address: ${_param:single_address}
60           netmask: ${_param:opnfv_net_mgmt_mask}
61           use_interfaces:
62             - {{ ma.interface_str(nm.cmp001.nic_mgmt, nm.vlan_mgmt) }}
63         br-floating:
64           enabled: true
65           type: ovs_bridge
66           mtu: ${_param:interface_mtu}
67           proto: static
68           address: ${_param:external_address}
69           netmask: ${_param:opnfv_net_public_mask}
70           use_interfaces:
71             - {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }}
72           gateway: ${_param:opnfv_net_public_gw}
73           name_servers: {{ nm.dns_public }}
74           noifupdown: true
75         {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }}:
76           enabled: true
77           proto: manual
78           ovs_port_type: OVSPort
79           type: ovs_port
80           ovs_bridge: br-floating
81           bridge: br-floating
82           mtu: ${_param:interface_mtu}