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

Proposed by James Page
Status: Merged
Approved by: Ryan Beisner
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 Needs Information
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

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

269. By James Page

Rework ext net config a bit

Revision history for this message
Ryan Beisner (1chb1n) wrote :

#recheck

Revision history for this message
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
=== modified file 'helper/bundles/baremetal7-next.yaml'
--- helper/bundles/baremetal7-next.yaml 2016-04-18 14:36:47 +0000
+++ helper/bundles/baremetal7-next.yaml 2016-06-17 15:58:16 +0000
@@ -90,8 +90,9 @@
90 neutron-gateway:90 neutron-gateway:
91 charm: neutron-gateway91 charm: neutron-gateway
92 options:92 options:
93 ext-port: eth1
94 instance-mtu: 130093 instance-mtu: 1300
94 data-port: br-ex:eth1
95 bridge-mappings: physnet1:br-ex
95 to:96 to:
96 - "0"97 - "0"
97 cinder:98 cinder:
@@ -184,6 +185,7 @@
184 charm: neutron-api185 charm: neutron-api
185 options:186 options:
186 neutron-security-groups: True187 neutron-security-groups: True
188 flat-network-providers: physnet1
187 to:189 to:
188 - "lxc:nova-compute=0"190 - "lxc:nova-compute=0"
189 neutron-openvswitch:191 neutron-openvswitch:
190192
=== modified file 'helper/bundles/baremetal7.yaml'
--- helper/bundles/baremetal7.yaml 2016-04-22 13:36:35 +0000
+++ helper/bundles/baremetal7.yaml 2016-06-17 15:58:16 +0000
@@ -186,6 +186,7 @@
186 charm: neutron-api186 charm: neutron-api
187 options:187 options:
188 neutron-security-groups: True188 neutron-security-groups: True
189 flat-network-providers: physnet1
189 to:190 to:
190 - "lxc:nova-compute=0"191 - "lxc:nova-compute=0"
191 neutron-openvswitch:192 neutron-openvswitch:
192193
=== modified file 'helper/bundles/full-dvr-next.yaml'
--- helper/bundles/full-dvr-next.yaml 2016-04-18 14:36:47 +0000
+++ helper/bundles/full-dvr-next.yaml 2016-06-17 15:58:16 +0000
@@ -117,10 +117,12 @@
117 l2-population: True117 l2-population: True
118 neutron-security-groups: True118 neutron-security-groups: True
119 enable-dvr: True119 enable-dvr: True
120 flat-network-providers: physnet1
120 neutron-openvswitch:121 neutron-openvswitch:
121 charm: neutron-openvswitch122 charm: neutron-openvswitch
122 options:123 options:
123 enable-local-dhcp-and-metadata: True124 enable-local-dhcp-and-metadata: True
125 bridge-mappings: physnet1:br-ex
124 relations:126 relations:
125 - [ neutron-api, mysql ]127 - [ neutron-api, mysql ]
126 - [ neutron-api, rabbitmq-server ]128 - [ neutron-api, rabbitmq-server ]
127129
=== modified file 'helper/bundles/full-next.yaml'
--- helper/bundles/full-next.yaml 2016-04-16 16:41:53 +0000
+++ helper/bundles/full-next.yaml 2016-06-17 15:58:16 +0000
@@ -46,6 +46,7 @@
46 constraints: mem=1G46 constraints: mem=1G
47 options:47 options:
48 instance-mtu: 130048 instance-mtu: 1300
49 bridge-mappings: physnet1:br-ex
49 cinder:50 cinder:
50 charm: cinder51 charm: cinder
51 options:52 options:
@@ -135,6 +136,7 @@
135 constraints: mem=1G136 constraints: mem=1G
136 options:137 options:
137 neutron-security-groups: True138 neutron-security-groups: True
139 flat-network-providers: physnet1
138 neutron-openvswitch:140 neutron-openvswitch:
139 charm: neutron-openvswitch141 charm: neutron-openvswitch
140 relations:142 relations:
141143
=== modified file 'helper/bundles/full-ssl-next.yaml'
--- helper/bundles/full-ssl-next.yaml 2016-04-18 14:36:47 +0000
+++ helper/bundles/full-ssl-next.yaml 2016-06-17 15:58:16 +0000
@@ -50,6 +50,7 @@
50 constraints: mem=1G50 constraints: mem=1G
51 options:51 options:
52 instance-mtu: 130052 instance-mtu: 1300
53 bridge-mappings: physnet1:br-ex
53 cinder:54 cinder:
54 charm: cinder55 charm: cinder
55 options:56 options:
@@ -139,6 +140,7 @@
139 constraints: mem=1G140 constraints: mem=1G
140 options:141 options:
141 neutron-security-groups: True142 neutron-security-groups: True
143 flat-network-providers: physnet1
142 neutron-openvswitch:144 neutron-openvswitch:
143 charm: neutron-openvswitch145 charm: neutron-openvswitch
144 relations:146 relations:
145147
=== modified file 'helper/bundles/full.yaml'
--- helper/bundles/full.yaml 2016-04-22 13:36:35 +0000
+++ helper/bundles/full.yaml 2016-06-17 15:58:16 +0000
@@ -138,6 +138,7 @@
138 constraints: mem=1G138 constraints: mem=1G
139 options:139 options:
140 neutron-security-groups: True140 neutron-security-groups: True
141 flat-network-providers: physnet1
141 neutron-openvswitch:142 neutron-openvswitch:
142 charm: neutron-openvswitch143 charm: neutron-openvswitch
143 relations:144 relations:
144145
=== modified file 'helper/bundles/ha-next.yaml'
--- helper/bundles/ha-next.yaml 2016-04-12 16:42:05 +0000
+++ helper/bundles/ha-next.yaml 2016-06-17 15:58:16 +0000
@@ -78,6 +78,7 @@
78 constraints: mem=1G78 constraints: mem=1G
79 options:79 options:
80 instance-mtu: 130080 instance-mtu: 1300
81 bridge-mappings: physnet1:br-ex
81 cinder:82 cinder:
82 charm: cinder83 charm: cinder
83 constraints: mem=1G84 constraints: mem=1G
@@ -164,6 +165,7 @@
164 options:165 options:
165 neutron-security-groups: True166 neutron-security-groups: True
166 vip: 10.5.100.8167 vip: 10.5.100.8
168 flat-network-providers: physnet1
167 neutron-hacluster:169 neutron-hacluster:
168 charm: hacluster170 charm: hacluster
169 options:171 options:
170172
=== modified file 'helper/bundles/ha.yaml'
--- helper/bundles/ha.yaml 2016-04-12 03:40:52 +0000
+++ helper/bundles/ha.yaml 2016-06-17 15:58:16 +0000
@@ -168,6 +168,7 @@
168 options:168 options:
169 neutron-security-groups: True169 neutron-security-groups: True
170 vip: 10.5.100.8170 vip: 10.5.100.8
171 flat-network-providers: physnet1
171 neutron-hacluster:172 neutron-hacluster:
172 charm: hacluster173 charm: hacluster
173 options:174 options:
174175
=== modified file 'helper/bundles/haphase1-next.yaml'
--- helper/bundles/haphase1-next.yaml 2016-04-12 16:42:05 +0000
+++ helper/bundles/haphase1-next.yaml 2016-06-17 15:58:16 +0000
@@ -60,6 +60,7 @@
60 num_units: 260 num_units: 2
61 options:61 options:
62 instance-mtu: 135062 instance-mtu: 1350
63 bridge-mappings: physnet1:br-ex
63 cinder:64 cinder:
64 charm: cinder65 charm: cinder
65 num_units: 266 num_units: 2
@@ -144,6 +145,7 @@
144 options:145 options:
145 neutron-security-groups: True146 neutron-security-groups: True
146 vip: 10.5.108.1147 vip: 10.5.108.1
148 flat-network-providers: physnet1
147 neutron-api-hacluster:149 neutron-api-hacluster:
148 charm: hacluster150 charm: hacluster
149 options:151 options:
150152
=== modified file 'helper/bundles/haphase2-next.yaml'
--- helper/bundles/haphase2-next.yaml 2016-04-12 16:42:05 +0000
+++ helper/bundles/haphase2-next.yaml 2016-06-17 15:58:16 +0000
@@ -60,6 +60,7 @@
60 num_units: 260 num_units: 2
61 options:61 options:
62 instance-mtu: 135062 instance-mtu: 1350
63 bridge-mappings: physnet1:br-ex
63 cinder:64 cinder:
64 charm: cinder65 charm: cinder
65 num_units: 266 num_units: 2
@@ -187,6 +188,7 @@
187 options:188 options:
188 neutron-security-groups: True189 neutron-security-groups: True
189 vip: 10.5.108.1190 vip: 10.5.108.1
191 flat-network-providers: physnet1
190 neutron-api-hacluster:192 neutron-api-hacluster:
191 charm: hacluster193 charm: hacluster
192 options:194 options:
193195
=== modified file 'helper/bundles/ksv3-full-next.yaml'
--- helper/bundles/ksv3-full-next.yaml 2016-04-18 14:36:47 +0000
+++ helper/bundles/ksv3-full-next.yaml 2016-06-17 15:58:16 +0000
@@ -51,6 +51,7 @@
51 constraints: mem=1G51 constraints: mem=1G
52 options:52 options:
53 instance-mtu: 130053 instance-mtu: 1300
54 bridge-mappings: physnet1:br-ex
54 cinder:55 cinder:
55 charm: cinder56 charm: cinder
56 options:57 options:
@@ -149,6 +150,7 @@
149 constraints: mem=1G150 constraints: mem=1G
150 options:151 options:
151 neutron-security-groups: True152 neutron-security-groups: True
153 flat-network-providers: physnet1
152 neutron-openvswitch:154 neutron-openvswitch:
153 charm: neutron-openvswitch155 charm: neutron-openvswitch
154 relations:156 relations:
155157
=== modified file 'helper/bundles/minimal-next.yaml'
--- helper/bundles/minimal-next.yaml 2016-04-18 14:36:47 +0000
+++ helper/bundles/minimal-next.yaml 2016-06-17 15:58:16 +0000
@@ -33,6 +33,7 @@
33 constraints: mem=1G33 constraints: mem=1G
34 options:34 options:
35 instance-mtu: 130035 instance-mtu: 1300
36 bridge-mappings: physnet1:br-ex
36 cinder:37 cinder:
37 charm: cinder38 charm: cinder
38 options:39 options:
@@ -74,6 +75,7 @@
74 constraints: mem=1G75 constraints: mem=1G
75 options:76 options:
76 neutron-security-groups: True77 neutron-security-groups: True
78 flat-network-providers: physnet1
77 neutron-openvswitch:79 neutron-openvswitch:
78 charm: neutron-openvswitch80 charm: neutron-openvswitch
79 relations:81 relations:
8082
=== modified file 'helper/setup/network_setup.py'
--- helper/setup/network_setup.py 2016-04-20 10:43:59 +0000
+++ helper/setup/network_setup.py 2016-06-17 15:58:16 +0000
@@ -28,8 +28,7 @@
28 ext_network = mojo_os_utils.create_external_network(28 ext_network = mojo_os_utils.create_external_network(
29 neutronc,29 neutronc,
30 tenant_id,30 tenant_id,
31 net_info['external_net_name'],31 net_info['external_net_name'])
32 net_info['network_type'])
33 mojo_os_utils.create_external_subnet(32 mojo_os_utils.create_external_subnet(
34 neutronc,33 neutronc,
35 tenant_id,34 tenant_id,
3635
=== modified file 'helper/utils/mojo_os_utils.py'
--- helper/utils/mojo_os_utils.py 2016-04-20 10:43:59 +0000
+++ helper/utils/mojo_os_utils.py 2016-06-17 15:58:16 +0000
@@ -290,6 +290,25 @@
290 return uuids290 return uuids
291291
292292
293BRIDGE_MAPPINGS = 'bridge-mappings'
294NEW_STYLE_NETWORKING = 'physnet1:br-ex'
295
296
297def deprecated_external_networking(dvr_mode=False):
298 '''Determine whether deprecated external network mode is in use'''
299 bridge_mappings = None
300 if dvr_mode:
301 bridge_mappings = mojo_utils.juju_get('neutron-openvswitch',
302 BRIDGE_MAPPINGS)
303 else:
304 bridge_mappings = mojo_utils.juju_get('neutron-gateway',
305 BRIDGE_MAPPINGS)
306
307 if bridge_mappings == NEW_STYLE_NETWORKING:
308 return False
309 return True
310
311
293def get_net_uuid(neutron_client, net_name):312def get_net_uuid(neutron_client, net_name):
294 network = neutron_client.list_networks(name=net_name)['networks'][0]313 network = neutron_client.list_networks(name=net_name)['networks'][0]
295 return network['id']314 return network['id']
@@ -308,6 +327,12 @@
308 else:327 else:
309 uuids = get_gateway_uuids()328 uuids = get_gateway_uuids()
310329
330 deprecated_extnet_mode = deprecated_external_networking(dvr_mode)
331
332 config_key = 'data-port'
333 if deprecated_extnet_mode:
334 config_key = 'ext-port'
335
311 if not net_id:336 if not net_id:
312 net_id = get_admin_net(neutronclient)['id']337 net_id = get_admin_net(neutronclient)['id']
313338
@@ -331,12 +356,15 @@
331 port = neutronclient.create_port(body=body_value)356 port = neutronclient.create_port(body=body_value)
332 server.interface_attach(port_id=port['port']['id'],357 server.interface_attach(port_id=port['port']['id'],
333 net_id=None, fixed_ip=None)358 net_id=None, fixed_ip=None)
334 ext_port_macs = []359 ext_br_macs = []
335 for port in neutronclient.list_ports(network_id=net_id)['ports']:360 for port in neutronclient.list_ports(network_id=net_id)['ports']:
336 if 'ext-port' in port['name']:361 if 'ext-port' in port['name']:
337 ext_port_macs.append(port['mac_address'])362 if deprecated_extnet_mode:
338 ext_port_macs.sort()363 ext_br_macs.append(port['mac_address'])
339 ext_port_macs_str = ' '.join(ext_port_macs)364 else:
365 ext_br_macs.append('br-ex:{}'.format(port['mac_address']))
366 ext_br_macs.sort()
367 ext_br_macs_str = ' '.join(ext_br_macs)
340 if dvr_mode:368 if dvr_mode:
341 service_name = 'neutron-openvswitch'369 service_name = 'neutron-openvswitch'
342 else:370 else:
@@ -345,16 +373,17 @@
345 # the post juju_set check. Try a sleep here to see if some network373 # the post juju_set check. Try a sleep here to see if some network
346 # reconfigureing on the gateway is still in progress and that's374 # reconfigureing on the gateway is still in progress and that's
347 # causing the issue375 # causing the issue
348 if ext_port_macs:376 if ext_br_macs:
349 logging.info('Setting ext-port on {} external port to {}'.format(377 logging.info('Setting {} on {} external port to {}'.format(
350 service_name, ext_port_macs_str))378 config_key, service_name, ext_br_macs_str))
351 current_ext_port = mojo_utils.juju_get(service_name, 'ext-port')379 current_data_port = mojo_utils.juju_get(service_name, config_key)
352 if current_ext_port == ext_port_macs_str:380 if current_data_port == ext_br_macs_str:
353 logging.info('Config already set to value')381 logging.info('Config already set to value')
354 return382 return
355 mojo_utils.juju_set(383 mojo_utils.juju_set(
356 service_name,384 service_name,
357 'ext-port={}'.format(ext_port_macs_str),385 '{}={}'.format(config_key,
386 ext_br_macs_str),
358 wait=False387 wait=False
359 )388 )
360 time.sleep(240)389 time.sleep(240)
@@ -384,19 +413,18 @@
384 return network413 return network
385414
386415
387def create_external_network(neutron_client, tenant_id, net_name='ext_net',416def create_external_network(neutron_client, tenant_id, net_name='ext_net'):
388 network_type='gre'):
389 networks = neutron_client.list_networks(name=net_name)417 networks = neutron_client.list_networks(name=net_name)
390 if len(networks['networks']) == 0:418 if len(networks['networks']) == 0:
391 logging.info('Configuring external bridge')419 logging.info('Configuring external network')
392 network_msg = {420 network_msg = {
393 'name': net_name,421 'name': net_name,
394 'router:external': True,422 'router:external': True,
395 'tenant_id': tenant_id,423 'tenant_id': tenant_id,
396 }424 }
397 if network_type == 'vxlan':425 if not deprecated_external_networking():
398 network_msg['provider:segmentation_id'] = 1234426 network_msg['provider:physical_network'] = 'physnet1'
399 network_msg['provider:network_type'] = network_type427 network_msg['provider:network_type'] = 'flat'
400428
401 logging.info('Creating new external network definition: %s',429 logging.info('Creating new external network definition: %s',
402 net_name)430 net_name)

Subscribers

People subscribed via source and target branches