If network:dhcp port is deleted, it will never be recreated

Bug #1968136 reported by Giuseppe Petralia
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
networking-ovn
Invalid
Undecided
Unassigned
neutron
Invalid
Medium
Unassigned

Bug Description

If dhcp port of a subnet is deleted, it will never be recreated.

Versions:
=========
neutron: 2:16.4.0-0ubuntu3~cloud0
ovn: 20.03.2-0ubuntu0.20.04.2~cloud0

Steps to reproduce:
===================

1. Network: dc4c5b7c-c749-4815-9feb-08afef46ab45
   Subnet: 1eeb158c-7d98-4d4a-8567-634cc63a00d3
   Dhcp is enabled

   port list shows the dhcp port:

$ openstack port list --network dc4c5b7c-c749-4815-9feb-08afef46ab45 --long
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------+--------+-----------------+--------------+------+
| ID | Name | MAC Address | Fixed IP Addresses | Status | Security Groups | Device Owner | Tags |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------+--------+-----------------+--------------+------+
| 3d58eaae-d9be-4618-9427-8d4e5a402530 | | fa:16:3e:2e:ee:12 | ip_address='192.168.0.2', subnet_id='1eeb158c-7d98-4d4a-8567-634cc63a00d3' | DOWN | | network:dhcp | |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------+--------+-----------------+--------------+------+

2. Disable dhcp on subnet and remove the dhcp port

$ openstack subnet set --no-dhcp 1eeb158c-7d98-4d4a-8567-634cc63a00d3
$ openstack port delete 3d58eaae-d9be-4618-9427-8d4e5a402530

3. Enable dhcp on subnet
$ openstack subnet set --dhcp 1eeb158c-7d98-4d4a-8567-634cc63a00d3

Expected Result
===============
Dhcp port is recreated

Actual Result
=============
Dhcp port is not created

Workaround
==========

Create manually the dhcp port:

$ openstack port create --network 4dc4c5b7c-c749-4815-9feb-08afef46ab45 --device-owner network:dhcp --no-fixed-ip dhcp-port

Toggle dhcp on subnet 1eeb158c-7d98-4d4a-8567-634cc63a00d3 so that an IP will be assigned to the dhcp port

description: updated
description: updated
description: updated
Revision history for this message
Brian Haley (brian-haley) wrote :

Although this was from Ussuri, I tried the same steps on Yoga and it failed the same way. There was also a related error in the server log about not being able to find the metadata port.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote (last edit ):

Hello:

In OVN, the DHCP port is not created. Only when you have a DHCP agent (that receives the subnet updates), the DHCP agent commands to the Neutron server to create or delete the DHCP port.

The confusion here is that this port is not the DHCP port but the metadata port. In Ussuri only, the owner of this port is "network:dhcp"; since [1], the owner is "network:distributed".

This metadata port is created when the network is. You must not delete it; the OVN plugin won't re-create it again.

In hope this explanation is enough to unravel the confusion about the OVN network ports.

Regards.

[1]https://review.opendev.org/c/openstack/neutron/+/732364

Changed in neutron:
status: Confirmed → Invalid
Changed in networking-ovn:
status: New → Invalid
Revision history for this message
Dimos Alevizos (dalevizo) wrote :

> This metadata port is created when the network is. You must not delete it; the OVN plugin won't re-create it again.

And if the port is somehow deleted, how can this be fixed ? Can we manually recreate it ?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.