neutron/neutron/conf/db/l3_dvr_db.py
LIU Yulong 8f057fb49a DVR: Ignore DHCP port during DVR host query
For large scale deployment, the dvr router will be installed to
the scheduled DHCP host. This will definitely increase the l3
agent service pressure, especially in large number of concurrent
updates, creation, or agent restart.

This patch adds a config ``host_dvr_for_dhcp`` for the DHCP port
device_owner filter during DVR host query. Then if we set
``host_dvr_for_dhcp = False``, L3-agent will not host the DVR router
namespace in its connected networks' DHCP agent hosts.

Closes-Bug: #1609217
Change-Id: I53e20be9b306bf9d3b34ec6a31e3afabd5a0fd6f
2019-08-21 05:35:19 +00:00

39 lines
1.5 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from neutron._i18n import _
ROUTER_DISTRIBUTED_OPTS = [
cfg.BoolOpt('router_distributed',
default=False,
help=_("System-wide flag to determine the type of router "
"that tenants can create. Only admin can override.")),
cfg.BoolOpt('enable_dvr',
default=True,
help=_("Determine if setup is configured for DVR. If False, "
"DVR API extension will be disabled.")),
cfg.BoolOpt('host_dvr_for_dhcp',
default=True,
help=_("Flag to determine if hosting a DVR local router to "
"the DHCP agent is desired. If False, any L3 function "
"supported by the DHCP agent instance will not be "
"possible, for instance: DNS.")),
]
def register_db_l3_dvr_opts(conf=cfg.CONF):
conf.register_opts(ROUTER_DISTRIBUTED_OPTS)