Add constraint to prohibit balance-tcp from BondInterfaceOvsOptions
[apex-tripleo-heat-templates.git] / network / config / bond-with-vlans / controller.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   Software Config to drive os-net-config with 2 bonded nics on a bridge
5   with VLANs attached for the controller role.
6
7 parameters:
8   ControlPlaneIp:
9     default: ''
10     description: IP address/subnet on the ctlplane network
11     type: string
12   ExternalIpSubnet:
13     default: ''
14     description: IP address/subnet on the external network
15     type: string
16   InternalApiIpSubnet:
17     default: ''
18     description: IP address/subnet on the internal API network
19     type: string
20   StorageIpSubnet:
21     default: ''
22     description: IP address/subnet on the storage network
23     type: string
24   StorageMgmtIpSubnet:
25     default: ''
26     description: IP address/subnet on the storage mgmt network
27     type: string
28   TenantIpSubnet:
29     default: ''
30     description: IP address/subnet on the tenant network
31     type: string
32   ManagementIpSubnet: # Only populated when including environments/network-management.yaml
33     default: ''
34     description: IP address/subnet on the management network
35     type: string
36   BondInterfaceOvsOptions:
37     default: 'bond_mode=active-backup'
38     description: The ovs_options string for the bond interface. Set things like
39                  lacp=active and/or bond_mode=balance-slb using this option.
40     type: string
41     constraints:
42       - allowed_pattern: "^((?!balance.tcp).)*$"
43         description: |
44           The balance-tcp bond mode is known to cause packet loss and
45           should not be used in BondInterfaceOvsOptions.
46   ExternalNetworkVlanID:
47     default: 10
48     description: Vlan ID for the external network traffic.
49     type: number
50   InternalApiNetworkVlanID:
51     default: 20
52     description: Vlan ID for the internal_api network traffic.
53     type: number
54   StorageNetworkVlanID:
55     default: 30
56     description: Vlan ID for the storage network traffic.
57     type: number
58   StorageMgmtNetworkVlanID:
59     default: 40
60     description: Vlan ID for the storage mgmt network traffic.
61     type: number
62   TenantNetworkVlanID:
63     default: 50
64     description: Vlan ID for the tenant network traffic.
65     type: number
66   ManagementNetworkVlanID:
67     default: 60
68     description: Vlan ID for the management network traffic.
69     type: number
70   ControlPlaneDefaultRoute: # Override this via parameter_defaults
71     description: The default route of the control plane network.
72     type: string
73   ExternalInterfaceDefaultRoute:
74     default: '10.0.0.1'
75     description: default route for the external network
76     type: string
77   ManagementInterfaceDefaultRoute: # Commented out by default in this template
78     default: unset
79     description: The default route of the management network.
80     type: string
81   ControlPlaneSubnetCidr: # Override this via parameter_defaults
82     default: '24'
83     description: The subnet CIDR of the control plane network.
84     type: string
85   DnsServers: # Override this via parameter_defaults
86     default: []
87     description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
88     type: comma_delimited_list
89   EC2MetadataIp: # Override this via parameter_defaults
90     description: The IP address of the EC2 metadata server.
91     type: string
92
93 resources:
94   OsNetConfigImpl:
95     type: OS::Heat::StructuredConfig
96     properties:
97       group: os-apply-config
98       config:
99         os_net_config:
100           network_config:
101             -
102               type: interface
103               name: nic1
104               use_dhcp: false
105               addresses:
106                 -
107                   ip_netmask:
108                     list_join:
109                       - '/'
110                       - - {get_param: ControlPlaneIp}
111                         - {get_param: ControlPlaneSubnetCidr}
112               routes:
113                 -
114                   ip_netmask: 169.254.169.254/32
115                   next_hop: {get_param: EC2MetadataIp}
116             -
117               type: ovs_bridge
118               name: {get_input: bridge_name}
119               dns_servers: {get_param: DnsServers}
120               members:
121                 -
122                   type: ovs_bond
123                   name: bond1
124                   ovs_options: {get_param: BondInterfaceOvsOptions}
125                   members:
126                     -
127                       type: interface
128                       name: nic2
129                       primary: true
130                     -
131                       type: interface
132                       name: nic3
133                 -
134                   type: vlan
135                   device: bond1
136                   vlan_id: {get_param: ExternalNetworkVlanID}
137                   addresses:
138                     -
139                       ip_netmask: {get_param: ExternalIpSubnet}
140                   routes:
141                     -
142                       default: true
143                       next_hop: {get_param: ExternalInterfaceDefaultRoute}
144                 -
145                   type: vlan
146                   device: bond1
147                   vlan_id: {get_param: InternalApiNetworkVlanID}
148                   addresses:
149                     -
150                       ip_netmask: {get_param: InternalApiIpSubnet}
151                 -
152                   type: vlan
153                   device: bond1
154                   vlan_id: {get_param: StorageNetworkVlanID}
155                   addresses:
156                     -
157                       ip_netmask: {get_param: StorageIpSubnet}
158                 -
159                   type: vlan
160                   device: bond1
161                   vlan_id: {get_param: StorageMgmtNetworkVlanID}
162                   addresses:
163                     -
164                       ip_netmask: {get_param: StorageMgmtIpSubnet}
165                 -
166                   type: vlan
167                   device: bond1
168                   vlan_id: {get_param: TenantNetworkVlanID}
169                   addresses:
170                     -
171                       ip_netmask: {get_param: TenantIpSubnet}
172                 # Uncomment when including environments/network-management.yaml
173                 # If setting default route on the Management interface, comment
174                 # out the default route on the External interface. This will
175                 # make the External API unreachable from remote subnets.
176                 #-
177                 #  type: vlan
178                 #  device: bond1
179                 #  vlan_id: {get_param: ManagementNetworkVlanID}
180                 #  addresses:
181                 #    -
182                 #      ip_netmask: {get_param: ManagementIpSubnet}
183                 #  routes:
184                 #    -
185                 #      default: true
186                 #      next_hop: {get_param: ManagementInterfaceDefaultRoute}
187
188 outputs:
189   OS::stack_id:
190     description: The OsNetConfigImpl resource.
191     value: {get_resource: OsNetConfigImpl}