[HA] [cinder] Switch loop to free space on sda
[fuel.git] / mcp / reclass / classes / cluster / mcp-pike-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 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
11 {%- set nics = { nm.cmp001.nic_admin: True, nm.cmp001.nic_mgmt: True } %}
12 {%- set vlans = { nm.vlan_admin: nm.cmp001.nic_admin, nm.vlan_mgmt: nm.cmp001.nic_mgmt } %}
13 ---
14 parameters:
15   _param:
16     # Should later be determined via PDF/IDF, AArch64 has ESP on /dev/sda1
17 {%- if conf.nodes[nm.cmp001.idx].node.arch == 'aarch64' %}
18     ~cinder_lvm_devices: [ '/dev/sda2' ]
19 {%- else %}
20     ~cinder_lvm_devices: [ '/dev/sda1' ]
21 {%- endif %}
22   linux:
23     network:
24       bridge: openvswitch
25       interface:
26 {%- for nic in nics %}
27     {%- if nic == nm.cmp001.nic_admin %}
28         {{ nic }}:
29           enabled: true
30           type: eth
31           proto: dhcp
32           name: {{ nic }}
33     {%- else %}
34         {{ nic }}:
35           enabled: true
36           type: eth
37           proto: manual
38           address: 0.0.0.0
39           {%- if nic == nm.cmp001.nic_public %}
40           netmask: ${_param:opnfv_net_public_mask}
41           {%- else %}
42           netmask: 255.255.255.0
43           {%- endif %}
44           mtu: ${_param:interface_mtu}
45           name: {{ nic }}
46     {%- endif %}
47 {%- endfor %}
48
49 {%- for vlan in vlans %}
50     {%- if vlan and vlan != 'native' %}
51         {{ vlans[vlan] }}.{{ vlan }}:
52           enabled: true
53           proto: manual
54           type: vlan
55           name: {{ vlans[vlan] }}.{{ vlan }}
56           use_interfaces:
57             - {{ vlans[vlan] }}
58     {%- endif %}
59 {%- endfor %}
60
61         br-ctl:
62           enabled: true
63           type: bridge
64           proto: static
65           address: ${_param:single_address}
66           netmask: 255.255.255.0
67           use_interfaces:
68             - {{ nm.cmp001.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
69         br-floating:
70           enabled: true
71           type: ovs_bridge
72           mtu: ${_param:interface_mtu}
73         br-ex:
74           enabled: true
75           type: ovs_port
76           bridge: br-floating
77           proto: static
78           {%- if nm.vlan_public and nm.vlan_public != 'native' %}
79           ovs_options: tag={{ nm.vlan_public }}
80           {%- endif %}
81           address: ${_param:external_address}
82           netmask: 255.255.255.0
83           route:
84             public:
85               address: 0.0.0.0
86               netmask: 0.0.0.0
87               gateway: ${_param:opnfv_net_public_gw}
88         {{ nm.cmp001.nic_public }}:
89           enabled: true
90           proto: manual
91           ovs_port_type: OVSPort
92           type: ovs_port
93           ovs_bridge: br-floating
94           bridge: br-floating