Comment 2 for bug 1997492

Revision history for this message
Anton Kurbatov (akurbatov) wrote :

Hi Lajos,
If only the device_owner at the port changes and the neutron-server will set the provisioning block, then this will not be very logical, because from the point of view of the dhcp agent, nothing has changed from what needs to be changed in the dnsmasq configs.
In addition, in such a case we may again meet the bug #1982367 and related fix [1] because we will have to force this port to process on the dhcp agent side.
In my opinion more reasonable to set the block provisioning for DHCP if the device_owner is equal to an empty string when creating a port, something like this:

diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py
index e52071aee6..9174a6edfe 100644
--- a/neutron/plugins/ml2/plugin.py
+++ b/neutron/plugins/ml2/plugin.py
@@ -1499,7 +1499,8 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
         if not cfg.CONF.enable_traditional_dhcp:
             return

- if port['device_owner'] in ml2_consts.NO_PBLOCKS_TYPES:
+ if (port['device_owner'] in ml2_consts.NO_PBLOCKS_TYPES and
+ port['device_owner'] != ml2_consts.DEFAULT_DEVICE_OWNER):
             # do not set provisioning_block if it is neutron service port
             return

[1] https://opendev.org/openstack/neutron/commit/06ddcaf4368ce054a8d396e70880f7dd1abe0562