From 2006c0ff35c00753c8df14a25617f3ea0196e536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Wed, 12 May 2021 11:41:35 +0200 Subject: [PATCH] Auto OVN bridge mac mappings for standalone Set OVNStaticBridgeMacMappings for standalone deployments automatically unless the user provided an override. This replaces the implementation in quickstart-extras: https://review.opendev.org/783137 Change-Id: I79d141358ead2a2c90fdb728e17926d96d498a28 Closes-Bug: #1927556 (cherry picked from commit 2f5ad5947b1ad8691062f519ede49ed6748cac58) --- tripleoclient/v1/tripleo_deploy.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tripleoclient/v1/tripleo_deploy.py b/tripleoclient/v1/tripleo_deploy.py index 802ae6ae1..dcd93d368 100644 --- a/tripleoclient/v1/tripleo_deploy.py +++ b/tripleoclient/v1/tripleo_deploy.py @@ -670,10 +670,25 @@ class Deploy(command.Command): ovn_dbs_vip = user_params.get( 'OVNDBsVirtualFixedIPs', [{'ip_address': c_ip, 'use_neutron': False}]) + + ovn_static_bridge_mac_map = user_params.get( + 'OVNStaticBridgeMacMappings', {}) + if not ovn_static_bridge_mac_map: + ovn_bridge_macs = ovn_static_bridge_mac_map.setdefault( + utils.get_short_hostname(), {}) + # NOTE: Hard coding the THT default for NeutronBridgeMappings + # unless user provided an override. + bridge_mappings = user_params.get('NeutronBridgeMappings', + ['datacentre:br-ex']) + physnets = [bridge.split(':')[0] for bridge in bridge_mappings] + for idx, physnet in enumerate(physnets): + ovn_bridge_macs[physnet] = 'fa:16:3a:00:53:{:02X}'.format(idx) + tmp_env.update( { 'RedisVirtualFixedIPs': redis_vip, 'OVNDBsVirtualFixedIPs': ovn_dbs_vip, + 'OVNStaticBridgeMacMappings': ovn_static_bridge_mac_map, 'CtlplaneNetworkAttributes': { 'network': { 'mtu': mtu,