Skip to content

Commit f181a8f

Browse files
committed
[OVN] Add baremetal support with Neutron DHCP agent
This patch now creates OVN "external" ports for Neutron ports with VNIC_BAREMETAL. This ports will be scheduled on the OpenStack Controller nodes (or OVN Gateway nodes) and are responsible for replying to the ARP requests coming from the baremetal nodes. This patch also disables OVN's built-in DHCP server for VNIC_BAREMETAL ports. This is because OVN DHCP server does not yet fully support chainloading from PXE to iPXE, this feature is work-in-progress right now. A following patch to this one will be sent in the future adding support for OVN's built-in DHCP server being used with baremetal nodes. This patch implements the "Part 1" from bug #1971431. Partial-bug: #1971431 Change-Id: I6b234fbe1b7c54b41a1b8b430fdf0ac76993af96 Signed-off-by: Lucas Alvares Gomes <[email protected]> (cherry picked from commit 243c209)
1 parent ab2132e commit f181a8f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

neutron/common/ovn/constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@
371371

372372
EXTERNAL_PORT_TYPES = (portbindings.VNIC_DIRECT,
373373
portbindings.VNIC_DIRECT_PHYSICAL,
374-
portbindings.VNIC_MACVTAP)
374+
portbindings.VNIC_MACVTAP,
375+
portbindings.VNIC_BAREMETAL,
376+
)
375377

376378
NEUTRON_AVAILABILITY_ZONES = 'neutron-availability-zones'
377379
OVN_CMS_OPTIONS = 'ovn-cms-options'
@@ -394,4 +396,5 @@
394396
portbindings.VNIC_MACVTAP,
395397
portbindings.VNIC_VHOST_VDPA,
396398
portbindings.VNIC_REMOTE_MANAGED,
399+
portbindings.VNIC_BAREMETAL,
397400
]

neutron/common/ovn/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ def get_lsp_dhcp_opts(port, ip_version):
165165
# in OVN.
166166
lsp_dhcp_disabled = False
167167
lsp_dhcp_opts = {}
168-
if is_network_device_port(port):
168+
vnic_type = port.get(portbindings.VNIC_TYPE, portbindings.VNIC_NORMAL)
169+
170+
# NOTE(lucasagomes): Baremetal does not yet work with OVN's built-in
171+
# DHCP server, disable it for now
172+
if (is_network_device_port(port) or
173+
vnic_type == portbindings.VNIC_BAREMETAL):
169174
lsp_dhcp_disabled = True
170175
else:
171176
mapping = constants.SUPPORTED_DHCP_OPTS_MAPPING[ip_version]

neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,6 +3614,10 @@ def test_create_port_with_vnic_remote_managed(self):
36143614
_, kwargs = self.mech_driver.nb_ovn.create_lswitch_port.call_args
36153615
self.assertNotIn('vif-plug-type', kwargs['options'])
36163616

3617+
def test_create_port_with_vnic_baremetal(self):
3618+
self._test_create_port_with_vnic_type(
3619+
portbindings.VNIC_BAREMETAL)
3620+
36173621
def test_update_port_with_sgs(self):
36183622
with self.network() as n, self.subnet(n):
36193623
sg1 = self._create_empty_sg('sg1')

0 commit comments

Comments
 (0)