Merge lp:~james-page/openstack-mojo-specs/ext-net-redux into lp:openstack-mojo-specs

Proposed by James Page on 2016-06-16
Status: Merged
Approved by: Ryan Beisner on 2016-07-18
Approved revision: 269
Merged at revision: 264
Proposed branch: lp:~james-page/openstack-mojo-specs/ext-net-redux
Merge into: lp:openstack-mojo-specs
Diff against target: 341 lines (+67/-19)
14 files modified
helper/bundles/baremetal7-next.yaml (+3/-1)
helper/bundles/baremetal7.yaml (+1/-0)
helper/bundles/full-dvr-next.yaml (+2/-0)
helper/bundles/full-next.yaml (+2/-0)
helper/bundles/full-ssl-next.yaml (+2/-0)
helper/bundles/full.yaml (+1/-0)
helper/bundles/ha-next.yaml (+2/-0)
helper/bundles/ha.yaml (+1/-0)
helper/bundles/haphase1-next.yaml (+2/-0)
helper/bundles/haphase2-next.yaml (+2/-0)
helper/bundles/ksv3-full-next.yaml (+2/-0)
helper/bundles/minimal-next.yaml (+2/-0)
helper/setup/network_setup.py (+1/-2)
helper/utils/mojo_os_utils.py (+44/-16)
To merge this branch: bzr merge lp:~james-page/openstack-mojo-specs/ext-net-redux
Reviewer Review Type Date Requested Status
Ryan Beisner 2016-06-16 Needs Information on 2016-07-18
Review via email: mp+297643@code.launchpad.net

Commit message

Rework mojo specs for next to use new style external network configuration.

To post a comment you must log in.
268. By James Page on 2016-06-17

Deal with old and new style networking for stable and next bundles

269. By James Page on 2016-06-17

Rework ext net config a bit

Ryan Beisner (1chb1n) wrote :

#recheck

Ryan Beisner (1chb1n) wrote :

