Populate flat networks in ml2 configuration
'flat_networks' should be configured to specify which physical network can be used as flat network. This patch is to populate'flat_network' based on sysinv. Change-Id: I2cec1e1234976b9d73ce4be74527a5bcbb7bc5eb Closes-bug: #1821150 Signed-off-by: chengli3 <cheng1.li@intel.com>
This commit is contained in:
parent
416dbdd047
commit
2ac4831c66
@ -1006,8 +1006,6 @@ data:
|
||||
metadata_port: 80
|
||||
plugins:
|
||||
ml2_conf:
|
||||
ml2_type_flat:
|
||||
flat_networks: public
|
||||
ml2:
|
||||
mechanism_drivers: openvswitch,sriovnicswitch,l2population
|
||||
path_mtu: 0
|
||||
|
@ -338,11 +338,22 @@ class NeutronHelm(openstack.OpenstackBaseHelm):
|
||||
|
||||
return ",".join(ml2_physical_network_mtus)
|
||||
|
||||
def _get_flat_networks(self):
|
||||
flat_nets = []
|
||||
datanetworks = self.dbapi.datanetworks_get_all()
|
||||
for datanetwork in datanetworks:
|
||||
if datanetwork.network_type == constants.DATANETWORK_TYPE_FLAT:
|
||||
flat_nets.append(str(datanetwork.name))
|
||||
return ",".join(flat_nets)
|
||||
|
||||
def _get_neutron_ml2_config(self):
|
||||
ml2_config = {
|
||||
'ml2': {
|
||||
'physical_network_mtus': self._get_ml2_physical_network_mtus()
|
||||
},
|
||||
'ml2_type_flat': {
|
||||
'flat_networks': self._get_flat_networks()
|
||||
}
|
||||
}
|
||||
LOG.info("_get_neutron_ml2_config=%s" % ml2_config)
|
||||
return ml2_config
|
||||
|
Loading…
x
Reference in New Issue
Block a user