Merge "[OVN] Add baremetal support with Neutron DHCP agent"

This commit is contained in:
Zuul 2022-05-05 13:34:54 +00:00 committed by Gerrit Code Review
commit a4a2d91b0e
3 changed files with 14 additions and 2 deletions

View File

@ -373,7 +373,9 @@ MCAST_FLOOD_UNREGISTERED = 'mcast_flood_unregistered'
EXTERNAL_PORT_TYPES = (portbindings.VNIC_DIRECT,
portbindings.VNIC_DIRECT_PHYSICAL,
portbindings.VNIC_MACVTAP)
portbindings.VNIC_MACVTAP,
portbindings.VNIC_BAREMETAL,
)
NEUTRON_AVAILABILITY_ZONES = 'neutron-availability-zones'
OVN_CMS_OPTIONS = 'ovn-cms-options'
@ -396,4 +398,5 @@ OVN_SUPPORTED_VNIC_TYPES = [portbindings.VNIC_NORMAL,
portbindings.VNIC_MACVTAP,
portbindings.VNIC_VHOST_VDPA,
portbindings.VNIC_REMOTE_MANAGED,
portbindings.VNIC_BAREMETAL,
]

View File

@ -165,7 +165,12 @@ def get_lsp_dhcp_opts(port, ip_version):
# in OVN.
lsp_dhcp_disabled = False
lsp_dhcp_opts = {}
if is_network_device_port(port):
vnic_type = port.get(portbindings.VNIC_TYPE, portbindings.VNIC_NORMAL)
# NOTE(lucasagomes): Baremetal does not yet work with OVN's built-in
# DHCP server, disable it for now
if (is_network_device_port(port) or
vnic_type == portbindings.VNIC_BAREMETAL):
lsp_dhcp_disabled = True
else:
mapping = constants.SUPPORTED_DHCP_OPTS_MAPPING[ip_version]

View File

@ -3614,6 +3614,10 @@ class TestOVNMechanismDriverSecurityGroup(MechDriverSetupBase,
_, kwargs = self.mech_driver.nb_ovn.create_lswitch_port.call_args
self.assertNotIn('vif-plug-type', kwargs['options'])
def test_create_port_with_vnic_baremetal(self):
self._test_create_port_with_vnic_type(
portbindings.VNIC_BAREMETAL)
def test_update_port_with_sgs(self):
with self.network() as n, self.subnet(n):
sg1 = self._create_empty_sg('sg1')