Exercising this branch against virt and metal specs in automation. Will report back here asap.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'helper/bundles/baremetal7-next.yaml'
2--- helper/bundles/baremetal7-next.yaml 2016-04-18 14:36:47 +0000
3+++ helper/bundles/baremetal7-next.yaml 2016-06-17 15:58:16 +0000
4@@ -90,8 +90,9 @@
5 neutron-gateway:
6 charm: neutron-gateway
7 options:
8- ext-port: eth1
9 instance-mtu: 1300
10+ data-port: br-ex:eth1
11+ bridge-mappings: physnet1:br-ex
12 to:
13 - "0"
14 cinder:
15@@ -184,6 +185,7 @@
16 charm: neutron-api
17 options:
18 neutron-security-groups: True
19+ flat-network-providers: physnet1
20 to:
21 - "lxc:nova-compute=0"
22 neutron-openvswitch:
23
24=== modified file 'helper/bundles/baremetal7.yaml'
25--- helper/bundles/baremetal7.yaml 2016-04-22 13:36:35 +0000
26+++ helper/bundles/baremetal7.yaml 2016-06-17 15:58:16 +0000
27@@ -186,6 +186,7 @@
28 charm: neutron-api
29 options:
30 neutron-security-groups: True
31+ flat-network-providers: physnet1
32 to:
33 - "lxc:nova-compute=0"
34 neutron-openvswitch:
35
36=== modified file 'helper/bundles/full-dvr-next.yaml'
37--- helper/bundles/full-dvr-next.yaml 2016-04-18 14:36:47 +0000
38+++ helper/bundles/full-dvr-next.yaml 2016-06-17 15:58:16 +0000
39@@ -117,10 +117,12 @@
40 l2-population: True
41 neutron-security-groups: True
42 enable-dvr: True
43+ flat-network-providers: physnet1
44 neutron-openvswitch:
45 charm: neutron-openvswitch
46 options:
47 enable-local-dhcp-and-metadata: True
48+ bridge-mappings: physnet1:br-ex
49 relations:
50 - [ neutron-api, mysql ]
51 - [ neutron-api, rabbitmq-server ]
52
53=== modified file 'helper/bundles/full-next.yaml'
54--- helper/bundles/full-next.yaml 2016-04-16 16:41:53 +0000
55+++ helper/bundles/full-next.yaml 2016-06-17 15:58:16 +0000
56@@ -46,6 +46,7 @@
57 constraints: mem=1G
58 options:
59 instance-mtu: 1300
60+ bridge-mappings: physnet1:br-ex
61 cinder:
62 charm: cinder
63 options:
64@@ -135,6 +136,7 @@
65 constraints: mem=1G
66 options:
67 neutron-security-groups: True
68+ flat-network-providers: physnet1
69 neutron-openvswitch:
70 charm: neutron-openvswitch
71 relations:
72
73=== modified file 'helper/bundles/full-ssl-next.yaml'
74--- helper/bundles/full-ssl-next.yaml 2016-04-18 14:36:47 +0000
75+++ helper/bundles/full-ssl-next.yaml 2016-06-17 15:58:16 +0000
76@@ -50,6 +50,7 @@
77 constraints: mem=1G
78 options:
79 instance-mtu: 1300
80+ bridge-mappings: physnet1:br-ex
81 cinder:
82 charm: cinder
83 options:
84@@ -139,6 +140,7 @@
85 constraints: mem=1G
86 options:
87 neutron-security-groups: True
88+ flat-network-providers: physnet1
89 neutron-openvswitch:
90 charm: neutron-openvswitch
91 relations:
92
93=== modified file 'helper/bundles/full.yaml'
94--- helper/bundles/full.yaml 2016-04-22 13:36:35 +0000
95+++ helper/bundles/full.yaml 2016-06-17 15:58:16 +0000
96@@ -138,6 +138,7 @@
97 constraints: mem=1G
98 options:
99 neutron-security-groups: True
100+ flat-network-providers: physnet1
101 neutron-openvswitch:
102 charm: neutron-openvswitch
103 relations:
104
105=== modified file 'helper/bundles/ha-next.yaml'
106--- helper/bundles/ha-next.yaml 2016-04-12 16:42:05 +0000
107+++ helper/bundles/ha-next.yaml 2016-06-17 15:58:16 +0000
108@@ -78,6 +78,7 @@
109 constraints: mem=1G
110 options:
111 instance-mtu: 1300
112+ bridge-mappings: physnet1:br-ex
113 cinder:
114 charm: cinder
115 constraints: mem=1G
116@@ -164,6 +165,7 @@
117 options:
118 neutron-security-groups: True
119 vip: 10.5.100.8
120+ flat-network-providers: physnet1
121 neutron-hacluster:
122 charm: hacluster
123 options:
124
125=== modified file 'helper/bundles/ha.yaml'
126--- helper/bundles/ha.yaml 2016-04-12 03:40:52 +0000
127+++ helper/bundles/ha.yaml 2016-06-17 15:58:16 +0000
128@@ -168,6 +168,7 @@
129 options:
130 neutron-security-groups: True
131 vip: 10.5.100.8
132+ flat-network-providers: physnet1
133 neutron-hacluster:
134 charm: hacluster
135 options:
136
137=== modified file 'helper/bundles/haphase1-next.yaml'
138--- helper/bundles/haphase1-next.yaml 2016-04-12 16:42:05 +0000
139+++ helper/bundles/haphase1-next.yaml 2016-06-17 15:58:16 +0000
140@@ -60,6 +60,7 @@
141 num_units: 2
142 options:
143 instance-mtu: 1350
144+ bridge-mappings: physnet1:br-ex
145 cinder:
146 charm: cinder
147 num_units: 2
148@@ -144,6 +145,7 @@
149 options:
150 neutron-security-groups: True
151 vip: 10.5.108.1
152+ flat-network-providers: physnet1
153 neutron-api-hacluster:
154 charm: hacluster
155 options:
156
157=== modified file 'helper/bundles/haphase2-next.yaml'
158--- helper/bundles/haphase2-next.yaml 2016-04-12 16:42:05 +0000
159+++ helper/bundles/haphase2-next.yaml 2016-06-17 15:58:16 +0000
160@@ -60,6 +60,7 @@
161 num_units: 2
162 options:
163 instance-mtu: 1350
164+ bridge-mappings: physnet1:br-ex
165 cinder:
166 charm: cinder
167 num_units: 2
168@@ -187,6 +188,7 @@
169 options:
170 neutron-security-groups: True
171 vip: 10.5.108.1
172+ flat-network-providers: physnet1
173 neutron-api-hacluster:
174 charm: hacluster
175 options:
176
177=== modified file 'helper/bundles/ksv3-full-next.yaml'
178--- helper/bundles/ksv3-full-next.yaml 2016-04-18 14:36:47 +0000
179+++ helper/bundles/ksv3-full-next.yaml 2016-06-17 15:58:16 +0000
180@@ -51,6 +51,7 @@
181 constraints: mem=1G
182 options:
183 instance-mtu: 1300
184+ bridge-mappings: physnet1:br-ex
185 cinder:
186 charm: cinder
187 options:
188@@ -149,6 +150,7 @@
189 constraints: mem=1G
190 options:
191 neutron-security-groups: True
192+ flat-network-providers: physnet1
193 neutron-openvswitch:
194 charm: neutron-openvswitch
195 relations:
196
197=== modified file 'helper/bundles/minimal-next.yaml'
198--- helper/bundles/minimal-next.yaml 2016-04-18 14:36:47 +0000
199+++ helper/bundles/minimal-next.yaml 2016-06-17 15:58:16 +0000
200@@ -33,6 +33,7 @@
201 constraints: mem=1G
202 options:
203 instance-mtu: 1300
204+ bridge-mappings: physnet1:br-ex
205 cinder:
206 charm: cinder
207 options:
208@@ -74,6 +75,7 @@
209 constraints: mem=1G
210 options:
211 neutron-security-groups: True
212+ flat-network-providers: physnet1
213 neutron-openvswitch:
214 charm: neutron-openvswitch
215 relations:
216
217=== modified file 'helper/setup/network_setup.py'
218--- helper/setup/network_setup.py 2016-04-20 10:43:59 +0000
219+++ helper/setup/network_setup.py 2016-06-17 15:58:16 +0000
220@@ -28,8 +28,7 @@
221 ext_network = mojo_os_utils.create_external_network(
222 neutronc,
223 tenant_id,
224- net_info['external_net_name'],
225- net_info['network_type'])
226+ net_info['external_net_name'])
227 mojo_os_utils.create_external_subnet(
228 neutronc,
229 tenant_id,
230
231=== modified file 'helper/utils/mojo_os_utils.py'
232--- helper/utils/mojo_os_utils.py 2016-04-20 10:43:59 +0000
233+++ helper/utils/mojo_os_utils.py 2016-06-17 15:58:16 +0000
234@@ -290,6 +290,25 @@
235 return uuids
236
237
238+BRIDGE_MAPPINGS = 'bridge-mappings'
239+NEW_STYLE_NETWORKING = 'physnet1:br-ex'
240+
241+
242+def deprecated_external_networking(dvr_mode=False):
243+ '''Determine whether deprecated external network mode is in use'''
244+ bridge_mappings = None
245+ if dvr_mode:
246+ bridge_mappings = mojo_utils.juju_get('neutron-openvswitch',
247+ BRIDGE_MAPPINGS)
248+ else:
249+ bridge_mappings = mojo_utils.juju_get('neutron-gateway',
250+ BRIDGE_MAPPINGS)
251+
252+ if bridge_mappings == NEW_STYLE_NETWORKING:
253+ return False
254+ return True
255+
256+
257 def get_net_uuid(neutron_client, net_name):
258 network = neutron_client.list_networks(name=net_name)['networks'][0]
259 return network['id']
260@@ -308,6 +327,12 @@
261 else:
262 uuids = get_gateway_uuids()
263
264+ deprecated_extnet_mode = deprecated_external_networking(dvr_mode)
265+
266+ config_key = 'data-port'
267+ if deprecated_extnet_mode:
268+ config_key = 'ext-port'
269+
270 if not net_id:
271 net_id = get_admin_net(neutronclient)['id']
272
273@@ -331,12 +356,15 @@
274 port = neutronclient.create_port(body=body_value)
275 server.interface_attach(port_id=port['port']['id'],
276 net_id=None, fixed_ip=None)
277- ext_port_macs = []
278+ ext_br_macs = []
279 for port in neutronclient.list_ports(network_id=net_id)['ports']:
280 if 'ext-port' in port['name']:
281- ext_port_macs.append(port['mac_address'])
282- ext_port_macs.sort()
283- ext_port_macs_str = ' '.join(ext_port_macs)
284+ if deprecated_extnet_mode:
285+ ext_br_macs.append(port['mac_address'])
286+ else:
287+ ext_br_macs.append('br-ex:{}'.format(port['mac_address']))
288+ ext_br_macs.sort()
289+ ext_br_macs_str = ' '.join(ext_br_macs)
290 if dvr_mode:
291 service_name = 'neutron-openvswitch'
292 else:
293@@ -345,16 +373,17 @@
294 # the post juju_set check. Try a sleep here to see if some network
295 # reconfigureing on the gateway is still in progress and that's
296 # causing the issue
297- if ext_port_macs:
298- logging.info('Setting ext-port on {} external port to {}'.format(
299- service_name, ext_port_macs_str))
300- current_ext_port = mojo_utils.juju_get(service_name, 'ext-port')
301- if current_ext_port == ext_port_macs_str:
302+ if ext_br_macs:
303+ logging.info('Setting {} on {} external port to {}'.format(
304+ config_key, service_name, ext_br_macs_str))
305+ current_data_port = mojo_utils.juju_get(service_name, config_key)
306+ if current_data_port == ext_br_macs_str:
307 logging.info('Config already set to value')
308 return
309 mojo_utils.juju_set(
310 service_name,
311- 'ext-port={}'.format(ext_port_macs_str),
312+ '{}={}'.format(config_key,
313+ ext_br_macs_str),
314 wait=False
315 )
316 time.sleep(240)
317@@ -384,19 +413,18 @@
318 return network
319
320
321-def create_external_network(neutron_client, tenant_id, net_name='ext_net',
322- network_type='gre'):
323+def create_external_network(neutron_client, tenant_id, net_name='ext_net'):
324 networks = neutron_client.list_networks(name=net_name)
325 if len(networks['networks']) == 0:
326- logging.info('Configuring external bridge')
327+ logging.info('Configuring external network')
328 network_msg = {
329 'name': net_name,
330 'router:external': True,
331 'tenant_id': tenant_id,
332 }
333- if network_type == 'vxlan':
334- network_msg['provider:segmentation_id'] = 1234
335- network_msg['provider:network_type'] = network_type
336+ if not deprecated_external_networking():
337+ network_msg['provider:physical_network'] = 'physnet1'
338+ network_msg['provider:network_type'] = 'flat'
339
340 logging.info('Creating new external network definition: %s',
341 net_name)

Subscribers

People subscribed via source and target branches